Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package scripts.api.Banking;
- import org.tribot.api.General;
- import org.tribot.api.Timing;
- import org.tribot.api.types.generic.Condition;
- import org.tribot.api2007.Banking;
- import org.tribot.api2007.Game;
- import org.tribot.api2007.Interfaces;
- import org.tribot.api2007.types.RSInterfaceChild;
- /**
- * Created by willb on 21/05/2016.
- */
- public class WBBanking {
- private static final int BANK_MASTER_ID = 12, WITHDRAW_AS_ITEM_ID = 24, WITHDRAW_AS_NOTED_ID = 26;
- public static boolean isNotedOn() {
- return Game.getSetting(115) == 1;
- }
- public static boolean setNoted(boolean noted) {
- if (Banking.isBankScreenOpen()) {
- if (noted && !isNotedOn()) {
- RSInterfaceChild notedInterfaceChild = Interfaces.get(BANK_MASTER_ID, WITHDRAW_AS_NOTED_ID);
- if (notedInterfaceChild != null && notedInterfaceChild.click("Note")) {
- Timing.waitCondition(new Condition() {
- @Override
- public boolean active() {
- General.sleep(10, 30);
- return isNotedOn();
- }
- }, General.random(800, 1200));
- return isNotedOn();
- }
- } else if (!noted && isNotedOn()) {
- RSInterfaceChild itemInterfaceChild = Interfaces.get(BANK_MASTER_ID, WITHDRAW_AS_ITEM_ID);
- if (itemInterfaceChild != null && itemInterfaceChild.click("Item")) {
- Timing.waitCondition(new Condition() {
- @Override
- public boolean active() {
- General.sleep(10, 30);
- return !isNotedOn();
- }
- }, General.random(800, 1200));
- return !isNotedOn();
- }
- }
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement