EVE Tool

Discussion in 'General Talk' started by Jobey, Apr 21, 2017.

  1. Jobey

    Jobey Website Administrator Staff Member RimJob Inventor Clan Member Sexy Donator

    Country:
    United Kingdom
    Joined:
    Aug 11, 2015
    Messages:
    300
    Likes Received:
    76
    Trophy Points:
    32
    Gender:
    Male
    Location:
    Cornwall
    Home Page:
    <html>
    <head>
    <title>Makeshift's Super Duper Salvaging Ninja Tool</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
    <!-- Yes, jquery. It was easier. -->
    </head>
    <body>
    <table>
    <tr>
    <td style="vertical-align: top">
    <div id="title" style="font-weight: bold">Step 1</div>
    <span id="instructions">Bookmark ALL of the sites first, naming them by their signature ID.</span><br>
    When you drop an MTU, how long until you should salvage(Minutes): <input type='text' id='salvagetime' value='20'></input>
    </td>
    <td>
    <div>
    <textarea id="probedata" rows="5" cols="50" placeholder="Paste your probe window output here" autofocus></textarea><br>
    <button type="submit" onclick="submitPress()">Submit</button>
    </div>
    </td>
    </tr>
    </table>
    <br>
    <table><tr>
    <td style="background-color: orange;">&nbsp;&nbsp;&nbsp;</td>
    <td>Needs Bookmarking</td>
    <td style="background-color: cyan;">&nbsp;&nbsp;&nbsp;</td>
    <td>Ready to drop MTU</td>
    <td style="background-color: lime;">&nbsp;&nbsp;&nbsp;</td>
    <td>Ready to salvage</td>
    </tr></table>
    <div>
    <div id="tablearea" style="float: left;"></div><br>
    <div id="inputs" style="margin-left: 10px"></div><br>
    </div>
    <script>
    probedata = document.getElementById('probedata');
    title = document.getElementById('title');
    tablearea = document.getElementById('tablearea');
    instructions = document.getElementById('instructions');
    stepTwoB = false;
    firstRun = true;

    sites = [];
    var oldsites;

    function submitPress() {
    if (!stepTwoB) {
    stepTwoB = true;
    genObject();
    title.innerHTML = "Step 2";
    instructions.innerHTML = "Every now and then, copy and paste your probe window into the text area and press submit.";
    } else {
    genObject();
    }
    }

    function genObject() {
    oldsites = sites;
    sites = [];
    const regex = /([A-Z]{3}-[0-9]{3})\tCosmic .+?\tCombat Site\t(.*?)\t/g;
    //Lazy regex - Was meant to support things not combat sites but half way through I changed my mind and didn't want to fix it
    //Mean's it's slightly inefficient, but whatever
    const str = probedata.value;
    probedata.value = "";
    let m;

    while ((m = regex.exec(str)) !== null) {
    // This is necessary to avoid infinite loops with zero-width matches
    if (m.index === regex.lastIndex) {
    regex.lastIndex++;
    }

    var temp;
    // The result can be accessed through the `m`-variable.
    m.forEach((match, groupIndex) => {
    if (groupIndex == 1) {
    temp = match;
    } else if (groupIndex == 2) {
    var oldrow = lookUpRowByID(temp);
    console.log(oldrow);
    var bookmarked;
    var mtud;
    var color;
    var collect;
    var existInOldArray = false;
    var oldID = 0;
    for( var i = 0; i < oldsites.length; i++ )
    if( oldsites.id == temp ){
    existInOldArray = true;
    oldID = i;
    }
    if (typeof oldrow == 'undefined') {
    if (firstRun) {
    bookmarked = "Yes";
    mtud = `<button onclick="swapMTU($(this).parent().parent())">No</button>`;
    collect = `No`;
    color = "style='background-color: white'";
    }else{
    if(!existInOldArray){
    mtud = `<button onclick="swapMTU($(this).parent().parent())">No</button>`;
    bookmarked = `<button onclick="updateBookmark($(this))">No</button>`;
    collect = `No`;
    color = "style='background-color: white'";
    } else {
    mtud = oldsites[oldID].mtud;
    bookmarked = oldsites[oldID].bookmarked;
    collect = oldsites[oldID].collect;
    color = oldsites[oldID].color;
    }
    }
    } else {
    bookmarked = oldsites[oldID].bookmarked;
    mtud = oldsites[oldID].mtud;
    collect = oldsites[oldID].collect;
    color = oldsites[oldID].color;
    }
    sites.push({
    id: temp,
    name: match,
    new: false,
    gone: false,
    bookmarked: bookmarked,
    mtud: mtud,
    collect: collect,
    color: color
    })
    temp = "";
    }
    });
    }
    if (!firstRun) {
    checkForNew(sites, oldsites);
    } else {
    genTable(sites);
    }
    }

    function lookUpRowByID(id) {
    var row;
    if (tablearea.innerHTML.length > 0) {
    for (var i = 0; i < tablearea.children[0].children[0].children.length; i++) {
    if (id == tablearea.children[0].children[0].children.children[0].innerHTML) {
    row = tablearea.children[0].children[0].children;
    }
    }
    return row;
    } else {
    return undefined;
    }
    }

    function checkForNew(siteObject, oldSiteObject) {
    for (var i = 0; i < siteObject.length; i++) {
    foundSiteInOldList = false;
    for (var x = 0; x < oldSiteObject.length; x++) {
    if (siteObject.id == oldSiteObject[x].id) {
    foundSiteInOldList = true;
    }
    }
    if (!foundSiteInOldList) {
    //Site is new
    siteObject.new = true;
    }
    }
    sites = siteObject;
    checkForOld(sites, oldSiteObject);
    }

    function checkForOld(siteObject, oldSiteObject) {
    for (var i = 0; i < oldSiteObject.length; i++) {
    foundSiteInNewList = false;
    for (var x = 0; x < siteObject.length; x++) {
    if (oldSiteObject.id == siteObject[x].id) {
    foundSiteInNewList = true;
    }
    }
    if (!foundSiteInNewList) {
    //Site has gone
    oldSiteObject.gone = true;
    console.log("Gone:")
    console.log(oldSiteObject);
    siteObject.unshift(oldSiteObject);
    }
    }
    sites = siteObject;
    genTable(sites);
    }

    function genTable(siteObject) {
    var header = "<table border='1' style='border-collapse: collapse;'>";
    var tableheaders = `
    <tr>
    <th style="width: 70px; text-align: center">ID</th>
    <th style="width: 250px; text-align: center">Name</th>
    <th style="width: 100px; text-align: center">Bookmarked</th>
    <th style="width: 150px; text-align: center">MTUd</th>
    <th style="width: 60px; text-align: center">Collect</th>
    <th style="width: 80px; text-align: center">Remove</th>
    </tr>
    `;
    var table = "";
    for (var i = 0; i < siteObject.length; i++) {
    if (siteObject.new) {
    siteObject.color = "style='background-color: orange'";
    }
    if (siteObject.gone) {
    siteObject.color = "style='background-color: cyan'";
    }
    if (siteObject.collect == 'Yes') {
    siteObject.color = "style='background-color: lime'";
    }
    if (siteObject.collect == 'Yes' && siteObject.mtud.indexOf("Dropped") !== -1 ) {
    siteObject.color = "style='background-color: white'";
    }
    var tdcolor = siteObject.color;
    var row = `
    <tr ${tdcolor}>
    <td style="text-align: center">${siteObject.id}</td>
    <td style="text-align: center">${siteObject[i].name}</td>
    <td style="text-align: center">${siteObject[i].bookmarked}</td>
    <td style="text-align: center">${siteObject[i].mtud}</td>
    <td style="text-align: center">${siteObject[i].collect}</td>
    <td><button onclick="removeLine($(this))">Remove</button></td>
    </tr>
    `;
    if (siteObject[i].new || siteObject[i].gone) {
    table = row + table;
    } else {
    table += row;
    }
    }
    firstRun = false;
    tablearea.innerHTML = header + tableheaders + table;
    sites = siteObject;
    document.getElementById('inputs').style = "margin-left: 10px";
    }

    function updateBookmark(button) {
    var id = button.parent().parent().children().first().text();
    var index;
    for( var i = 0; i < sites.length; i++ )
    if( sites[i].id == id ){
    sites[i].bookmarked = 'Yes';
    index = i;
    }
    button.parent().parent()[0].style.backgroundColor = 'White';
    sites[index].color = "style='background-color: white'";
    button.parent()[0].innerHTML = 'Yes';
    }

    function swapMTU(button) {
    console.log(button);
    var id = button.children().first().text();
    var today = new Date();
    var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
    var mtud = "Dropped at " + time;
    var index;
    for( var i = 0; i < sites.length; i++ )
    if( sites[i].id == id ){
    sites[i].mtud = mtud;
    index = i;
    }
    button[0].children[3].innerHTML = mtud;
    button[0].style.backgroundColor = 'White'; //wtf? This is broken
    sites[index].color = "style='background-color: white'";
    setTimeout(function() {
    var newrow = lookUpRowByID(id)
    console.log(newrow);
    sites[index].collect = "Yes";
    newrow.style.backgroundColor = 'lime';
    sites[index].mtud = "";
    newrow.children[4].innerHTML = "Yes";
    }, document.getElementById('salvagetime').value*60*1000)
    }

    function removeLine(button) {
    var td = button.parent().parent();
    var id = td.children().first().text();
    for( var i = 0; i < sites.length; i++ ){
    if( sites[i].id == id ){
    sites.splice( i, 1 );
    i = i - 1;
    }
    }
    td.remove();
    }
    </script>
    </body>[/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i]
     
    insertcoins likes this.
  2. KlaB

    KlaB Guest

    F9::
    MouseMove, 400, 100 [30]
    Sleep 100
    Click
    Sleep 50
    Send {F1}
    Sleep 63
    MouseMove, 510, 100 [30]
    Sleep 100
    Click
    Sleep 50
    Send {F2}
    Sleep 63
    MouseMove, 620, 100 [30]
    Sleep 100
    Click
    Sleep 50
    Send {F3}
    Sleep 63
    MouseMove, 730, 100 [30]
    Sleep 100
    Click
    Sleep 50
    Send {F4}
    Sleep 63
    MouseMove, 840, 100 [30]
    Sleep 100
    Click
    Sleep 50
    Send {F5}
    Sleep 63
    MouseMove, 950, 100 [30]
    Sleep 100
    Click
    Sleep 50
    Send {F6}
    Sleep 63
    MouseMove, 1060, 100 [30]
    Sleep 100
    Click
    Sleep 50
    Send {F7}
    Sleep 63
     
    insertcoins likes this.

Share This Page