Advertisement
Ulsting

AntiBanExtenderUtil

May 17th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.01 KB | None | 0 0
  1. package scripts;
  2.  
  3. import org.tribot.api.util.abc.ABCUtil;
  4. import org.tribot.api2007.Game;
  5. import org.tribot.api2007.Options;
  6.  
  7. public class AntiBanExtenderUtil extends ABCUtil{
  8.     private final ABCUtil ABC_UTIL;
  9.     private int runAt;
  10.    
  11.     public AntiBanExtenderUtil() {
  12.         this.ABC_UTIL = new ABCUtil();
  13.         this.runAt = this.ABC_UTIL.generateRunActivation();
  14.     }
  15.    
  16.     public boolean performTimedAntibans() {
  17.         if (this.ABC_UTIL.shouldCheckTabs()) {
  18.             this.ABC_UTIL.checkTabs();
  19.             return true;
  20.         }
  21.        
  22.         if (this.ABC_UTIL.shouldCheckXP()) {
  23.             this.ABC_UTIL.checkXP();
  24.             return true;
  25.         }
  26.        
  27.         if (this.ABC_UTIL.shouldExamineEntity()) {
  28.             this.ABC_UTIL.examineEntity();
  29.             return true;
  30.         }
  31.        
  32.         if (this.ABC_UTIL.shouldMoveMouse()) {
  33.             this.ABC_UTIL.moveMouse();
  34.             return true;
  35.         }
  36.        
  37.         if (this.ABC_UTIL.shouldPickupMouse()) {
  38.             this.ABC_UTIL.pickupMouse();
  39.             return true;
  40.         }
  41.        
  42.         if (this.ABC_UTIL.shouldRightClick()) {
  43.             this.ABC_UTIL.rightClick();
  44.             return true;
  45.         }
  46.        
  47.         if (this.ABC_UTIL.shouldRotateCamera()) {
  48.             this.ABC_UTIL.rotateCamera();
  49.             return true;
  50.         }
  51.        
  52.         if (this.ABC_UTIL.shouldLeaveGame()) {
  53.             this.ABC_UTIL.leaveGame();
  54.             return true;
  55.         }
  56.        
  57.         return false;
  58.     }
  59.  
  60.     public void activateRunIfAboveThreshhold() {
  61.         if (!Game.isRunOn() && Game.getRunEnergy() >= this.runAt) {
  62.          Options.setRunOn(true);
  63.          this.runAt = this.ABC_UTIL.generateRunActivation();
  64.         }
  65.     }
  66.    
  67.     public void sleepForReactionTime(int waitingTime) {
  68.         final boolean menu_open = this.ABC_UTIL.shouldOpenMenu() && this.ABC_UTIL.shouldHover();
  69.         final boolean hovering = this.ABC_UTIL.shouldHover();
  70.        
  71.         final long hover_option = hovering ? ABCUtil.OPTION_HOVERING : 0;
  72.         final long menu_open_option = menu_open ? ABCUtil.OPTION_MENU_OPEN : 0;
  73.         final int reaction_time = this.ABC_UTIL.generateReactionTime(this.ABC_UTIL.generateBitFlags(waitingTime, hover_option, menu_open_option));
  74.         try {
  75.             this.ABC_UTIL.sleep(reaction_time);
  76.         } catch (final InterruptedException e) {
  77.             return;
  78.         }
  79.     }
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement