Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 23.54 KB | None | 0 0
  1. import java.awt.Color;
  2. import java.awt.Font;
  3. import java.awt.Graphics;
  4. import java.awt.Point;
  5. import java.util.List;
  6. import java.util.Map;
  7.  
  8. import javax.swing.JOptionPane;
  9.  
  10. import org.rsbot.event.events.ServerMessageEvent;
  11. import org.rsbot.event.listeners.PaintListener;
  12. import org.rsbot.event.listeners.ServerMessageListener;
  13. import org.rsbot.script.Script;
  14. import org.rsbot.script.ScriptManifest;
  15. import org.rsbot.script.wrappers.RSInterface;
  16. import org.rsbot.script.wrappers.RSItemTile;
  17. import org.rsbot.script.wrappers.RSNPC;
  18. import org.rsbot.script.wrappers.RSObject;
  19. import org.rsbot.script.wrappers.RSTile;
  20.  
  21. @ScriptManifest(authors = { "Creative" }, category = "Combat", name = "WarriorGuild Proness", version = 1.7, description = "<html><body><fontcolor=black><center>"
  22.     + "<h2>"
  23.     + "WarriorGuild Pro"
  24.     + " V 1.7</h2>"
  25.     + "Author: "
  26.     + "Creative"
  27.     + "<br><br>Start near kamfreena."
  28.     + "<br>Have your food, and defender that you are using to gain the higher version of in your inventory!"
  29.     + "<br>Informative Paint."
  30.     + "<br>"
  31.     + "<br>Select the Food you would like to use: "
  32.     + "<select name=\"food\"><option>Lobster<option>Salmon<option>Tuna<option>Trout<option>Sharks<option>Monkfish<option>Manta ray<option>Sea turtle<option>Cake<option>Chocolate cake<option>Plain pizza<option>Pineapple pizza<option>Meat pizza<option>Rocktail<option>Swordfish</select>"
  33.     + "<br>"
  34.     + "<br>Select Animated Armour we be using: "
  35.     + "<select name=\"Enemy\"><option>Animated Bronze Armour</option><option>Animated Iron Armour</option><option>Animated Steel Armour</option><option>Animated Black Armour</option><option>Animated Mithril Armour</option><option>Animated Adamant Armour</option><option>Animated Rune Armour</option></select>"
  36.     + "<br>"
  37.     + "<br>Select the defender you want to collect: "
  38.     + "<select name=\"defender\"><option>Bronze</option><option>Iron</option><option>Steel</option><option>Black</option><option>Mithril</option><option>Adamant</option><option>Rune</option></select>"
  39.     + "<br>MouseSpeed<br><input type='checkbox' name='mspe1' value='true'>1 </input><input type='checkbox' name='mspe2' value='true'>2 </input><input type='checkbox' name='mspe3' value='true'>3 </input><input type='checkbox' name='mspe4' value='true'>4 </input><input type='checkbox' name='mspe5' value='true'>5 </input><input type='checkbox' name='mspe6' value='true'>6 </input><input type='checkbox' name='mspe7' value='true'>7 </input><input type='checkbox' name='mspe8' value='true'>8 </input><input type='checkbox' name='mspe9' value='true'>9 </input><input type='checkbox' name='mspe10' value='true'>10 </input></form></body></html>")
  40.     public class WarriorGuildPro extends Script implements PaintListener, ServerMessageListener {
  41.  
  42.     // Npc
  43.     public int cyclops[] = { 6079, 6078, 6080, 4292, 4291, 6081 };
  44.     public int kam = 4289;
  45.     private static final int[] animatedBronze = { 4278 };
  46.     private static final int[] animatedIron = { 4279 };
  47.     private static final int[] animatedSteel = { 4280 };
  48.     private static final int[] animatedBlack = { 4281 };
  49.     private static final int[] animatedMithril = { 4282 };
  50.     private static final int[] animatedAdamant = { 4283 };
  51.     private static final int[] animatedRune = { 4284 };
  52.    
  53.     //Mouse
  54.     public int mspe;
  55.     public static int MouseSpeed = 4;
  56.     public boolean msped1 = false;
  57.     public boolean msped2 = false;
  58.     public boolean msped3 = false;
  59.     public boolean msped4 = false;
  60.     public boolean msped5 = false;
  61.     public boolean msped6 = false;
  62.     public boolean msped7 = false;
  63.     public boolean msped8 = false;
  64.     public boolean msped9 = false;
  65.     public boolean msped10 = false;
  66.  
  67.     // Paint
  68.     public int strengthXP = skills.getCurrentSkillExp(STAT_STRENGTH);
  69.     public int attackXP = skills.getCurrentSkillExp(STAT_ATTACK);
  70.     public int defenseXP = skills.getCurrentSkillExp(STAT_DEFENSE);
  71.     public int hpXP = skills.getCurrentSkillExp(STAT_HITPOINTS);
  72.     public int prayXp = skills.getCurrentSkillExp(STAT_PRAYER);
  73.     public int gainedStr = skills.getCurrentSkillExp(STAT_STRENGTH) - strengthXP;
  74.     public int gainedAtt = skills.getCurrentSkillExp(STAT_ATTACK) - attackXP;
  75.     public int gainedDef = skills.getCurrentSkillExp(STAT_DEFENSE) - defenseXP;
  76.     public int gainedHP = skills.getCurrentSkillExp(STAT_HITPOINTS) - hpXP;
  77.     public int gainedPray = skills.getCurrentSkillExp(STAT_PRAYER) - prayXp;
  78.  
  79.    
  80.  
  81.     // Ids
  82.     public int foodID;
  83.     public int pickD;
  84.     public int useD;
  85.     public int[] Defenders = { 8844, 8845, 8846, 8847, 8848, 8849, 8850 };
  86.     public int Tokens = 8851;
  87.     public int bone = 532;
  88.     public int tokenCount = 0;
  89.     public int tokens = 0;
  90.     public int defendGained = 0;
  91.     public int bankBooth = (2213);
  92.     public int[] animatorID;
  93.     public int[] selectionID;
  94.     public int[] bronzeArmour = { 1117, 1075, 1155, 8851 };
  95.     public int[] ironArmour = { 1115, 1067, 1153, 8851 };
  96.     public int[] steelArmour = { 1119, 1069, 1157, 8851 };
  97.     public int[] blackArmour = { 1125, 1077, 1165, 8851 };
  98.     public int[] mithrilArmour = { 1121, 1071, 1159, 8851 };
  99.     public int[] adamantArmour = { 1123, 1073, 1161, 8851 };
  100.     public int[] runeArmour = { 1127, 1079, 1163, 8851 };
  101.     public int[] gear = { 1117, 1075, 1155, 1115, 1067, 1153,1119, 1069, 1157,1121, 1071, 1159,  1123, 1073, 1161 , 1127, 1079, 1163, 1125, 1077, 1165, 8851 };
  102.     public int[] armour = { 1117, 1075, 1155, 1115, 1067, 1153,1119, 1069, 1157,1121, 1071, 1159,  1123, 1073, 1161 , 1127, 1079, 1163, 1125, 1077, 1165};
  103.     public int bronze = 1117;
  104.     public int iron = 1115;
  105.     public int steel = 1119;
  106.     public int black = 1125;
  107.     public int mithril = 1121;
  108.     public int adamant = 1123;
  109.     public int rune = 1127;
  110.     RSItemTile tile;
  111.     RSItemTile tile1;
  112.     RSItemTile tile2;
  113.     final RSObject Animator = getNearestObjectByID(15621);
  114.     final RSObject animatorOutsideDoors = getNearestObjectByID(33438);
  115.     final RSObject animatorInsideDoors = getNearestObjectByID(33439);
  116.     final RSObject topFloorInDoors = getNearestObjectByID(33438);
  117.     final RSObject topFloorOutsideDoors = getNearestObjectByID(33439);
  118.     final RSObject groundFloorStairs = getNearestObjectByID(1738);
  119.     final RSObject middleFloorStairs = getNearestObjectByID(38012);
  120.     final RSObject topFloorStairs = getNearestObjectByID(15638);
  121.    
  122.     RSTile doorspot = new RSTile(2856,3545);
  123.     RSTile animatorspot  = new RSTile (2854, 3536);
  124.     public RSTile PathToBank[] = { new RSTile(2854,3546), new RSTile(2847,3546), new RSTile(2843,3542)};
  125.     public RSTile PathToDoor[] = { new RSTile(2843,3543), new RSTile(2847,3545), new RSTile(2850,3546), new RSTile(2854,3546)};
  126.  
  127.     // Args
  128.     long startTime = System.currentTimeMillis();
  129.     public long runTime = System.currentTimeMillis() - startTime;
  130.     private String status = "";
  131.     public int healthPercent = 0;
  132.     public int randomHealth[] = new int[2];
  133.     public RSTile doorTile1 = new RSTile(2847, 3541);
  134.     public RSTile doorTile2 = new RSTile(2846, 3541);
  135.     public RSTile doorTile3 = new RSTile(2847, 3541);
  136.     private int Lifepoints;
  137.     final RSNPC thing = getNearestFreeNPCByID(cyclops);
  138.     public boolean bury = false;
  139.     public int TokenAmount;
  140.  
  141.  
  142.     // OnStart
  143.     @Override
  144.     public boolean onStart(Map<String, String> args) {
  145.         int BURY_BONES = JOptionPane.showConfirmDialog(null, "Do you want the bones buried?", "Bury Bones?", JOptionPane.YES_OPTION);
  146.         if (BURY_BONES == 0) {
  147.             bury = true;
  148.         }
  149.        
  150.         setCompass('e');
  151.         startTime = System.currentTimeMillis();
  152.         strengthXP = skills.getCurrentSkillExp(STAT_STRENGTH);
  153.         attackXP = skills.getCurrentSkillExp(STAT_ATTACK);
  154.         defenseXP = skills.getCurrentSkillExp(STAT_DEFENSE);
  155.         hpXP = skills.getCurrentSkillExp(STAT_HITPOINTS);
  156.        
  157.        
  158.         msped1 = args.get("mspe1") != null;
  159.         msped2 = args.get("mspe2") != null;
  160.         msped3 = args.get("mspe3") != null;
  161.         msped4 = args.get("mspe4") != null;
  162.         msped5 = args.get("mspe5") != null;
  163.         msped6 = args.get("mspe6") != null;
  164.         msped7 = args.get("mspe7") != null;
  165.         msped8 = args.get("mspe8") != null;
  166.         msped9 = args.get("mspe9") != null;
  167.         msped10 = args.get("mspe10") != null;
  168.  
  169.         if (args.get("food").equals("Cake")) {
  170.             foodID = 1891;
  171.         } else if (args.get("food").equals("Chocolate cake")) {
  172.             foodID = 1897;
  173.         } else if (args.get("food").equals("Plain pizza")) {
  174.             foodID = 2289;
  175.         } else if (args.get("food").equals("Pineapple pizza")) {
  176.             foodID = 2301;
  177.         } else if (args.get("food").equals("Meat pizza")) {
  178.             foodID = 2293;
  179.         } else if (args.get("food").equals("Lobster")) {
  180.             foodID = 379;
  181.         } else if (args.get("food").equals("Salmon")) {
  182.             foodID = 329;
  183.         } else if (args.get("food").equals("Tuna")) {
  184.             foodID = 361;
  185.         } else if (args.get("food").equals("Trout")) {
  186.             foodID = 333;
  187.         } else if (args.get("food").equals("Sharks")) {
  188.             foodID = 385;
  189.         } else if (args.get("food").equals("Monkfish")) {
  190.             foodID = 7946;
  191.         } else if (args.get("food").equals("Manta ray")) {
  192.             foodID = 391;
  193.         } else if (args.get("food").equals("Sea turtle")) {
  194.             foodID = 397;
  195.         } else if (args.get("food").equals("Swordfish")) {
  196.             foodID = 373;
  197.         } else if (args.get("food").equals("Rocktail")) {
  198.             foodID = 15272;
  199.         }
  200.  
  201.         if (args.get("Enemy").equals("Animated Bronze Armour")) {
  202.             animatorID = animatedBronze;
  203.             selectionID = bronzeArmour;
  204.         } else if (args.get("Enemy").equals("Animated Iron Armour")) {
  205.             animatorID = animatedIron;
  206.             selectionID = ironArmour;
  207.         } else if (args.get("Enemy").equals("Animated Steel Armour")) {
  208.             animatorID = animatedSteel;
  209.             selectionID = steelArmour;
  210.         } else if (args.get("Enemy").equals("Animated Black Armour")) {
  211.             animatorID = animatedBlack;
  212.             selectionID = blackArmour;
  213.         } else if (args.get("Enemy").equals("Animated Mithril Armour")) {
  214.             animatorID = animatedMithril;
  215.             selectionID = mithrilArmour;
  216.         } else if (args.get("Enemy").equals("Animated Adamant Armour")) {
  217.             animatorID = animatedAdamant;
  218.             selectionID = adamantArmour;
  219.         } else if (args.get("Enemy").equals("Animated Rune Armour")) {
  220.             animatorID = animatedRune;
  221.             selectionID = runeArmour;
  222.         }
  223.  
  224.         if (args.get("defender").equals("Bronze")) {
  225.             pickD = 8844;
  226.         } else if (args.get("defender").equals("Iron")) {
  227.             useD = 8844;
  228.             pickD = 8845;
  229.         } else if (args.get("defender").equals("Steel")) {
  230.             useD = 8845;
  231.             pickD = 8846;
  232.         } else if (args.get("defender").equals("Black")) {
  233.             useD = 8846;
  234.             pickD = 8847;
  235.         } else if (args.get("defender").equals("Mithril")) {
  236.             useD = 8847;
  237.             pickD = 8848;
  238.         } else if (args.get("defender").equals("Adamant")) {
  239.             useD = 8848;
  240.             pickD = 8849;
  241.         } else if (args.get("defender").equals("Rune")) {
  242.             useD = 8849;
  243.             pickD = 8850;
  244.         }
  245.  
  246.        
  247.         if (msped1) {
  248.             mspe = 1;
  249.         }
  250.        
  251.         if (msped2) {
  252.             mspe = 2;
  253.         }
  254.        
  255.         if (msped3) {
  256.             mspe = 3;
  257.         }
  258.        
  259.         if (msped4) {
  260.             mspe = 4;
  261.         }
  262.        
  263.         if (msped5) {
  264.             mspe = 5;
  265.         }
  266.  
  267.         if (msped6) {
  268.             mspe = 6;
  269.         }
  270.  
  271.         if (msped7) {
  272.             mspe = 7;
  273.         }
  274.  
  275.         if (msped8) {
  276.             mspe = 8;
  277.         }
  278.        
  279.         if (msped9) {
  280.             mspe = 9;
  281.         }
  282.        
  283.         if (msped10) {
  284.             mspe = 10;
  285.         }
  286.        
  287.         return true;
  288.     }
  289.  
  290.     // Methods
  291.    
  292.     public boolean atDoor() {
  293.         RSObject door = getNearestObjectByID(819);
  294.         if (door == null)
  295.             return false;
  296.         return tileOnScreen(door.getLocation());
  297.     }
  298.    
  299.     public boolean atBank() {
  300.         RSObject banker = getNearestObjectByID(2213);
  301.         if (banker == null)
  302.             return false;
  303.         return tileOnScreen(banker.getLocation());
  304.     }
  305.    
  306.     public boolean atAnimator() {
  307.         RSObject anim = getNearestObjectByID(15621);
  308.         if (anim == null)
  309.             return false;
  310.         return tileOnScreen(anim.getLocation());
  311.     }
  312.    
  313.     public boolean atCyclops() {
  314.         RSNPC beast = getNearestNPCByID(cyclops);
  315.         if (beast == null)
  316.             return false;
  317.         return tileOnScreen(beast.getLocation());
  318.     }
  319.  
  320.    
  321.     private boolean inSquare(int maxX, int maxY, int minX, int minY) {
  322.         int x = getMyPlayer().getLocation().getX();
  323.         int y = getMyPlayer().getLocation().getY();
  324.         if (x >= minX && x <= maxX && y >= minY && y <= maxY)
  325.             return true;
  326.         return false;
  327.     }
  328.  
  329.     private int getCurrentLifepoint() {
  330.         if (RSInterface.getInterface(748).getChild(8).isValid()) {
  331.             if (RSInterface.getInterface(748).getChild(8).getText() != null) {
  332.                 Lifepoints = Integer.parseInt(RSInterface.getInterface(748)
  333.                         .getChild(8).getText());
  334.             } else {
  335.                 log.severe("Getting lifepoints Error");
  336.             }
  337.         } else {
  338.             log.warning("HP Interface is not valid");
  339.         }
  340.  
  341.         return Lifepoints;
  342.     }
  343.  
  344.     public void pickUp() {
  345.         tile = getNearestGroundItemByID(Defenders);
  346.         if (tile != null) {
  347.             atTile(tile, "Defender");
  348.             wait(2000);
  349.         }
  350.     }
  351.    
  352.     public void pickgear() {
  353.         tile2 = getNearestGroundItemByID(gear);
  354.        
  355.         if (tile2 != null) {
  356.             atTile(tile2, "Take Warrior");
  357.             wait(1500);
  358.             atTile(tile2, "Take");
  359.             wait(1000);
  360.             atTile(tile2, "Take");
  361.             wait(1000);
  362.             atTile(tile2, "Take");
  363.             wait(2000);
  364.             }
  365.     }
  366.  
  367.     public void pickBury() {
  368.         tile1 = getNearestGroundItemByID(532);
  369.         //if (tile1 != null) {
  370.             atTile(tile1, "Take Big");
  371.             wait(2000);
  372.             atInventoryItem(bone, "Bury");
  373.             wait(2500);
  374.         //}
  375.     }
  376.    
  377.      protected int getMouseSpeed() {
  378.            return mspe;
  379.     }
  380.  
  381.  
  382.     // Credit to whom ever made this. Most effective method ever used =D
  383.     private boolean ATTACKNPC(final RSNPC npc, final String action) {
  384.         final RSTile tile = npc.getLocation();
  385.         tile.randomizeTile(1, 1);
  386.         try {
  387.             final int hoverRand = random(8, 13);
  388.             for (int i = 0; i < hoverRand; i++) {
  389.                 final Point screenLoc = npc.getScreenLocation();
  390.                 if (!pointOnScreen(screenLoc)) {
  391.                     status = "Searching...";
  392.                     setCameraRotation(getCameraAngle() + random(-35, 150));
  393.                     return true;
  394.                 }
  395.  
  396.                 moveMouse(screenLoc, 15, 15);
  397.  
  398.                 final List<String> menuItems = getMenuItems();
  399.                 if (menuItems.isEmpty() || menuItems.size() <= 1) {
  400.                     continue;
  401.                 }
  402.                 if (menuItems.get(0).toLowerCase().contains(
  403.                         npc.getName().toLowerCase())
  404.                         && getMyPlayer().getInteracting() == null) {
  405.                     clickMouse(true);
  406.                     return true;
  407.                 } else {
  408.                     for (int a = 1; a < menuItems.size(); a++) {
  409.                         if (menuItems.get(a).toLowerCase().contains(
  410.                                 npc.getName().toLowerCase())
  411.                                 && getMyPlayer().getInteracting() == null) {
  412.                             clickMouse(false);
  413.                             return atMenu(action);
  414.                         }
  415.                     }
  416.                 }
  417.             }
  418.  
  419.         } catch (final Exception e) {
  420.             log.warning("ATTACKNPC(RSNPC, String) error: " + e);
  421.             return false;
  422.         }
  423.         return false;
  424.     }
  425.  
  426.     private boolean isinlocation(int smallestx, int smallesty, int biggestx, int biggesty) {
  427.         int x = getMyPlayer().getLocation().getX();
  428.         int y = getMyPlayer().getLocation().getY();
  429.         if (smallestx <= x && x <= biggestx && smallesty <= y && y <= biggesty)
  430.             return true;
  431.         else
  432.             return false;
  433.     }
  434.    
  435.        private int walkPath(final RSTile[] path) {
  436.  
  437.             if (distanceTo(getDestination()) <= random(5, 12)
  438.                     || !getMyPlayer().isMoving()) {
  439.                 walkPathMM(randomizePath(path, 2, 2), 15);
  440.             }
  441.             return random(400,600);
  442.         }
  443.        
  444.  
  445.     // Paint
  446.     public void onRepaint(final Graphics g) {
  447.         long millis = System.currentTimeMillis() - startTime;
  448.         if (isLoggedIn()) {
  449.  
  450.             long hours = millis / (1000 * 60 * 60);
  451.             millis -= hours * (1000 * 60 * 60);
  452.             long minutes = millis / (1000 * 60);
  453.             millis -= minutes * (1000 * 60);
  454.             long seconds = millis / 1000;
  455.  
  456.             int gainedStr = skills.getCurrentSkillExp(STAT_STRENGTH)
  457.             - strengthXP;
  458.             int gainedAtt = skills.getCurrentSkillExp(STAT_ATTACK) - attackXP;
  459.             int gainedDef = skills.getCurrentSkillExp(STAT_DEFENSE) - defenseXP;
  460.             int gainedHP = skills.getCurrentSkillExp(STAT_HITPOINTS) - hpXP;
  461.             int gainedPray = skills.getCurrentSkillExp(STAT_PRAYER) - prayXp;
  462.  
  463.             if (isLoggedIn()) {
  464.                 g.setColor(new Color(0, 0, 0, 175));
  465.                 g.fillRoundRect(555, 210, 175, 250, 0, 0);
  466.                 g.setColor(Color.cyan);
  467.                 g.draw3DRect(555, 210, 175, 250, true);
  468.                 g.setFont(new Font("Trebuchet MS", Font.PLAIN, 14));
  469.                 g.drawString("WarriorGuild Pro ", 560, 230);
  470.                 g.setColor(Color.white);
  471.                 g.setFont(new Font("Trebuchet MS", Font.PLAIN, 12));
  472.                 g.drawString("Time running: " + hours + ":" + minutes + ":" + seconds, 560, 245);
  473.                 g.setColor(Color.red);
  474.                 g.drawString("Attack Xp: " + gainedAtt, 560, 270);
  475.                 g.setColor(Color.green);
  476.                 g.drawString("Strength Xp: " + gainedStr, 560, 295);
  477.                 g.setColor(Color.white);
  478.                 g.drawString("Defense Xp: " + gainedDef, 560, 320);
  479.                 g.setColor(Color.red);
  480.                 g.drawString("Hitpoint Xp: " + gainedHP, 560, 345);
  481.                 g.setColor(Color.yellow);
  482.                 g.drawString("Prayer Xp: " + gainedPray, 560, 370);
  483.                 g.setColor(Color.cyan);
  484.                 g.drawString("Defenders Gained: " + defendGained, 560, 395);
  485.                 g.setColor(Color.yellow);
  486.                 g.drawString("Tokens: " + tokens, 560, 420);
  487.                 g.setColor(Color.white);
  488.                 g.drawString("Status: " + status, 560, 445);
  489.                 g.setFont(new Font("Palatino Linotype", Font.ITALIC, 10));
  490.                 g.drawString("- Creative", 687, 220);
  491.                 g.drawString("V 1.7", 704, 456);
  492.             }
  493.         }
  494.     }
  495.  
  496.     @Override
  497.     public int loop() {
  498.         setCameraAltitude(true);
  499.        
  500.         tokens = getInventoryCount(Tokens);
  501.        
  502.         if (bury && (!isInventoryFull() && getMyPlayer().getInteracting() == null)) {
  503.             pickBury();
  504.         }
  505.        
  506.         if(inventoryContains(bone)){
  507.             status = "Burying...";
  508.             atInventoryItem(bone, "Bury");
  509.             wait(2500);
  510.         }
  511.  
  512.         if (!isInventoryFull()) {
  513.             pickUp();
  514.         }
  515.        
  516.         if(atCyclops() && (!inventoryContains(foodID))){
  517.             RSObject escape = getNearestObjectByID(33438);
  518.             walkTileMM(doorTile3);
  519.             wait(1000);
  520.             setCompass('w');
  521.             atObject(escape, "Open");
  522.             wait(1000);
  523.            
  524.         }
  525.  
  526.         if (getNearestGroundItemByID(gear) != null && (!isInventoryFull())) {
  527.             status = "Looting...";
  528.             pickgear();
  529.         }
  530.        
  531.         if (getNearestGroundItemByID(gear) != null && (isInventoryFull())) {
  532.             atInventoryItem(foodID, "Eat");
  533.             wait(400);
  534.             atInventoryItem(foodID, "Eat");
  535.             wait(400);
  536.             atInventoryItem(foodID, "Eat");
  537.            
  538.         }
  539.  
  540.         if (inventoryContainsOneOf(Defenders)) {
  541.             defendGained = getInventoryCount(pickD);
  542.         }
  543.  
  544.         if (getGroundItemByID(pickD) != null && (isInventoryFull())) {
  545.             atInventoryItem(foodID, "Eat");
  546.             wait(random(600, 800));
  547.             pickUp();
  548.         }
  549.  
  550.         if (getMyPlayer().getInteracting() == null  && getNearestFreeNPCByID(cyclops) != null) {
  551.             status = "Attacking...";
  552.             ATTACKNPC(getNearestFreeNPCByID(cyclops), "Attack");
  553.         }
  554.  
  555.         if (getInventoryCount(foodID) >= 1) {
  556.             int RealHP = skills.getRealSkillLevel(STAT_HITPOINTS) * 10;
  557.             if (getCurrentLifepoint() <= random(RealHP / 2, RealHP / 1.5)) {
  558.                 status = "Eating Food...";
  559.                 atInventoryItem(foodID, "Eat");
  560.                 wait(random(1500, 2000));
  561.             }
  562.         }
  563.        
  564.         if (getMyPlayer().getInteracting() == null && getNearestFreeNPCByID(animatorID) != null) {
  565.             status = "Attacking...";
  566.             atNPC(getNearestFreeNPCByID(animatorID), "Attack");
  567.         }
  568.  
  569.         if (inSquare(2861, 3545, 2848, 3533) && (inventoryContains(foodID) && (inventoryContains(bronzeArmour)))) {
  570.                 setCompass('e');
  571.                 status = "On Animator...";
  572.                 atInventoryItem(bronze, "Use");
  573.                 wait(random(600,800));
  574.                 if (isItemSelected()) {
  575.                 atObject(Animator, "Use");
  576.                 wait(random(5000,6000));
  577.                 }else{
  578.                     moveMouse(random(650, 660), random(180, 190));
  579.                     clickMouse(true);
  580.                 }
  581.         }
  582.         if (inSquare(2861, 3545, 2848, 3533) && (inventoryContains(foodID) && (inventoryContains(ironArmour)))) {
  583.                 setCompass('e');
  584.                 status = "On Animator...";
  585.                 atInventoryItem(iron, "Use");
  586.                 wait(random(600,800));
  587.                 if (isItemSelected()) {
  588.                     atObject(Animator, "Use");
  589.                     wait(random(5000,6000));
  590.                     }else{
  591.                         moveMouse(random(650, 660), random(180, 190));
  592.                         clickMouse(true);
  593.                     }
  594.             }
  595.         if (inSquare(2861, 3545, 2848, 3533) && (inventoryContains(foodID) && (inventoryContains(steelArmour)))) {
  596.                 setCompass('e');
  597.                 status = "On Animator...";
  598.                 atInventoryItem(steel, "Use");
  599.                 wait(random(600,800));
  600.                 if (isItemSelected()) {
  601.                     atObject(Animator, "Use");
  602.                     wait(random(5000,6000));
  603.                     }else{
  604.                         moveMouse(random(650, 660), random(180, 190));
  605.                         clickMouse(true);
  606.                     }
  607.             }
  608.         if (inSquare(2861, 3545, 2848, 3533) && (inventoryContains(foodID) && (inventoryContains(blackArmour)))) {
  609.                 setCompass('e');
  610.                 status = "On Animator...";
  611.                 atInventoryItem(black, "Use");
  612.                 wait(random(600,800));
  613.                 if (isItemSelected()) {
  614.                     atObject(Animator, "Use");
  615.                     wait(random(5000,6000));
  616.                     }else{
  617.                         moveMouse(random(650, 660), random(180, 190));
  618.                         clickMouse(true);
  619.                     }
  620.             }
  621.         if (inSquare(2861, 3545, 2848, 3533) && (inventoryContains(foodID) && (inventoryContains(mithrilArmour)))) {
  622.                 setCompass('e');
  623.                 status = "On Animator...";
  624.                 atInventoryItem(mithril, "Use");
  625.                 wait(random(600,800));
  626.                 if (isItemSelected()) {
  627.                     atObject(Animator, "Use");
  628.                     wait(random(5000,6000));
  629.                     }else{
  630.                         moveMouse(random(650, 660), random(180, 190));
  631.                         clickMouse(true);
  632.                     }
  633.             }
  634.         if (inSquare(2861, 3545, 2848, 3533) && (inventoryContains(foodID) && (inventoryContains(adamantArmour)))) {
  635.                 setCompass('e');
  636.                 status = "On Animator...";
  637.                 atInventoryItem(adamant, "Use");
  638.                 wait(random(600,800));
  639.                 if (isItemSelected()) {
  640.                     atObject(Animator, "Use");
  641.                     wait(random(5000,6000));
  642.                     }else{
  643.                         moveMouse(random(650, 660), random(180, 190));
  644.                         clickMouse(true);
  645.                     }
  646.             }
  647.         if (inSquare(2861, 3545, 2848, 3533) && (inventoryContains(foodID) && (inventoryContains(runeArmour)))) {
  648.                 setCompass('e');
  649.                 status = "On Animator...";
  650.                 atInventoryItem(rune, "Use");
  651.                 wait(random(600,800));
  652.                 if (isItemSelected()) {
  653.                     atObject(Animator, "Use");
  654.                     wait(random(5000,6000));
  655.                     }else{
  656.                         moveMouse(random(650, 660), random(180, 190));
  657.                         clickMouse(true);
  658.                     }
  659.             }
  660.        
  661.         if (inSquare(2861, 3545, 2848, 3533) && (!inventoryContains(foodID) && (inventoryContainsOneOf(runeArmour)))){
  662.             setCompass('n');
  663.             status = "To Door...";
  664.             walkTileMM(doorspot);
  665.             wait(3000);
  666.         }
  667.  
  668.        
  669.         if (atDoor() && (!inventoryContains(foodID))){
  670.             RSObject door = getNearestObjectByID(33438);
  671.             status = "Opening Door...";
  672.             atObject(door, "Open");
  673.             wait(2500);
  674.             status = "To Bank...";
  675.             walkPath(PathToBank);
  676.             wait(4000);
  677.         }
  678.        
  679.         if(atBank() && (!inventoryContains(foodID))){
  680.             status = "Banking...";
  681.             final RSObject Banker = getNearestObjectByID(bankBooth);
  682.                 if(!(bank.isOpen())){
  683.                    if(Banker != null){
  684.                     atObject(Banker, "Use-quickly");
  685.                     wait(random(1200, 1600));
  686.                     }
  687.                     if(Banker == null){
  688.                         wait(random(100, 200));
  689.                         }
  690.                     }
  691.                
  692.                 status = "Banking...";
  693.                 if(bank.isOpen()){
  694.                     status = "Withdrawing...";
  695.                     bank.withdraw(foodID, 23);
  696.                     wait(1500);
  697.                            
  698.                     bank.close();
  699.                     }
  700.      
  701.     }
  702.            
  703.        
  704.         if(getInventoryCount(foodID) == 23 && (!atAnimator())){
  705.             status = "To Door...";
  706.             walkPath(PathToDoor);
  707.             wait(6000);
  708.         }
  709.            
  710.         if(atDoor() && (getInventoryCount(foodID) == 23)){
  711.             setCompass('n');
  712.             RSObject door = getNearestObjectByID(33438);
  713.             status = "Opening Door...";
  714.             atObject(door, "Open");
  715.             wait(3000);
  716.             status = "To Animator...";
  717.             walkTileMM(animatorspot);
  718.             wait(3000);
  719.         }
  720.    
  721.         if (isinlocation(2841, 3537, 2846, 3542)) {
  722.             logout();
  723.             stopScript();
  724.             log("Either no more tokens, or need to start in the area with the Cyclops.");
  725.         }
  726.         return random(300, 400);
  727.     }
  728.  
  729.     public void serverMessageRecieved(ServerMessageEvent e) {
  730.         String message = e.getMessage();
  731.  
  732.         if (message .contains("Your Time is up, please make your way to the exit")) {
  733.             if (tileOnScreen(topFloorInDoors.getLocation())) {
  734.                 atObject(topFloorInDoors, "Open");
  735.             } else {
  736.                 walkTo(topFloorInDoors.getLocation());
  737.                 if (waitToMove(250)) {
  738.                     while (getMyPlayer().isMoving()) {
  739.                         wait(random(20, 30));
  740.                     }
  741.                 }
  742.                 atObject(topFloorInDoors, "Open");
  743.             }
  744.         }
  745.     }
  746.  
  747. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement