Jump to content

liljeep

Members
  • Posts

    2
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by liljeep

  1. Thanks so much for explaining and going into detail about what I was doing wrong!!! I thought I was checking if item was !null but I guess I was doing grounditem instead and like you said, checking for it twice. And yah, the conditional sleep makes much more sense so the bot can resume once item is in inventory rather than clicking multiple times possibly. Thanks so much! you are a lifesaver :)
  2. Trying to upgrade my fighting script with looting capabilities, but for some reason, adding the loot task has made my bot now freeze where I cannot even move the window or click anything, and eventually crashes the bot. Something is obviously wrong with my code here is my task list if(userChoices.equals("Fire giant")) { //tasks.add(new Idle(this)); tasks.add(new Eat(this)); tasks.add(new FightFiregiant(this)); tasks.add(new Loot(this)); } And here is my loot task code public class Loot extends Task { public int GroundID[] = { 10006, 303, 954, 11940, 560, 563, 565, 890, 561, 207, 5295, 5300, 5304, 5315, 211, 213, 217, 215, 2485, 1079, 1113, 1127, 1147, 1163, 1185, 1201, 1213, 1247, 1275, 1289, 1333, 1347, 1359, 1373, 4131, 3122, 1393, 1395, 1397, 1399, 892, 562, 1147, 985, 987, 2366, 2368, 22347, 4151, 1249, 13265, 1149, 1319, 4153, 4154, 4101, 445, 2357, 2354, 2359, 451, 2358, 444, 2356, 2360, 1073 }; public Loot(Fighter script) { super(script); } @Override public boolean canProcess() throws InterruptedException { return script.getGroundItems().closest(GroundID) != null && script.getGroundItems().closest(GroundID).isOnScreen(); //script.getGroundItems().closest(GroundID).isVisible() ; } @Override public void process() throws InterruptedException { script.currentState = Status.LOOTING; GroundItem loot = script.getGroundItems().closest(GroundID); //if (GroundID != null && !script.getInventory().isFull()) if (!script.inventory.isFull()){ loot.interact("Take"); sleep(random(999,1777)); } } } And help would be appreciated! THANKS!
×
×
  • Create New...