Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static int getCachedQuantity(){
- RSVarBit cache = RSVarBit.get(3960);
- return cache != null ? cache.getValue() : 0;
- }
- public static int getDefaultWithdrawQuantity(){
- RSVarBit var = RSVarBit.get(6590);
- if(var == null){
- return 1;
- }
- switch(var.getValue()){
- case 0:
- return 1;
- case 1:
- return 5;
- case 2:
- return 10;
- case 3:
- return getCachedQuantity();
- case 4:
- return 0;
- }
- return 1;
- }
- public static boolean setDefaultWithdrawQuantity(String quantity){
- //1,5,10,x,all
- int current = getDefaultWithdrawQuantity();
- if(quantity.equals("X")){
- if(current != 1 && current != 5 && current != 10 && current != 0){
- return true;
- }
- } else if(quantity.equals(Integer.toString(current))){
- return true;
- }
- RSInterface[] quant = InterfaceCache.findInterface(12, new Filter<RSInterface>(){
- @Override
- public boolean accept(RSInterface arg0) {
- String[] actions = arg0.getActions();
- if(actions == null || actions.length != 1)
- return false;
- return actions[0].equals("Default quantity: " + quantity);
- }
- });
- return quant.length > 0 && quant[0].click() && Timing.waitCondition(new BooleanSupplier(){
- @Override
- public boolean getAsBoolean() {
- General.sleep(100);
- return getDefaultWithdrawQuantity() != current;
- }
- }, 2500);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement