Jump to content

Mr Asshole

Members
  • Posts

    1383
  • Joined

  • Last visited

  • Feedback

    95.2%

Everything posted by Mr Asshole

  1. Lol, you caught me there! I initially was going to return if ((on && i == 1) || (!on && i == 0)) as a bool itself rather than having the selector. This would have meant that returning false, whether the Setting menu wouldn't open or whether the Setting interface isn't valid, would have worked against the final conclusion: checking to see whether we interacted with the 'run' button and got the desired outcome. However, I strayed from that idea and decided to shove that condition in a selector and return true so I could implement a safer, conditional recursion. I decided to throw Runtime exceptions to allow developers to examine the source of the problem since, if you create a bool method that handles every problem by just returning false, there's no way to examine the source of the problem without debugging. <embarrassment> ...But I slacked on the new revision and, even though this is a bool method, at no point does it return false. </embarrassment> } else { j.getChild(34).interact(); boolean run = setRun(on); if (!run) throw new RuntimeException("Run toggling failed"); else return true; }to:} else { return j.getChild(34).interact() && setRun(on);/*setRun should return true from the first selector choice. If we didn't interact with the 'run' button, it'll return false before recurring the same method. }That will provide a false returnable, and I don't have to remove any other throwables. You make everything more complicated :P
  2. I'd rather do it right the first time rather than misclick the first time and reloop.
  3. private void setRun() throws InterruptedException { if (currentTab() != Tab.SETTINGS){ openTab(Tab.SETTINGS); sleep(random(300,500)); } if (currentTab() == Tab.SETTINGS){ if (client.getInterface(261)!= null){ client.getInterface(261).getChild(34).interact("Toggle Run"); sleep(random(300,500)); } if (client.getConfig(173) == 0){ return; } } }
  4. You know it will keep trying to do this if you reloop it xD? Better to use configs imo.
  5. All the money he is making. He can't help go on vacation :P
  6. This should be in issues. Wrong forum.
  7. You could compress it into one method instead of writing it like 5 times. Lol. Just call method with parameters for parent Interface and child interface.
  8. Withdraws same items but different doses.. Useful for pots, rings. anything with charges. Finds item in bank from index 0 to last index of item array.
  9. Saw some people asking questions about choosing last withdrawal amount. I decided to write this up. Enjoy. public int getBankSlotForName(String name){ for (Item item : client.getBank().getItems()){ if (item != null && item.getName().equalsIgnoreCase(name)){ return client.getBank().getSlotForId(item.getId()); } } return -1; } private boolean withdrawLastAmount() throws InterruptedException { int slot = getBankSlotForName(name); if (!client.getBank().isSlotVisible(slot)){ client.getBank().scrollToSlot(slot); sleep(100); } if (client.getBank().isSlotVisible(slot)){ if (!client.isMenuOpen()){ MouseDestination item = new RectangleDestination(client.getBank().getAbsoluteSlotPosition(slot)); client.moveMouseTo(item, false, false, true); sleep(100); } if (client.isMenuOpen()){ MouseDestination click = new RectangleDestination(new Rectangle(client.getMenuX(), client.getMenuY() + 18 + (6 * 14 + 1), client.getMenuWidth(), 14)); client.moveMouse(click, false); sleep(100); if (click.destinationReached(client.getMousePosition())) { client.clickMouse(false); return true; } } } return false; }
  10. Jagex has never completely been against bots. They just ban a few here and there to appease customers and to keep their game alive. Bots pay a lot of their membership fees so it wouldn't be logical to ban all bots.
  11. Looks good. Thanks for the contribution.
  12. I thought some of the new coders would need this. Helps if ids ever change for bank items. I haven't seen it happen but you can't be too sure. private boolean withdrawItem(int amount, int... ids) throws InterruptedException { for (Item item : client.getBank().getItems()) { for (int i : ids) { if (item != null && item.getId() == i) { client.getBank().withdraw(item.getId(), amount); return true; } } } return false; } Implementation: String [] itemNames = {Prayer potion(3), Prayer potion(4), etc}; withdraw(2, itemNames); Will iterate through the array and find first item from index 0 to last index of array.
  13. Looks like some third world country gaming setup. Lol
  14. Breaking bad. Omg last episode was such a emotional one. R.i.p heisenberg
  15. NPC cow = closestAttackableNPCForName(new String [] {"Cow"}); if (client.getMyPlayer().getFacing() == null ){ cow.interact("Attack"); sleep(random(500,1000)); }
  16. Next super: master Next global: beastlymaul Next chatbox: Xavier
  17. the instances of an enum must be all caps with underscores seperating words. Instances of an enum are public static final so that's why the naming convention applys. You should also show user how to use it with a jcombobox in a gui with action listener. JComboBox<Spells> spell = new JComboBox<>(Spells.values()) addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { final Spells selected = (Spells) getSelectedItem(); } });
×
×
  • Create New...