TEXT 45
Bot.txt Guest on 19th August 2020 07:49:55 PM
  1. to use this bot, copy and paste the below function into firebug's input box
  2. and run it.
  3.  
  4. make sure you're in an area with random encounters and that you have room to
  5. move backwards and forwards (top left and bottom right).
  6.  
  7. to start botting:
  8.         turn();
  9.  
  10. to stop botting:
  11.         window.stopTurns = 1;
  12.  
  13. notes:
  14.  * when HP reaches 50%, you will pause until you regen to 100%
  15.  * when you ask the bot to stop, it will wait until the current battle is over
  16.  * all loot will be looted, until your bag is full
  17.  * 'attack' should be in the first slot of your action bar
  18.  
  19. ----------------------------------------------------------------------------------
  20.  
  21. function turn(){
  22.  
  23.         // if we're in combat, attack!
  24.         if ($('actionbar').style.display == 'block'){
  25.                 VANTHIA.combat.use(0);
  26.                 setTimeout('turn();', 500);
  27.                 return;
  28.         }
  29.  
  30.         if (window.stopTurns){
  31.                 window.stopTurns = 0;
  32.                 return;
  33.         }
  34.         window.stopTurns = 0;  
  35.  
  36.         // if loot is available, take it all
  37.         if ($('lootbar').style.display == 'block'){
  38.  
  39.                 var last_log = $('hud_log').childNodes[$('hud_log').childNodes.length-1];
  40.                 if (last_log.innerHTML == 'Your backpack is full!'){
  41.  
  42.                         VANTHIA.ajax('combat::end');
  43.                 }else{
  44.                         VANTHIA.ajax("combat::lootAll");
  45.                 }
  46.                 setTimeout('turn();', 500);
  47.                 return;
  48.         }
  49.  
  50.         // wait for HP regen once we hit 50%
  51.         if (window.doingRegen){
  52.                 if (parseInt($('bar_hp').style.width) < 160){
  53.                         setTimeout('turn();', 1000);
  54.                         return;
  55.                 }else{
  56.                         window.doingRegen = 0;
  57.                 }
  58.         }
  59.         if (parseInt($('bar_hp').style.width) < 80){
  60.                 window.doingRegen = 1;
  61.                 setTimeout('turn();', 1000);
  62.                 return;
  63.         }
  64.  
  65.         // wait for movement cooldown
  66.         if (VANTHIA.hud.onCooldown()){
  67.                 //console.log("can't move - waiting");
  68.                 setTimeout('turn();', 1000);
  69.                 return;
  70.         }
  71.  
  72.         // move 1 step forwards
  73.         var x = VANTHIA.map.getPlayerX();
  74.         var y = VANTHIA.map.getPlayerY();
  75.         try {
  76.                 if (window.lastStepForwards){
  77.                         window.lastStepForwards = 0;
  78.                         VANTHIA.map.cursor(x, y-1); // backwards
  79.                 }else{
  80.                         window.lastStepForwards = 1;
  81.                         VANTHIA.map.cursor(x, y+1); // forwards
  82.                 }
  83.                 VANTHIA.map.click();
  84.                 VANTHIA.map.click();
  85.         }
  86.         catch (e){
  87.         }
  88.  
  89.         setTimeout('turn();', 1000);
  90. }

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.