Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. package scripts.api.Banking;
  2.  
  3. import org.tribot.api.General;
  4. import org.tribot.api.Timing;
  5. import org.tribot.api.types.generic.Condition;
  6. import org.tribot.api2007.Banking;
  7. import org.tribot.api2007.Game;
  8. import org.tribot.api2007.Interfaces;
  9. import org.tribot.api2007.types.RSInterfaceChild;
  10.  
  11. /**
  12. * Created by willb on 21/05/2016.
  13. */
  14. public class WBBanking {
  15.  
  16. private static final int BANK_MASTER_ID = 12, WITHDRAW_AS_ITEM_ID = 24, WITHDRAW_AS_NOTED_ID = 26;
  17.  
  18. public static boolean isNotedOn() {
  19. return Game.getSetting(115) == 1;
  20. }
  21.  
  22. public static boolean setNoted(boolean noted) {
  23. if (Banking.isBankScreenOpen()) {
  24. if (noted && !isNotedOn()) {
  25. RSInterfaceChild notedInterfaceChild = Interfaces.get(BANK_MASTER_ID, WITHDRAW_AS_NOTED_ID);
  26. if (notedInterfaceChild != null && notedInterfaceChild.click("Note")) {
  27. Timing.waitCondition(new Condition() {
  28. @Override
  29. public boolean active() {
  30. General.sleep(10, 30);
  31. return isNotedOn();
  32. }
  33. }, General.random(800, 1200));
  34. return isNotedOn();
  35. }
  36. } else if (!noted && isNotedOn()) {
  37. RSInterfaceChild itemInterfaceChild = Interfaces.get(BANK_MASTER_ID, WITHDRAW_AS_ITEM_ID);
  38. if (itemInterfaceChild != null && itemInterfaceChild.click("Item")) {
  39. Timing.waitCondition(new Condition() {
  40. @Override
  41. public boolean active() {
  42. General.sleep(10, 30);
  43. return !isNotedOn();
  44. }
  45. }, General.random(800, 1200));
  46. return !isNotedOn();
  47. }
  48. }
  49. }
  50. return false;
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement