Advertisement
deww1

FuserWarriorsGuild - BETA

Jul 20th, 2011
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 23.77 KB | None | 0 0
  1.  
  2.  
  3. /**
  4.  *
  5.  * @author Dew - FuserScripts.cz.cc
  6.  * @author Deww1 - Powerbot.org
  7.  */
  8. import java.awt.Color;
  9. import org.rsbot.event.events.MessageEvent;
  10.  
  11. import org.rsbot.script.*;
  12. import org.rsbot.script.wrappers.*;
  13.  
  14. @ScriptManifest(authors = {"Dew"}, keywords = {"Skeleton"}, name = "FuserWarriorsGuild", description = "Warriors Guild Script Brought to you by: FuserScripts", version = 0.00, website = "http://fuserscripts.cz.cc")
  15.  
  16. public class FuserWarriorsGuild extends Script {
  17.     //variables
  18.  
  19.     // <editor-fold defaultstate="collapsed" desc="General Variables">
  20.     /**
  21.      * Room IDS:<br/>
  22.      * bank - going to bank<br />
  23.      * catapult - doing catapult<br/>
  24.      * animated - doing animated armour<br/>
  25.      * barrel - doing Jimmy's Challenge<br/>
  26.      * dummy - doing dummy attack<br/>
  27.      * shotput - doing Shot Put<br/>
  28.      * cyclops - fight for defender<br/>
  29.      * null - doing nothing..?
  30.      */
  31.     public String getRoom = "null";
  32.  
  33.     // </editor-fold>
  34.  
  35.     // <editor-fold defaultstate="collapsed" desc="Banking Variables/Setters">
  36.     public final int bankBooth = 2213; //the ID of the Banking Booth
  37.     public final int bankNpc = 4296; //the ID of the Banking NPC
  38.     /**
  39.      * 0 - 361(tuna)<br/>
  40.      * 1 - 373(swordfish<br/>
  41.      * 2 - 7946(Monkfish)<br/>
  42.      */
  43.     public int[] foodIds = {361, 373, 7946};
  44.     public int foodID = foodIds[1]; //the food ID to use
  45.     public int withdrawAmount = 1; //amount to withdraw
  46.     public boolean useFood = false; //true if using food
  47.     public boolean usePots = false; //true if using pots
  48.     public boolean banked  = false;
  49.     // </editor-fold>
  50.     // <editor-fold defaultstate="collapsed" desc="Special Settings">
  51.     public boolean useDh = false; //true if using Dharok's
  52.     public boolean useGuth = false; //true if using Guthan's
  53.     // </editor-fold>
  54.     // <editor-fold defaultstate="collapsed" desc="Points at Start Setter">
  55.     public int startInBarrel = 0;
  56.     public int startInStrength = 0;
  57.     public int startInAnimation = 0;
  58.     public int startInCatapult = 0;
  59.     public int startInDummy = 0;
  60.     // </editor-fold>
  61.     // <editor-fold defaultstate="collapsed" desc="Points to Go Setters">
  62.     public int pointsInBarrel = 0; //how many points to go to while doing Jimmy's Challenge
  63.     public int pointsInStrength = 0; //how many points to go to while doing Shot Put
  64.     public int pointsInAnimation = 0; //how many points to go to while doing Animated Armour
  65.     public int pointsInCatapult = 0; //how many points to go to while doing Catapult Defense
  66.     public int pointsInDummy = 0; //how many points to go to while doing Dummy Attack
  67.     // </editor-fold>
  68.     // <editor-fold defaultstate="collapsed" desc="gained Points Setter">
  69.     public int gainedInBarrel = 0;
  70.     public int gainedInStrength = 0;
  71.     public int gainedInAnimation = 0;
  72.     public int gainedInCatapult = 0;
  73.     public int gainedInDummy = 0;
  74.     // </editor-fold>
  75.  
  76.     // <editor-fold defaultstate="collapsed" desc="Current Points Setters">
  77.     public int curInBarrel = 0; //current amount of points in Jimmy's Challenge
  78.     public int curInStrength = 0; //current amount of points in Shot Put
  79.     public int curInAnimation = 0; //current amount of points in Animated Armour
  80.     public int curInCatapult = 0; //current amount of points in Catapult Defense
  81.     public int curInDummy = 0; //current amount of points in Dummy Attack
  82.     // </editor-fold>
  83.     // <editor-fold defaultstate="collapsed" desc="Points Interface Setters">
  84.     public final int POINTS_INTER = 1057;
  85.  
  86.     public final int POINTS_BARREL = 13;
  87.     public final int POINTS_STRENGTH = 16;
  88.     public final int POINTS_ANIMATION = 19;
  89.     public final int POINTS_CATAPULT = 22;
  90.     public final int POINTS_DUMMY = 25;
  91.     // </editor-fold>
  92.  
  93.     // <editor-fold defaultstate="collapsed" desc="Catapult Room">
  94.  
  95.     // <editor-fold defaultstate="collapsed" desc="Catapult Room Variables">
  96.     private int cata_curObj = 0; //the current catapult id
  97.  
  98.     public boolean cata_clicked = false;
  99.     //needed ids
  100.     public final int CSHEILD = 8856; //ID of the catapult Shield
  101.     // </editor-fold>
  102.  
  103.     // <editor-fold defaultstate="collapsed" desc="Catapult Object Setters">
  104.     public final int C_REG = 15616;   //Catapult Regular id
  105.     //usable ids
  106.     public final int C_STAB = 15617; //Catapult Spike id
  107.     public final int C_MAGIC = 15618; //Catapult magic id
  108.     public final int C_BLUNT = 15619; //Catapult blunt id
  109.     public final int C_SLASH = 15620; //Catapult slash id
  110.     // </editor-fold>
  111.  
  112.     // <editor-fold defaultstate="collapsed" desc="Catapult Interface Setters">
  113.     public final int C_INTER = 411; //main catapult room interface
  114.     //components
  115.     public final int C_SLASH_Com = 2;  //slash component
  116.     public final int C_BLUNT_Com = 1; //blunt component
  117.     public final int C_Stab_Com = 0; //slash component
  118.     public final int C_MAGIC_Com = 3; //magic component
  119.     // </editor-fold>
  120.  
  121.     // </editor-fold>
  122.  
  123.     // <editor-fold defaultstate="collapsed" desc="areas">
  124.  
  125.     // <editor-fold defaultstate="collapsed" desc="in guild">
  126.     private boolean inGuild() {//checks if I'm in the Guild or not
  127.         RSArea area1 = new RSArea(new RSTile(2837, 3526), new RSTile(2875, 3553));
  128.         return area1.contains(getMyPlayer().getLocation());
  129.     }
  130.     // </editor-fold>
  131.  
  132.     // <editor-fold defaultstate="collapsed" desc="in bank">
  133.  
  134.     private boolean inBank() {//checks if I'm in the bank or not
  135.         RSArea area1 = new RSArea(new RSTile(2841, 3532, 0), new RSTile(2848, 3541, 0));
  136.         return game.getPlane() == 0 && area1.contains(getMyPlayer().getLocation().getX(), getMyPlayer().getLocation().getY());
  137.     }
  138.     // </editor-fold>
  139.  
  140.     // <editor-fold defaultstate="collapsed" desc="in barrel">
  141.  
  142.     private boolean inBarrel() {//checks if I'm in the Jimmy area or not
  143.         RSArea area1 = new RSArea(new RSTile(2861, 3532, 1), new RSTile(2876, 3539, 1));
  144.         return game.getPlane() == 1 && area1.contains(getMyPlayer().getLocation().getX(), getMyPlayer().getLocation().getY());
  145.     }
  146.     // </editor-fold>
  147.  
  148.     // <editor-fold defaultstate="collapsed" desc="in strength">
  149.  
  150.     private boolean inStrength() {//checks if I'm in the Shot Put area or not
  151.         RSArea area1 = new RSArea(new RSTile(2858, 3540, 1), new RSTile(2876, 3552, 1));
  152.         return game.getPlane() == 1 && area1.contains(getMyPlayer().getLocation().getX(), getMyPlayer().getLocation().getY());
  153.     }
  154.     // </editor-fold>
  155.  
  156.     // <editor-fold defaultstate="collapsed" desc="in animation">
  157.  
  158.     private boolean inAnimation() {//checks if I'm in the Animation area or not
  159.         RSArea area1 = new RSArea(new RSTile(2849, 3530, 0), new RSTile(2861, 3541, 0));
  160.         return game.getPlane() == 0 && area1.contains(getMyPlayer().getLocation().getX(), getMyPlayer().getLocation().getY());
  161.     }
  162.     // </editor-fold>
  163.  
  164.     // <editor-fold defaultstate="collapsed" desc="in catapult">
  165.  
  166.     private boolean inCatapult() {//checks if I'm in the Catapult area or not
  167.         RSArea area1 = new RSArea(new RSTile(2837, 3538), new RSTile(2847, 3545, 1));
  168.         return game.getPlane() == 1 && area1.contains(getMyPlayer().getLocation().getX(), getMyPlayer().getLocation().getY());
  169.     }
  170.     // </editor-fold>
  171.  
  172.     // <editor-fold defaultstate="collapsed" desc="in dummy">
  173.  
  174.     private boolean inDummy() {//checks if I'm in the dummy area or not
  175.         RSArea area1 = new RSArea(new RSTile(2854, 3544, 0), new RSTile(2861, 3551, 0));
  176.         return game.getPlane() == 0 && area1.contains(getMyPlayer().getLocation().getX(), getMyPlayer().getLocation().getY());
  177.     }
  178.     // </editor-fold>
  179.  
  180.     // </editor-fold>
  181.  
  182.     private RSTile cata_doTile = new RSTile(2842, 3541);
  183.     private RSTile cata_runTile = new RSTile(2842, 3540);
  184.     private boolean onCataTile = false;
  185.     public boolean cataShieldEquip = false;
  186.  
  187.     //methods
  188.  
  189.     // <editor-fold defaultstate="collapsed" desc="animated armour setters">
  190.     /**
  191.      * 0 - Bronze
  192.      * 1 - Iron
  193.      * 2 - Steel
  194.      * 3 - Black
  195.      * 4 - Mithril
  196.      * 5 - Adamantite
  197.      * 6 - Rune
  198.      */
  199.     public int[] animtedArmourType = {0, 1, 2, 3, 4, 5, 6};
  200.     public int armourHelm; //helm id
  201.     public int armourBody; //body id
  202.     public int armourLegs; //legs id
  203.     // </editor-fold>
  204.  
  205.     // <editor-fold defaultstate="collapsed" desc="Point Getters">
  206.     /**
  207.      * Type 0 - Barrel<br/>
  208.      * Type 1 - Str<br/>
  209.      * Type 2 - Anim<br/>
  210.      * Type 3 - Cata<br/>
  211.      * Type 4 - Dumm
  212.      * @param type what to get the current points from
  213.      * @return the current amount of points in type
  214.      */
  215.     public int getCurPoints(int type) {
  216.         int points = 0;
  217.         RSInterface main = interfaces.get(this.POINTS_INTER);
  218.         RSComponent barrel = main.getComponent(this.POINTS_BARREL);
  219.         RSComponent str = main.getComponent(this.POINTS_STRENGTH);
  220.         RSComponent anim = main.getComponent(this.POINTS_ANIMATION);
  221.         RSComponent cata = main.getComponent(this.POINTS_CATAPULT);
  222.         RSComponent dumm = main.getComponent(this.POINTS_DUMMY);
  223.         if (main != null && main.isValid()) {
  224.             if (barrel != null && barrel.isValid()
  225.                     && str != null && str.isValid()
  226.                     && anim != null && anim.isValid()
  227.                     && cata != null && cata.isValid()
  228.                     && dumm != null && dumm.isValid()) {
  229.                 switch (type) {
  230.                     case 0:
  231.                         points = Integer.parseInt(barrel.getText());
  232.                         break;
  233.                     case 1:
  234.                         points = Integer.parseInt(str.getText());
  235.                         break;
  236.                     case 2:
  237.                         points = Integer.parseInt(anim.getText());
  238.                         break;
  239.                     case 3:
  240.                         points = Integer.parseInt(cata.getText());
  241.                         break;
  242.                     case 4:
  243.                         points = Integer.parseInt(dumm.getText());
  244.                         break;
  245.                     default:
  246.                         log.warning("Error getting current points!");
  247.                         stopScript();
  248.                 }
  249.             }
  250.         }
  251.         return points;
  252.     }
  253.  
  254.     public void getAllPoints() {
  255.         this.getCurPoints(0);
  256.         this.getCurPoints(1);
  257.         this.getCurPoints(2);
  258.         this.getCurPoints(3);
  259.         this.getCurPoints(4);
  260.     }
  261.  
  262.     /**
  263.      * Sets the current Points
  264.      * @return true if current points were set
  265.      */
  266.     public boolean setCurPoints() {
  267.         curInBarrel = this.getCurPoints(0);
  268.         curInStrength = this.getCurPoints(1);
  269.         curInAnimation = this.getCurPoints(2);
  270.         curInCatapult = this.getCurPoints(3);
  271.         curInDummy = this.getCurPoints(4);
  272.         if (curInBarrel == this.getCurPoints(0) &&
  273.             curInStrength == this.getCurPoints(1) &&
  274.             curInAnimation == this.getCurPoints(2) &&
  275.             curInCatapult == this.getCurPoints(3) &&
  276.             curInDummy == this.getCurPoints(4)) {
  277.             return true;
  278.         }
  279.         return false;
  280.     }
  281.  
  282.     public int getDiff(int type) {
  283.         int difference = 0;
  284.         switch(type) {
  285.             case 0:
  286.                 difference = this.getCurPoints(type)- this.startInBarrel;
  287.                 break;
  288.             case 1:
  289.                 difference = this.getCurPoints(type) - this.startInStrength;
  290.                 break;
  291.             case 2:
  292.                 difference = this.getCurPoints(type)-  this.startInAnimation;
  293.                 break;
  294.             case 3:
  295.                 difference = this.getCurPoints(type) - this.startInCatapult;
  296.                 break;
  297.             case 4:
  298.                 difference = this.getCurPoints(type) - this.startInDummy;
  299.                 break;
  300.             default:
  301.                 log(Color.RED, "[ERROR]GetDiff: Bad Type");
  302.         }
  303.         return difference;
  304.     }
  305.     // </editor-fold>
  306.  
  307.     // <editor-fold defaultstate="collapsed" desc="All Banking Stuff">
  308.     /**
  309.      * this will check if bank is open, if not, it will open bank
  310.      * @return true if the bank is open
  311.      */
  312.     public boolean openBank() {
  313.         RSObject booth = objects.getNearest(this.bankBooth);
  314.         RSNPC banker = npcs.getNearest(this.bankNpc);
  315.         if (!bank.open()) {
  316.             int rand = random(1, 2);
  317.             switch (rand) {
  318.                 case 1:
  319.                     if (booth != null && booth.isOnScreen()) {
  320.                         booth.interact("Use-quickly");
  321.                         sleep(1000, 2500);
  322.                     }
  323.                     break;
  324.                 case 2:
  325.                     if (banker != null && banker.isOnScreen()) {
  326.                         banker.interact("Bank");
  327.                         sleep(1000, 2500);
  328.                     }
  329.                     break;
  330.             }
  331.         }
  332.         return bank.open();
  333.     }
  334.  
  335.     /**
  336.      * this will check if the bank is open. if it is, it will check if foodID is available,<br/>
  337.      * and if there is a greater or equal to amount to withdraw.<br/>
  338.      * if there is, it will withdraw the foodID's withdrawAmount
  339.      * @return true if inventory contains foodID
  340.      */
  341.     public boolean withdrawFood(int item, int amount) {
  342.         if (openBank()) {
  343.             if (bank.getItem(item) != null && bank.getItem(item).getStackSize() >= amount) {
  344.                 bank.withdraw(item, amount);
  345.                 sleep(2000, 4000);
  346.             }
  347.         }
  348.         return inventory.contains(item);
  349.     }
  350.  
  351.     /**
  352.      * checks if the bank is open<br/>
  353.      * then checks if has withdrawn food.<br/>
  354.      * if it has, it will close bank.
  355.      */
  356.     public void closeBank(int item, int amount) {
  357.         if (openBank()) {
  358.             if (withdrawFood(item, amount)) {
  359.                 bank.close();
  360.             }
  361.         }
  362.     }
  363.    
  364.     public void doBank(int item, int amount) {
  365.         int rand = random(1, random(2, 10));
  366.         if (inBank()) {
  367.             openBank();
  368.             withdrawFood(item, amount);
  369.             if (rand != 1) {
  370.                 banked = true;
  371.             } else {
  372.                 closeBank(item, amount);
  373.                 banked = true;
  374.             }
  375.         }
  376.     }
  377.     // </editor-fold>
  378.  
  379.     /**
  380.      *
  381.      * @param item the item to equipped
  382.      * @param action the action to preform on the item
  383.      * @return true if equipement contains one of the item
  384.      */
  385.     public boolean isEquipped(int item, String action) {
  386.         if (inventory.contains(item)) {
  387.             inventory.getItem(item).interact(action);
  388.             return true;
  389.         }
  390.         return equipment.containsOneOf(item);
  391.     }
  392.  
  393.  
  394.  
  395.     // <editor-fold defaultstate="collapsed" desc="Catapult Methods">
  396.     public int catapultCurValue() {
  397.         RSObject reg = objects.getNearest(this.C_REG);
  398.         RSObject stab = objects.getNearest(this.C_STAB);
  399.         RSObject mage = objects.getNearest(this.C_MAGIC);
  400.         RSObject blunt = objects.getNearest(this.C_BLUNT);
  401.         RSObject slash = objects.getNearest(this.C_SLASH);
  402.         if (getRoom.equals("catapult")) {
  403.             if (inCatapult()) {
  404.                 if (reg != null) {
  405.                     cata_curObj = this.C_REG;
  406.                 } else if (stab != null) {
  407.                     cata_curObj = this.C_STAB;
  408.                 } else if (mage != null) {
  409.                     cata_curObj = this.C_MAGIC;
  410.                 } else if (blunt != null) {
  411.                     cata_curObj = this.C_BLUNT;
  412.                 } else if (slash != null) {
  413.                     cata_curObj = this.C_SLASH;
  414.                 }
  415.             }
  416.         }
  417.        // log("ID: "+cata_curObj);
  418.         return cata_curObj;
  419.     }
  420.  
  421.     public int catapultSetShield(int incoming) {
  422.         RSInterface main = interfaces.get(this.C_INTER);
  423.         RSComponent stab = main.getComponent(this.C_Stab_Com);
  424.         RSComponent blunt = main.getComponent(this.C_BLUNT_Com);
  425.         RSComponent slash = main.getComponent(this.C_SLASH_Com);
  426.         RSComponent mage = main.getComponent(this.C_MAGIC_Com);
  427.         if (getRoom.equals("catapult")) {
  428.             int rand = random(1, 15);
  429.             int rand2 = random(1, 4);
  430.             int misclick = 0;
  431.             switch (rand2) {
  432.                 case 1:
  433.                     misclick = stab.getID();
  434.                     break;
  435.                 case 2:
  436.                     misclick = blunt.getID();
  437.                     break;
  438.                 case 3:
  439.                     misclick = slash.getID();
  440.                     break;
  441.                 case 4:
  442.                     misclick = mage.getID();
  443.                     break;
  444.                 default:
  445.                     log("[ERROR]misclick antiban: bad rand2 pick");
  446.             }
  447.             if (inCatapult()) {
  448.                 if (main != null && main.isValid()) {
  449.                     if (stab != null && stab.isValid()
  450.                             && blunt != null && blunt.isValid()
  451.                             && slash != null && slash.isValid()
  452.                             && mage != null && mage.isValid()) {
  453.                         if (incoming == this.C_REG) {
  454.                             cata_clicked = false;
  455.                         } else if (incoming == this.C_STAB) {
  456.                             if (rand > 1 && rand < 15) {
  457.                                 if (!cata_clicked) {
  458.                                     stab.doClick();
  459.                                 }
  460.                                 sleep(500, 1500);
  461.                                 cata_clicked = true;
  462.                             } else if (rand == 15) {
  463.                                 main.getComponent(misclick).doClick();
  464.                                 log("Miss!");
  465.                             } else {
  466.                                 stab.doHover();
  467.                             }
  468.                         } else if (incoming == this.C_BLUNT) {
  469.                             if (rand > 1 && rand < 15) {
  470.                                 if (!cata_clicked) {
  471.                                     blunt.doClick();
  472.                                 }
  473.                                 sleep(500, 1500);
  474.                                 cata_clicked = true;
  475.                             } else if (rand == 15) {
  476.                                 main.getComponent(misclick).doClick();
  477.                                 log("Miss!");
  478.                             } else {
  479.                                 blunt.doHover();
  480.                             }
  481.                         } else if (incoming == this.C_SLASH) {
  482.                             if (rand > 1 && rand < 15) {
  483.                                 if (!cata_clicked) {
  484.                                     slash.doClick();
  485.                                 }
  486.                                 sleep(500, 1500);
  487.                                 cata_clicked = true;
  488.                             } else if (rand == 15) {
  489.                                 main.getComponent(misclick).doClick();
  490.                                 log("Miss!");
  491.                             } else {
  492.                                 slash.doHover();
  493.                             }
  494.                         } else if (incoming == this.C_MAGIC) {
  495.                             if (rand > 1 && rand < 15) {
  496.                                 if (!cata_clicked) {
  497.                                     mage.doClick();
  498.                                 }
  499.                                 sleep(500, 1500);
  500.                                 cata_clicked = true;
  501.                             } else if (rand == 15) {
  502.                                 main.getComponent(misclick).doClick();
  503.                                 log("Miss!");
  504.                             } else {
  505.                                 mage.doHover();
  506.                             }
  507.                         } else {
  508.                             log(Color.RED, "[catapult]ERROR: Bad catpult ID");
  509.                             walking.walkTileOnScreen(this.cata_runTile);
  510.                             log("[FAILSAFE]Running away, and Taking a break....");
  511.                             sleep(5000, 8000);
  512.                             onCataTile = false;
  513.                         }
  514.                     }
  515.                 }
  516.             }
  517.         }
  518.  
  519.         return 0;
  520.     }
  521.     // </editor-fold>
  522.  
  523.  
  524.     // <editor-fold defaultstate="collapsed" desc="onStart">
  525.     @Override
  526.     public boolean onStart() {
  527.         this.startInBarrel = this.getCurPoints(0);
  528.         this.startInStrength = this.getCurPoints(1);
  529.         this.startInAnimation = this.getCurPoints(2);
  530.         this.startInCatapult = this.getCurPoints(3);
  531.         this.startInDummy = this.getCurPoints(4);
  532.  
  533. //        log(""+this.startInBarrel);
  534. //        log(""+this.startInAnimation);
  535. //        log(""+this.startInCatapult);
  536. //        log(""+this.startInDummy);
  537. //        log(""+this.startInStrength);
  538. //        log(""+this.getDiff(0));
  539. //        log(""+this.getDiff(1));
  540. //        log(""+this.getDiff(2));
  541. //        log(""+this.getDiff(3));
  542. //        log(""+this.getDiff(4));
  543.         getRoom = "catapult";
  544.         return true;
  545.     }// </editor-fold>
  546.  
  547.     public int loop() {
  548.         this.getAllPoints();
  549.         if (getRoom.equalsIgnoreCase("bank")) {
  550.             //TODO add bank
  551.         } else if (getRoom.equalsIgnoreCase("catapult")) {
  552.             if (this.cataShieldEquip) {//is equiped
  553.                 if (onCataTile) {
  554.                     this.catapultCurValue();
  555.                     this.catapultSetShield(this.cata_curObj);
  556.                     int oldDiff = this.getDiff(3);
  557.                     //searched - place // on next line.
  558.                         log(""+this.getDiff(3));
  559.                 } else {
  560.                     RSObject cata_doObj = objects.getNearest(15640);
  561.                     if (cata_doObj != null) {
  562.                         walking.walkTileMM(cata_doObj.getLocation());
  563.                         onCataTile = true;
  564.                     }
  565.                 }
  566.  
  567.             } else {//not equiped
  568.                 this.isEquipped(this.CSHEILD, "Wield");
  569.                 if (this.isEquipped(this.CSHEILD, "Wield")) {
  570.                     this.cataShieldEquip = true;
  571.                 }
  572.             }
  573.         } else if (getRoom.equalsIgnoreCase("shotput")) {
  574.             //TODO add shotput
  575.         } else if (getRoom.equalsIgnoreCase("barrel")) {
  576.             //TODO add barrel
  577.         } else if (getRoom.equalsIgnoreCase("animated")) {
  578.             //TODO add animated
  579.         } else if (getRoom.equalsIgnoreCase("dummy")) {
  580.             //TODO add dummy
  581.         } else if (getRoom.equalsIgnoreCase("cyclops")) {
  582.             //TODO add cyclops fighting
  583.         } else {
  584.             log(Color.RED, "[ERROR]GetRoom: Bad area String - Stopping Script!");
  585.             return -1;
  586.         }
  587.  
  588.         return random(400, 1000);
  589.     }
  590.  
  591.     // <editor-fold defaultstate="collapsed" desc="onFinish">
  592.     @Override
  593.     public void onFinish() {
  594.  
  595.     }// </editor-fold>
  596.  
  597.     public void messageReceived(MessageEvent e) {
  598.         String m = e.getMessage().toLowerCase();
  599.         if (m.contains("successfully defend") || m.contains("fail defending")) {
  600.             cata_clicked = false;
  601.         }
  602.     }
  603.  
  604.  
  605.  
  606.  
  607.     //        <editor-fold defaultstate="collapsed" desc="Get Points Test">
  608. //        getAllPoints();
  609. //        sleep(1000);
  610. //        setCurPoints();
  611. //        log(""+curInBarrel);
  612. //        log(""+curInStrength);
  613. //        log(""+curInAnimation);
  614. //        log(""+curInCatapult);
  615. //        log(""+curInDummy);
  616.         // </editor-fold>
  617.     // <editor-fold defaultstate="collapsed" desc="banking test">
  618. //        log("in Bank? "+inBank());
  619. //        if (!inventory.contains(foodID) && !banked) {
  620. //            doBank();
  621. //        } else {
  622. //            return -1;
  623. //        }
  624.         // </editor-fold>
  625. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement