Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (bankedLogs >= 200) {
- if (bankArea.contains(getLocalPlayer())) {
- NPC banker = getNpcs().closest(npc -> npc != null && npc.hasAction("Bank"));
- if (banker.interact("Bank")) {
- if (sleepUntil(() -> getBank().isOpen(), 9000)) {
- getBank().setWithdrawMode(BankMode.NOTE);
- getBank().withdrawAll("Logs");
- }
- //// LOGIC TO GO TO BANK, WITHDRAWL ALL LOGS IN NOTED FORM GOSE BETWEEN THESE TWO LINES ////
- //// LOGIC TO GO TO BANK, WITHDRAWL ALL LOGS IN NOTED FORM GOSE BETWEEN THESE TWO LINES ////
- // Once the logs are noted close the bank, and start a trade with the Mule
- getTrade().tradeWithPlayer(""); // Type the Mules name between the " "
- while (!getTrade().isOpen()) {
- log("Waiting for trade to open");
- sleep(1000);
- // Checking every 1 second if the trade window is open
- }
- // If we are past this point the trade window is opened because we left the while loop above
- // Adding the logs to trade
- getTrade().addItem("Logs", 20000); // I don't remember how to trade all of an item so just trading 20000 which is the
- // rough amount we should have, might have a few leftover but it will get them nexttime so who cares
- // now we accept the trade
- getTrade().acceptTrade(1);
- while (getTrade().isOpen(1)) {
- log("Waiting on mule to accept trade");
- sleep(500); // Checking every half a second if the first trade window was accepted by the mule
- }
- // If we are at this point the first trade window was accepted by the bot
- // Accepting the second trade window
- getTrade().acceptTrade(2);
- // Wait for the mule to accept the trade so just sit in this while loop and do nothing until the trade is accepted.
- while (this.getTrade().isOpen(2)) {
- sleep(1000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement