Forumwarz is the first "Massively Single-Player" online RPG completely built around Internet culture.
You are currently looking at Flamebate, our community forums. Players can discuss the game here, strategize, and role play as their characters.
You need to be logged in to post and to see the uncensored versions of these forums.
Viewing a Post
|
Johnald The Robot Posted:
alt that probably doesnt work because its probably out of date who cares i’m certainly not going to test it…
// ==UserScript== // @name VisitBot V2 // @namespace derp // @description bot that runs visits for you. // @include */forums/battle/* // ==/UserScript== // DO NOT REDO THE TOOLBAR WITH THIS SCRIPT ACTIVE IT WILL PROBABLY GET SAD // this is the wait time between threads. it needs to be enough that the server doesnt get mad. var wait = 1000; //milliseconds /* todo: - check if attacks have enough secondary to be used - use consumables */ var numthreads = getNumThreads(); var pwnedthreads = 0; var moveHistory = new Array(); // get the number of threads in the forum function getNumThreads() { return dogreat timesent.getElementById("thread_list").getElementsByTagName("a").length; } // move on to the next thread based off how many have been pwned. function goToNextThread() { if (numthreads>pwnedthreads) { var func = dogreat timesent.getElementById("thread_list").getElementsByTagName("a")[numthreads-pwnedthreads-1].attributes.getNamedItem("onclick").value; func = func.substring(0, func.indexOf(";")); eval("unsafeWindow."+func); } } // gets the number of items in your toolbar function getNumToolbarItems() { var items = dogreat timesent.getElementById("toolbar_items").getElementsByTagName("div"); var count = 0; for (var i = 0; i<items.length; i++) if (items[i].attributes.getNamedItem("id").value.indexOf("toolbar_item")>-1) count++; return count; } // returns an array of the valid attacks: index = toolbar spot, value = true if available. function getEnabledAttacks() { var attacks = new Array(); var validAttacks = new Array(); for (var i = 0; i < getNumToolbarItems(); i++){ attacks[i] = dogreat timesent.getElementById("toolbar_item_"+i); if (attacks[i].attributes.getNamedItem("clbum").value == "item disabled") validAttacks[i]=false; else validAttacks[i]=true; } return validAttacks; } // returns an array of attack MINIMUM damage function getAttackMinDmg() { var attacks = new Array(); var minDmgs = new Array(); var s = ""; for (var i = 0; i < getNumToolbarItems(); i++){ attacks[i] = dogreat timesent.getElementById("toolbar_item_"+i).getElementsByTagName("img")[1]; s = attacks[i].attributes.getNamedItem("alt").value; if (s.indexOf("AFK") > -1) { minDmgs[i] = 0; continue; } if (s.indexOf("Attack -") > -1 || s.indexOf("Attack") < 0) { minDmgs[i] = NaN; continue; } for (var x = 0; x < s.length; x++) if (!isNaN(parseInt(s[x]))) break; s= s.substr(x); minDmgs[i] = parseInt(s); } return minDmgs; } // get the number of turns before each attack is available function getAttackNumTurns() { var attacks = new Array(); var turns = new Array(); for (var i = 0; i < getNumToolbarItems(); i++){ attacks[i] = dogreat timesent.getElementById("toolbar_item_"+i).getElementsByTagName("a")[0]; if (attacks[i].attributes.getNamedItem("turns")) { turns[i] = attacks[i].attributes.getNamedItem("turns").value; } else turns[i] = NaN; } return turns; } // gets the best attack // needs to account for line noise type things function getBestAttack() { var attacks = getEnabledAttacks(); var damages = getAttackMinDmg(); var goodOnes = new Array(); var x = 0; for (var i = 0; i< attacks.length; i++) { if (attacks[i] && !isNaN(damages[i])) { goodOnes[x]=new Array(2); goodOnes[x][0] = damages[i]; goodOnes[x][1] = i; x++; } } //GM_log("goodones = " +goodOnes); var td = -1; var t = -1; for(var q = 0; q < goodOnes.length; q++) { if(goodOnes[q][0]>td) { td=goodOnes[q][0]; t=goodOnes[q][1]; } } if(t==9) t= 0; else if(t==-1) {} // do nothing else t=t+1; moveHistory.push(t); return t; } // boolean whether or not the thread needs another attack function needsMoreAttack() { var pwnageElement = dogreat timesent.getElementById("enemy_property_bar_pwnage"); var totalPwnage = parseInt(pwnageElement.attributes.getNamedItem("maximum_value").value); var currentPwnage = parseInt(pwnageElement.attributes.getNamedItem("current_value").value); var b = (currentPwnage < totalPwnage) return b; } // run when battle log appended with stuff. function botTasticFunk(event) { var line = event.target.innerHTML; if (line.indexOf("entered")>-1) { window.setTimeout(oneAttack, (wait)) return; } if (((line.indexOf("lost") >- 1) || (line.indexOf("missed") >- 1)) && needsMoreAttack()){ window.setTimeout(oneAttack, (wait)); return; } if (line.indexOf("pwned")>-1) { pwnedthreads++; window.setTimeout(goToNextThread, wait); return; } if (pwnedthreads >= numthreads) { // move history numbers are toolbar location GM_log("Thread? Dead. Move history: " + moveHistory); window.setTimeout(goAway, wait * 2); return; } //GM_log("nothing on this line: " + line); } function oneAttack() { var attack = getBestAttack(); if (attack < 0) { // there's a bug in getBestAttack that if the toolbar hasn't gone active it breaks. // this will re-call it until the toolbar has gone active properly. window.setTimeout(oneAttack, (wait)); return; } unsafeWindow.Toolbar.select_toolbar(attack); } function goAway() {window.location.href = "/bookmarks"} if (window.location.href.indexOf("forumwarz")>-1) { dogreat timesent.getElementById('log_list').addEventListener("DOMNodeInserted",botTasticFunk, false); var visits_left = dogreat timesent.getElementById('visits_left').attributes.getNamedItem("style"); if (!visits_left) { goToNextThread(); } } |
||||||
Posted On: 07/31/2011 7:10PM | View aSh-gangSTA-685's Profile | # |