Advertisement
8ishop

Untitled

Mar 21st, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. if (bankedLogs >= 200) {
  2. if (bankArea.contains(getLocalPlayer())) {
  3. NPC banker = getNpcs().closest(npc -> npc != null && npc.hasAction("Bank"));
  4. if (banker.interact("Bank")) {
  5. if (sleepUntil(() -> getBank().isOpen(), 9000)) {
  6. getBank().setWithdrawMode(BankMode.NOTE);
  7. getBank().withdrawAll("Logs");
  8. }
  9. //// LOGIC TO GO TO BANK, WITHDRAWL ALL LOGS IN NOTED FORM GOSE BETWEEN THESE TWO LINES ////
  10.  
  11. //// LOGIC TO GO TO BANK, WITHDRAWL ALL LOGS IN NOTED FORM GOSE BETWEEN THESE TWO LINES ////
  12.  
  13. // Once the logs are noted close the bank, and start a trade with the Mule
  14.  
  15. getTrade().tradeWithPlayer(""); // Type the Mules name between the " "
  16.  
  17. while (!getTrade().isOpen()) {
  18. log("Waiting for trade to open");
  19. sleep(1000);
  20. // Checking every 1 second if the trade window is open
  21. }
  22.  
  23.  
  24. // If we are past this point the trade window is opened because we left the while loop above
  25.  
  26. // Adding the logs to trade
  27. getTrade().addItem("Logs", 20000); // I don't remember how to trade all of an item so just trading 20000 which is the
  28. // rough amount we should have, might have a few leftover but it will get them nexttime so who cares
  29.  
  30. // now we accept the trade
  31. getTrade().acceptTrade(1);
  32.  
  33. while (getTrade().isOpen(1)) {
  34. log("Waiting on mule to accept trade");
  35. sleep(500); // Checking every half a second if the first trade window was accepted by the mule
  36. }
  37.  
  38. // If we are at this point the first trade window was accepted by the bot
  39.  
  40. // Accepting the second trade window
  41. getTrade().acceptTrade(2);
  42.  
  43.  
  44. // Wait for the mule to accept the trade so just sit in this while loop and do nothing until the trade is accepted.
  45. while (this.getTrade().isOpen(2)) {
  46. sleep(1000);
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement