blahs44

Untitled

Oct 2nd, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 28.02 KB | None | 0 0
  1. package BFungus;
  2.  
  3. import java.awt.Color;
  4. import java.awt.Font;
  5. import java.awt.Graphics;
  6. import java.awt.Graphics2D;
  7. import java.util.ArrayList;
  8. import java.util.Iterator;
  9.  
  10. import org.osbot.script.MethodProvider;
  11. import org.osbot.script.Script;
  12. import org.osbot.script.ScriptManifest;
  13. import org.osbot.script.mouse.RectangleDestination;
  14. import org.osbot.script.rs2.map.Position;
  15. import org.osbot.script.rs2.model.Entity;
  16. import org.osbot.script.rs2.model.Player;
  17. import org.osbot.script.rs2.model.RS2Object;
  18. import org.osbot.script.rs2.skill.Skill;
  19. import org.osbot.script.rs2.ui.Tab;
  20. import org.osbot.script.rs2.utility.Area;
  21.  
  22. @ScriptManifest(name = "BFungus", info = "Collects fungus in mort myre swamp - v1.9.20", version = 1.9, author = "Zappa")
  23. public class BFungus extends Script {
  24.  
  25.         private State state;
  26.  
  27.         static Timer runTime = new Timer(0);
  28.  
  29.         private int[] praypots = { 139, 141, 143, 2434 };
  30.  
  31.         private int[][] Gate = { { 3506, 3480, 0 }, { 3496, 3481, 0 },
  32.                         { 3486, 3480, 0 }, { 3477, 3476, 0 }, { 3467, 3474, 0 },
  33.                         { 3456, 3473, 0 }, { 3449, 3467, 0 }, { 3444, 3462, 0 },
  34.                         { 3444, 3458, 0 } };
  35.         private int[][] Fungus = { { 3437, 3455, 0 }, { 3431, 3449, 0 },
  36.                         { 3426, 3443, 0 } };
  37.         private int[][] Gate_Back = { { 3426, 3443, 0 }, { 3431, 3449, 0 },
  38.                         { 3437, 3455, 0 } };
  39.         private int[][] Bank = { { 3449, 3467, 0 }, { 3456, 3473, 0 },
  40.                         { 3467, 3474, 0 }, { 3477, 3476, 0 }, { 3486, 3480, 0 },
  41.                         { 3496, 3481, 0 }, { 3506, 3480, 0 }, { 3512, 3480, 0 } };
  42.         private int[][] Altar = { { 3228, 3218, 0 }, { 3237, 3210, 0 } };
  43.         private int[][] AncientBank = { { 3494, 3478, 0 }, { 3502, 3481, 0 },
  44.                         { 3511, 3478, 0 } };
  45.  
  46.         private int runs;
  47.         private int fungiamount;
  48.         private int fungiID = 3509;
  49.  
  50.         private Area Gate_North = new Area(3453, 3472, 3439, 3458);
  51.         private Area Gate_South = new Area(3448, 3457, 3432, 3450);
  52.         private Area Fungi_Area = new Area(3428, 3445, 3417, 3434);
  53.         private Area Bank_Area = new Area(3507, 3484, 3515, 3473);
  54.         private Area lumbTeleArea = new Area(3219, 3212, 3225, 3226);
  55.         private Area AltarDoor = new Area(3235, 3212, 3237, 3208);
  56.         private Area Chapel = new Area(3240, 3205, 3247, 3215);
  57.         private Area barArea = new Area(3489, 3471, 3499, 3477);
  58.  
  59.         int pot3 = 0;
  60.  
  61.         int lumbPath = 0;
  62.  
  63.         private Position FUNGI = new Position(3421, 3439, 0);
  64.  
  65.         public void onStart() {
  66.  
  67.                 if (this.client.getInventory().contains(8008)
  68.                                 && (this.client.getInventory().contains(565) && this.client
  69.                                                 .getInventory().contains(563))) {
  70.  
  71.                         lumbPath = 1;
  72.  
  73.                 }
  74.  
  75.                 if (lumbPath == 0) {
  76.                         if (this.client.getInventory().contains(139)) {
  77.  
  78.                                 pot3 = 0;
  79.  
  80.                         } else if (this.client.getInventory().contains(2434)) {
  81.  
  82.                                 pot3 = 1;
  83.  
  84.                         } else if (!this.client.getInventory().contains(139)
  85.                                         && (!this.client.getInventory().contains(2434))) {
  86.  
  87.                                 try {
  88.                                         stop();
  89.                                 } catch (InterruptedException e) {
  90.                                         e.printStackTrace();
  91.                                 }
  92.  
  93.                         }
  94.                 }
  95.  
  96.                 this.state = State.Gate_Path;
  97.                 runTime = new Timer(0);
  98.         }
  99.  
  100.         public boolean WalkAlongPath(int[][] path, boolean AscendThroughPath,
  101.                         int distanceFromEnd) {
  102.                 if (distanceToPoint(AscendThroughPath ? path[path.length - 1][0]
  103.                                 : path[0][0], AscendThroughPath ? path[path.length - 1][1]
  104.                                 : path[0][1]) <= distanceFromEnd)
  105.                         return true;
  106.                 else {
  107.                         WalkAlongPath(path, AscendThroughPath);
  108.                         return false;
  109.                 }
  110.         }
  111.  
  112.         public void WalkAlongPath(int[][] path, boolean AscendThroughPath) {
  113.                 int destination = 0;
  114.                 for (int i = 0; i < path.length; i++)
  115.                         if (distanceToPoint(path[i][0], path[i][1]) < distanceToPoint(
  116.                                         path[destination][0], path[destination][1]))
  117.                                 destination = i;
  118.                 if (client.getMyPlayer().isMoving()
  119.                                 && distanceToPoint(path[destination][0], path[destination][1]) > (isRunning() ? 3
  120.                                                 : 2))
  121.                         return;
  122.                 if (AscendThroughPath && destination != path.length - 1
  123.                                 || !AscendThroughPath && destination != 0)
  124.                         destination += (AscendThroughPath ? 1 : -1);
  125.                 try {
  126.                         log("Walking to node:" + destination);
  127.                         walk(new Position(path[destination][0], path[destination][1], 0));
  128.                         Thread.sleep(700 + MethodProvider.random(600));
  129.                 } catch (InterruptedException e) {
  130.                         e.printStackTrace();
  131.                 }
  132.         }
  133.  
  134.         private int distanceToPoint(int pointX, int pointY) {
  135.                 return (int) Math.sqrt(Math
  136.                                 .pow(client.getMyPlayer().getX() - pointX, 2)
  137.                                 + Math.pow(client.getMyPlayer().getY() - pointY, 2));
  138.         }
  139.  
  140.         public void onMessage(String message) {
  141.                 if (message.contains("You skip gladly")) {
  142.                         this.state = State.Bank_Path;
  143.                         this.runs += 1;
  144.                 } else if (message.contains("You walk into the gloomy")) {
  145.                         this.state = State.TOFUNGUS;
  146.                 } else if (message.contains("You have finished")) {
  147.                         if (lumbPath == 0) {
  148.                                 this.state = State.DROP;
  149.                         }
  150.                 } else if (message.contains("You've run out")) {
  151.                         if (lumbPath == 0) {
  152.                                 this.state = State.PRAYPOT;
  153.                         }
  154.                 } else if (message.contains("You have no more space")) {
  155.                         if (lumbPath == 0) {
  156.                                 this.state = State.Gate_Path_Back;
  157.                         } else if (lumbPath == 1) {
  158.                                 this.state = State.TOLUMB;
  159.                         }
  160.                 } else if (message.contains("You need some prayer points")) {
  161.                         if (lumbPath == 0) {
  162.                                 this.state = State.Gate_Path_Back;
  163.                         } else if (lumbPath == 1) {
  164.                                 this.state = State.TOLUMB;
  165.                         }
  166.                 }
  167.                 if (message.contains("You pick a mushroom"))
  168.                         this.fungiamount += 1;
  169.         }
  170.  
  171.         public int onLoop() throws InterruptedException {
  172.  
  173.                 if ((this.client.getRunEnergy() > 40) && (this.state != State.OPERATE)
  174.                                 && (this.state != State.PICKUP))
  175.                         try {
  176.                                 setRunning(true);
  177.                         } catch (Exception localException) {
  178.                         }
  179.  
  180.                 if (this.state == State.BANK) {
  181.                         return bank();
  182.                 } else if (this.state == State.Gate_Path) {
  183.                         return Gate_Path();
  184.                 } else if (this.state == State.TOFUNGUS) {
  185.                         return toFungus();
  186.                 } else if (this.state == State.DROP) {
  187.                         return dropPot();
  188.                 } else if (this.state == State.PRAYPOT) {
  189.                         return drinkPot();
  190.                 } else if (this.state == State.PICKUP) {
  191.                         return pickup();
  192.                 } else if (this.state == State.OPERATE) {
  193.                         return operate();
  194.                 } else if (this.state == State.OPENGATE) {
  195.                         return openGate();
  196.                 } else if (this.state == State.Gate_Path_Back) {
  197.                         return Gate_Path_Back();
  198.                 } else if (this.state == State.Bank_Path) {
  199.                         return Bank_Path();
  200.                 } else if (this.state == State.TOLUMB) {
  201.                         return teleToLumb();
  202.                 } else if (this.state == State.TOPRAY) {
  203.                         return toPray();
  204.                 } else if (this.state == State.PRAY) {
  205.                         return pray();
  206.                 } else if (this.state == State.TELETOBANK) {
  207.                         return teleToBank();
  208.                 } else if (this.state == State.ANCIENTWALKTOBANK) {
  209.                         return ancientWalkToBank();
  210.                 } else if (this.state == State.OPENDOOR) {
  211.                         return openDoor();
  212.                 } else if (this.state == State.ENTERCHAPEL) {
  213.                         return enterChapel();
  214.                 }
  215.  
  216.                 return 250 + random(50);
  217.         }
  218.  
  219.         public int teleToLumb() throws InterruptedException {
  220.  
  221.                 if (currentTab() != Tab.INVENTORY) {
  222.                         openTab(Tab.INVENTORY);
  223.                         sleep(110 + random(40, 50));
  224.                 }
  225.  
  226.                 if (this.client.getInventory().contains(8008)) {
  227.                         selectInventoryOption(
  228.                                         this.client.getInventory().getSlotForId(8008), "Break");
  229.                         sleep(6000);
  230.                 }
  231.  
  232.                 if (this.client.getMyPlayer().isInArea(lumbTeleArea)) {
  233.                         this.state = State.TOPRAY;
  234.                 }
  235.  
  236.                 return 250;
  237.         }
  238.  
  239.         public int toPray() {
  240.  
  241.                 try {
  242.                         WalkAlongPath(Altar, true);
  243.                         Thread.sleep(3000L);
  244.                 } catch (Exception localException) {
  245.                 }
  246.  
  247.                 if (this.client.getMyPlayer().isInArea(AltarDoor)) {
  248.  
  249.                         this.state = State.OPENDOOR;
  250.                 }
  251.  
  252.                 return 250;
  253.         }
  254.  
  255.         public int openDoor() throws InterruptedException {
  256.  
  257.                 Entity door = closestObject(20131);
  258.  
  259.                 if (door != null) {
  260.                         log("Door found!");
  261.                         if (door.isVisible()) {
  262.                                 door.interact("Open");
  263.                                 sleep(random(700, 800));
  264.                         } else {
  265.                                 client.moveCameraToEntity(door);
  266.                         }
  267.                 } else {
  268.                         log("Door Not Found");
  269.                 }
  270.  
  271.                 this.state = State.ENTERCHAPEL;
  272.  
  273.                 return 250;
  274.         }
  275.  
  276.         public int enterChapel() throws InterruptedException {
  277.  
  278.                 walkExact(new Position(3243, 3210, 0));
  279.  
  280.                 if (this.client.getMyPlayer().isInArea(Chapel)) {
  281.  
  282.                         this.state = State.PRAY;
  283.  
  284.                 }
  285.  
  286.                 return 250;
  287.         }
  288.  
  289.         private int pray() throws InterruptedException {
  290.  
  291.                 Entity altar = closestObject(409);
  292.  
  293.                 if (altar != null) {
  294.                         log("Altar found!");
  295.                         if (altar.isVisible()) {
  296.                                 altar.interact("Pray-at");
  297.                                 sleep(random(1000, 1200));
  298.                         } else {
  299.                                 client.moveCameraToEntity(altar);
  300.                         }
  301.                 } else {
  302.                         log("Altar Not Found");
  303.                 }
  304.  
  305.                 this.state = State.TELETOBANK;
  306.  
  307.                 return 250;
  308.         }
  309.  
  310.         private int teleToBank() throws InterruptedException {
  311.  
  312.                 Player player = client.getMyPlayer();
  313.  
  314.                 if (!player.isAnimating()) {
  315.                         if (currentTab() != Tab.MAGIC) {
  316.                                 openTab(Tab.MAGIC);
  317.                                 sleep(110 + random(40, 50));
  318.                         }
  319.                         client.moveMouseTo(new RectangleDestination(621, 280, 10, 10),
  320.                                         false, true, false);
  321.                         sleep(6000);
  322.                 }
  323.  
  324.                 if (this.client.getMyPlayer().isInArea(barArea)) {
  325.  
  326.                         this.state = State.ANCIENTWALKTOBANK;
  327.  
  328.                 }
  329.  
  330.                 return 250;
  331.         }
  332.  
  333.         public int ancientWalkToBank() throws InterruptedException {
  334.  
  335.                 if (currentTab() != Tab.INVENTORY) {
  336.                         openTab(Tab.INVENTORY);
  337.                         sleep(110 + random(40, 50));
  338.                 }
  339.  
  340.                 try {
  341.                         WalkAlongPath(AncientBank, true);
  342.                         Thread.sleep(3000L);
  343.                 } catch (Exception localException) {
  344.                 }
  345.  
  346.                 if (this.client.getMyPlayer().isInArea(Bank_Area)) {
  347.  
  348.                         this.state = State.BANK;
  349.  
  350.                 }
  351.  
  352.                 return 250;
  353.         }
  354.  
  355.         public int dropPot() {
  356.  
  357.                 try {
  358.                         selectInventoryOption(this.client.getInventory().getSlotForId(229),
  359.                                         "Drop");
  360.                 } catch (Exception localException) {
  361.                 }
  362.  
  363.                 if (this.client.getMyPlayer().isInArea(this.Fungi_Area))
  364.                         this.state = State.OPERATE;
  365.                 else if ((this.client.getMyPlayer().isInArea(this.Gate_North))
  366.                                 || (this.client.getMyPlayer().isInArea(this.Gate_South)))
  367.                         this.state = State.OPENGATE;
  368.                 else {
  369.                         this.state = State.Gate_Path;
  370.                 }
  371.                 return 250;
  372.         }
  373.  
  374.         public int toFungus() {
  375.  
  376.                 try {
  377.                         WalkAlongPath(Fungus, true);
  378.                         walkMainScreen(this.FUNGI, false);
  379.                         Thread.sleep(3000L);
  380.                 } catch (Exception localException) {
  381.                 }
  382.  
  383.                 if (this.client.getMyPlayer().isInArea(this.Fungi_Area))
  384.                         this.state = State.OPERATE;
  385.                 return 250;
  386.         }
  387.  
  388.         public int drinkPot() {
  389.  
  390.                 try {
  391.                         if (currentTab() != Tab.INVENTORY) {
  392.                                 openTab(Tab.INVENTORY);
  393.                         }
  394.                         if (this.client.getInventory().contains(143))
  395.                                 selectInventoryOption(
  396.                                                 this.client.getInventory().getSlotForId(143), "Drink");
  397.                         else if (this.client.getInventory().contains(141))
  398.                                 selectInventoryOption(
  399.                                                 this.client.getInventory().getSlotForId(141), "Drink");
  400.                         else if (this.client.getInventory().contains(139))
  401.                                 selectInventoryOption(
  402.                                                 this.client.getInventory().getSlotForId(139), "Drink");
  403.                         else if (this.client.getInventory().contains(2434)) {
  404.                                 selectInventoryOption(
  405.                                                 this.client.getInventory().getSlotForId(2434), "Drink");
  406.                         }
  407.  
  408.                         Thread.sleep(1000L);
  409.                 } catch (Exception localException) {
  410.                 }
  411.  
  412.                 this.state = State.PICKUP;
  413.                 return 250;
  414.         }
  415.  
  416.         public int bank() {
  417.                 try {
  418.                         if (!this.client.getBank().isOpen()) {
  419.                                 try {
  420.                                         selectEntityOption(
  421.                                                         closestObjectForName(new String[] { "Bank booth" }),
  422.                                                         true, "Bank");
  423.                                 } catch (InterruptedException e) {
  424.                                         e.printStackTrace();
  425.                                 }
  426.                         } else {
  427.                                 try {
  428.                                         if (lumbPath == 0) {
  429.                                                 this.client.getBank().depositAllExcept(this.praypots);
  430.                                                 if (pot3 != 0) {
  431.                                                         if (client.getBank().isOpen()
  432.                                                                         && !client.getBank().contains(2434)) {
  433.                                                                 client.getBank().close();
  434.                                                                 stop();
  435.                                                         }
  436.                                                 } else {
  437.                                                         if (client.getBank().isOpen()
  438.                                                                         && !client.getBank().contains(139)) {
  439.                                                                 client.getBank().close();
  440.                                                                 stop();
  441.                                                         }
  442.                                                 }
  443.                                         } else {
  444.                                                 this.client.getBank().depositAllExcept(
  445.                                                                 new int[] { 8008, 565, 563 });
  446.                                         }
  447.                                         if (lumbPath == 0) {
  448.                                                 if (pot3 != 0) {
  449.                                                         if ((!this.client.getInventory().contains(2434))
  450.                                                                         && (!this.client.getInventory().contains(
  451.                                                                                         141))) {
  452.                                                                 this.client.getBank().withdraw1(2434);
  453.                                                         } else {
  454.                                                                 if ((!this.client.getInventory().contains(139))
  455.                                                                                 && (!this.client.getInventory()
  456.                                                                                                 .contains(141))) {
  457.                                                                         this.client.getBank().withdraw1(139);
  458.                                                                 }
  459.                                                         }
  460.                                                 }
  461.                                         }
  462.                                         if (this.client.getSkills()
  463.                                                         .getCurrentLevel(Skill.HITPOINTS) <= 32)
  464.                                                 this.client.getBank().withdraw1(379);
  465.                                 } catch (InterruptedException e) {
  466.                                         e.printStackTrace();
  467.                                 }
  468.                                 if (lumbPath == 0) {
  469.                                         if ((this.client.getInventory().contains(139))
  470.                                                         || (this.client.getInventory().contains(141))
  471.                                                         || (this.client.getInventory().contains(2434))) {
  472.                                                 this.client.getBank().close();
  473.                                                 this.state = State.Gate_Path;
  474.                                         }
  475.                                 } else {
  476.                                         this.client.getBank().close();
  477.                                         this.state = State.Gate_Path;
  478.                                 }
  479.                         }
  480.                 } catch (InterruptedException localInterruptedException1) {
  481.                 }
  482.                 return 1000;
  483.         }
  484.  
  485.         public int Gate_Path_Back() {
  486.  
  487.                 try {
  488.                         WalkAlongPath(Gate_Back, true);
  489.                 } catch (Exception localException) {
  490.                 }
  491.  
  492.                 if (this.client.getMyPlayer().isInArea(this.Gate_South))
  493.                         this.state = State.OPENGATE;
  494.                 return 250;
  495.         }
  496.  
  497.         public int operate() {
  498.  
  499.                 try {
  500.                         if (this.client.getSkills().getCurrentLevel(Skill.PRAYER) <= 1) {
  501.                                 if (lumbPath != 0) {
  502.                                         this.state = State.TOLUMB;
  503.                                 } else if (lumbPath == 0) {
  504.                                         this.state = State.Gate_Path_Back;
  505.                                         return 250;
  506.                                 }
  507.                         }
  508.                         if (this.client.getMyPlayer().getPosition() != this.FUNGI) {
  509.                                 walkMainScreen(this.FUNGI, false);
  510.                                 Thread.sleep(100L);
  511.                         }
  512.                         if (currentTab() != Tab.EQUIPMENT) {
  513.                                 openTab(Tab.EQUIPMENT);
  514.                         }
  515.                         this.client.getInterface(387).getChild(16).interact("Operate");
  516.                         Thread.sleep(2000L);
  517.                 } catch (Exception localException) {
  518.                 }
  519.  
  520.                 this.state = State.PICKUP;
  521.                 return 250;
  522.         }
  523.  
  524.         public int pickup() throws InterruptedException {
  525.  
  526.                 for (RS2Object obj : this.client.getCurrentRegion().getObjects())
  527.                         if (obj.getId() == this.fungiID)
  528.                                 try {
  529.                                         obj.interact("Pick", "Fungi on log", false, 5, false, false);
  530.                                         sleep(random(1200, 1600));
  531.                                 } catch (Exception localException) {
  532.                                 }
  533.  
  534.                 this.state = State.OPERATE;
  535.                 return 250;
  536.         }
  537.  
  538.         public int Bank_Path() {
  539.  
  540.                 try {
  541.                         WalkAlongPath(Bank, true);
  542.                 } catch (Exception localException) {
  543.                 }
  544.                 if (this.client.getMyPlayer().isInArea(this.Bank_Area)) {
  545.                         this.state = State.BANK;
  546.                 }
  547.  
  548.                 return 250;
  549.         }
  550.  
  551.         public int openGate() {
  552.  
  553.                 for (RS2Object obj : this.client.getCurrentRegion().getObjects()) {
  554.                         if ((obj.getName() != null)
  555.                                         && (obj.getName().equalsIgnoreCase("gate")))
  556.                                 try {
  557.                                         obj.interact("Open");
  558.                                         sleep(random(600, 1200));
  559.                                 } catch (Exception localException) {
  560.                                 }
  561.                 }
  562.                 return 250;
  563.         }
  564.  
  565.         public int Gate_Path() {
  566.                 try {
  567.                         WalkAlongPath(Gate, true);
  568.                         if (lumbPath == 0) {
  569.                                 if (this.client.getSkills().getCurrentLevel(Skill.PRAYER) <= 2) {
  570.                                         if (this.client.getInventory().contains(143)) {
  571.                                                 selectInventoryOption(this.client.getInventory()
  572.                                                                 .getSlotForId(143), "Drink");
  573.                                         } else if (this.client.getInventory().contains(141)) {
  574.                                                 selectInventoryOption(this.client.getInventory()
  575.                                                                 .getSlotForId(141), "Drink");
  576.                                         } else if (this.client.getInventory().contains(139)) {
  577.                                                 selectInventoryOption(this.client.getInventory()
  578.                                                                 .getSlotForId(139), "Drink");
  579.                                         } else if (this.client.getInventory().contains(2434)) {
  580.                                                 selectInventoryOption(this.client.getInventory()
  581.                                                                 .getSlotForId(2434), "Drink");
  582.                                                 Thread.sleep(1000L);
  583.                                         }
  584.                                 }
  585.                         }
  586.                         if (this.client.getSkills().getCurrentLevel(Skill.HITPOINTS) <= 32) {
  587.                                 selectInventoryOption(
  588.                                                 this.client.getInventory().getSlotForId(379), "Eat");
  589.                                 Thread.sleep(1000L);
  590.                         }
  591.                 } catch (Exception localException) {
  592.                 }
  593.                 if (this.client.getMyPlayer().isInArea(this.Gate_North))
  594.                         this.state = State.OPENGATE;
  595.                 return 250;
  596.         }
  597.  
  598.         public void onPaint(Graphics g) {
  599.                 Graphics2D gr = (Graphics2D) g;
  600.  
  601.                 gr.setColor(Color.WHITE);
  602.                 gr.setFont(new Font("Arial", 0, 10));
  603.  
  604.                 g.drawString("BFungus", 25, 50);
  605.                 if (runTime != null) {
  606.                         g.drawString("Runtime: " + Timer.format(runTime.getElapsed()), 25,
  607.                                         65);
  608.                 }
  609.                 g.drawString("Fungi picked: " + this.fungiamount, 25, 80);
  610.                 g.drawString("Fungi/hour: " + getPerHour(fungiamount), 25, 95);
  611.                 g.drawString("Number of runs: " + this.runs, 25, 110);
  612.                 g.drawString("Runs/hour: " + getPerHour(runs), 25, 125);
  613.                 g.drawString("Money Made: " + this.fungiamount * 700, 25, 140);
  614.                 g.drawString("Money Made/hour: " + getPerHour(fungiamount) * 700, 25,
  615.                                 155);
  616.                 gr.drawString("Lumb Path: " + " (" + lumbPath + ")", 25, 170);
  617.                 gr.drawString("Pray Pot: " + " (" + pot3 + ")", 25, 185);
  618.                 gr.drawString("State: " + this.state, 25, 200);
  619.                 g.drawString("By Zappa", 443, 465);
  620.         }
  621.  
  622.         public static int getPerHour(int value) {
  623.                 if (runTime != null && runTime.getElapsed() > 0) {
  624.                         return (int) (value * 3600000d / runTime.getElapsed());
  625.  
  626.                 } else {
  627.                         return 0;
  628.                 }
  629.         }
  630.  
  631.         public static long getPerHour(long value) {
  632.                 if (runTime != null && runTime.getElapsed() > 0) {
  633.                         return (long) (value * 3600000d / runTime.getElapsed());
  634.  
  635.                 } else {
  636.                         return 0;
  637.                 }
  638.         }
  639.  
  640.         static enum State {
  641.                 BANK, Gate_Path, TOFUNGUS, OPERATE, PICKUP, Gate_Path_Back, Bank_Path, PRAYPOT, DROP, OPENGATE, TOLUMB, TOPRAY, PRAY, TELETOBANK, ANCIENTWALKTOBANK, OPENDOOR, ENTERCHAPEL;
  642.         }
  643. }
Advertisement
Add Comment
Please, Sign In to add comment