Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 17.58 KB | None | 0 0
  1. import java.awt.BasicStroke;
  2. import java.awt.Color;
  3. import java.awt.Font;
  4. import java.awt.Graphics;
  5. import java.awt.Graphics2D;
  6. import java.awt.Point;
  7. import java.awt.event.MouseEvent;
  8. import java.awt.event.MouseMotionListener;
  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.methods.Skills;
  16. import org.rsbot.script.util.Filter;
  17. import org.rsbot.script.wrappers.RSArea;
  18. import org.rsbot.script.wrappers.RSItem;
  19. import org.rsbot.script.wrappers.RSNPC;
  20. import org.rsbot.script.wrappers.RSObject;
  21. import org.rsbot.script.wrappers.RSTile;
  22.  
  23. @ScriptManifest(authors = { "Ahmedbasil1" }, keywords = "Combat,Flesh,Crawlers,Strength,Pure", name = "Flesh Crawler Devourer", version = 0.311, description = ("Prepare typical inventory, and press start! Enjoy!"))
  24. public class FleshCrawler extends Script implements PaintListener,
  25.         ServerMessageListener, MouseMotionListener {
  26.  
  27.     public RSNPC allNPC[];
  28.     private int NumOfPots = 0;
  29.     private int PotionID = 0;
  30.     private int FoodID;
  31.     private boolean dist = false;
  32.     long startTime, ABTime, currentTime;
  33.     private RSArea FleshCrawlers = new RSArea(2036, 5185, 2046, 5193);
  34.     private RSArea FleshCrawlers2 = new RSArea(2036, 5185, 2046, 5194);
  35.     private RSArea Bank = new RSArea(3091, 3488, 3098, 3499);
  36.     private RSArea Door1 = new RSArea(2044, 5237, 2045, 5239);
  37.     private RSArea Door2 = new RSArea(2036, 5201, 2037, 5203);
  38.     private RSArea Door3 = new RSArea(2045, 5195, 2046, 5197);
  39.     private RSTile[] PathToBank = { new RSTile(3081, 3421),
  40.             new RSTile(3087, 3428), new RSTile(3092, 3436),
  41.             new RSTile(3091, 3445), new RSTile(3090, 3457),
  42.             new RSTile(3100, 3465), new RSTile(3100, 3472),
  43.             new RSTile(3100, 3481), new RSTile(3095, 3484),
  44.             new RSTile(3093, 3491) };
  45.  
  46.     // ------------------------------------------------------------------------------------------------------------\\
  47.     private RSItem GetEdibleFoods() {
  48.         RSItem[] EdibleFood = inventory.getItems();
  49.         for (RSItem i : EdibleFood) {
  50.             if (i.getComponent().getActions() == null
  51.                     || i.getComponent().getActions()[0] == null) {
  52.                 continue;
  53.             }
  54.             if (i.getComponent().getActions()[0].contains("Eat")) {
  55.                 return i;
  56.             }
  57.         }
  58.         return null;
  59.     }
  60.  
  61.     private RSItem GetPotion() {
  62.         RSItem[] EdibleFood = inventory.getItems();
  63.         for (RSItem i : EdibleFood) {
  64.             if (i.getComponent().getActions() == null
  65.                     || i.getComponent().getActions()[0] == null) {
  66.                 continue;
  67.             }
  68.             if (i.getComponent().getActions()[0].contains("Drink")) {
  69.                 return i;
  70.             }
  71.         }
  72.         return null;
  73.     }
  74.  
  75.     private void DrinkPotion() {
  76.         RSItem Potion = GetPotion();
  77.         if (Potion != null) {
  78.             Potion.doAction("Drink");
  79.             sleep(1000, 1200);
  80.         }
  81.     }
  82.  
  83.     private void EatFood() {
  84.         RSItem Food = GetEdibleFoods();
  85.         if (Food != null) {
  86.             Food.doAction("Eat");
  87.             sleep(1000, 1200);
  88.         }
  89.     }
  90.  
  91.     private void openDoor(int x, int y, boolean tf) {
  92.         RSTile doorTile = new RSTile(x, y);
  93.         RSObject tempObject = objects.getTopAt(doorTile);
  94.         if (tf == true) {
  95.             if (isIn(x, y + 1, 2, 6)) {
  96.                 if (tempObject != null) {
  97.                     if (tempObject.isOnScreen()) {
  98.                         if (tempObject.doAction("Open")) {
  99.                             WaitToMove();
  100.                         }
  101.                     }
  102.                 }
  103.             }
  104.         }
  105.         if (tf == false) {
  106.             if (tempObject != null) {
  107.                 if (tempObject.isOnScreen()) {
  108.                     if (tempObject.doAction("Open")) {
  109.                         WaitToMove();
  110.                     }
  111.                 }
  112.             }
  113.         }
  114.     }
  115.  
  116.     public void WaitToMove() {
  117.         RSTile me = getMyPlayer().getLocation();
  118.         int i;
  119.         i = 0;
  120.         do {
  121.             sleep(700, 750);
  122.             i++;
  123.             if (getMyPlayer().getLocation() != me) {
  124.                 i = 100;
  125.             }
  126.         } while (i <= 10);
  127.     }
  128.  
  129.     public void climbUp() {
  130.         RSTile me = getMyPlayer().getLocation();
  131.         RSObject object;
  132.         RSArea F1 = new RSArea(1905, 5217, 1915, 5227);
  133.         object = objects.getNearest(new Filter<RSObject>() {
  134.             public boolean accept(RSObject n) {
  135.                 if ((n.getID() == 16078 || n.getID() == 16080 || n.getID() == 16148)
  136.                         && calc.distanceTo(n) <= 4) {
  137.                     return true;
  138.                 }
  139.                 return false;
  140.             }
  141.         });
  142.         if (object != null && !F1.contains(me)) {
  143.             if (object.doAction("Climb-up")) {
  144.                 WaitToMove();
  145.             }
  146.         }
  147.     }
  148.  
  149.     public void climbDown() {
  150.         RSObject object;
  151.         object = objects.getNearest(new Filter<RSObject>() {
  152.             public boolean accept(RSObject n) {
  153.                 if ((n.getID() == 16154 || n.getID() == 16150 || n.getID() == 16149)
  154.                         && calc.distanceTo(n) <= 6) {
  155.                     return true;
  156.                 }
  157.                 return false;
  158.             }
  159.         });
  160.         if (object != null) {
  161.             if (object.getID() == 16150) {
  162.                 if (object.doAction("Enter")) {
  163.                     WaitToMove();
  164.                 }
  165.             }
  166.             if (object.getID() == 16149 || object.getID() == 16154) {
  167.                 if (object.doAction("Climb-down")) {
  168.                     WaitToMove();
  169.                 }
  170.             }
  171.         }
  172.     }
  173.  
  174.     public boolean isIn(int x1, int y1, int xc, int yc) {
  175.         xc--;
  176.         yc--;
  177.         RSArea zone = new RSArea(x1, y1, x1 + xc, y1 + yc);
  178.         RSTile me = getMyPlayer().getLocation();
  179.         if (zone.contains(me)) {
  180.             return true;
  181.         } else {
  182.             return false;
  183.         }
  184.     }
  185.  
  186.     public void checkDoors() {
  187.         RSTile me = getMyPlayer().getLocation();
  188.         openDoor(2044, 5239, true);
  189.         openDoor(2036, 5203, true);
  190.         openDoor(2045, 5197, true);
  191.         if (Door1.contains(me)) {
  192.             openDoor(2045, 5237, false);
  193.         }
  194.         if (Door2.contains(me)) {
  195.             openDoor(2036, 5201, false);
  196.         }
  197.         if (Door3.contains(me)) {
  198.             openDoor(2045, 5195, false);
  199.         }
  200.     }
  201.  
  202.     public boolean walkToFleshCrawlers() {
  203.         RSTile me = getMyPlayer().getLocation();
  204.         RSTile[] PathToCave = walking.reversePath(PathToBank);
  205.         RSTile MainF2Path[] = { new RSTile(2042, 5228), new RSTile(2044, 5219),
  206.                 new RSTile(2037, 5211), new RSTile(2037, 5204) };
  207.         RSArea MainZone = new RSArea(2030, 5205, 2047, 5236);
  208.         climbDown();
  209.         checkDoors();
  210.         if (isIn(2036, 5200, 2, 1)) {
  211.             walking.walkTileMM(new RSTile(2046, 5196));
  212.             WaitToMove();
  213.             return true;
  214.         }
  215.         if (isIn(2045, 5194, 2, 1)) {
  216.             walking.walkTileMM(new RSTile(2041, 5188));
  217.             WaitToMove();
  218.             return true;
  219.         }
  220.         if (isIn(2041, 5244, 3, 3)) {
  221.             if (walking.walkTileMM(new RSTile(2045, 5238))) {
  222.                 WaitToMove();
  223.                 return true;
  224.             }
  225.         }
  226.         if (isIn(1858, 5242, 3, 3)) {
  227.             if (walking.walkTileMM(new RSTile(1863, 5236))) {
  228.                 WaitToMove();
  229.                 return true;
  230.             }
  231.         }
  232.         if (me.getX() >= 1910 && me.getX() <= 1920 && me.getY() >= 5218
  233.                 && me.getX() <= 5230) {
  234.             if (walking.walkTileMM(new RSTile(1903, 5219))) {
  235.                 WaitToMove();
  236.                 return true;
  237.             }
  238.         }
  239.         if (MainZone.contains(me)
  240.                 && calc.distanceTo(MainF2Path[MainF2Path.length - 1]) >= 5) {
  241.             walking.walkPathMM(MainF2Path, 1, 1);
  242.             WaitToMove();
  243.             return true;
  244.         }
  245.         if (me.getX() > 3000
  246.                 && calc.distanceTo(PathToCave[PathToCave.length - 1]) >= 6) {
  247.             walking.walkPathMM(PathToCave, 1, 1);
  248.             WaitToMove();
  249.             return true;
  250.         }
  251.         return true;
  252.     }
  253.  
  254.     public boolean WalkToBank() {
  255.         RSTile me = getMyPlayer().getLocation();
  256.         climbUp();
  257.         if (FleshCrawlers2.contains(me) && me.getY() >= 5194) {
  258.             openDoor(2045, 5195, false);
  259.             return true;
  260.         }
  261.         if (FleshCrawlers2.contains(me) && me.getY() < 5194) {
  262.             walking.walkTileMM(new RSTile(2050, 5196));
  263.             WaitToMove();
  264.             return true;
  265.         }
  266.         if (Door3.contains(me)) {
  267.             openDoor(2046, 5197, false);
  268.             return true;
  269.         }
  270.         if (isIn(2045, 5198, 2, 3)) {
  271.             walking.walkTileMM(new RSTile(2041, 5208));
  272.             WaitToMove();
  273.             return true;
  274.         }
  275.  
  276.         if (me.getX() > 3000
  277.                 && calc.distanceTo(PathToBank[PathToBank.length - 1]) >= 3) {
  278.             walking.walkPathMM(PathToBank, 1, 1);
  279.             WaitToMove();
  280.             return true;
  281.         }
  282.         return true;
  283.     }
  284.  
  285.     enum State {
  286.         Banking, WalkingToFleshCrawlers, Waiting, NeedToEat, NeedToDrinkPotion, Attack, IDLE
  287.     }
  288.  
  289.     State getState() {
  290.         if (combat.getLifePoints() <= (6 * (skills
  291.                 .getRealLevel(Skills.CONSTITUTION)))) {
  292.             return State.NeedToEat;
  293.         }
  294.  
  295.         if (GetPotion() != null
  296.                 && FleshCrawlers.contains(getMyPlayer().getLocation())
  297.                 && skills.getCurrentLevel(Skills.STRENGTH) <= (skills
  298.                         .getRealLevel(Skills.STRENGTH) + 3)) {
  299.             return State.NeedToDrinkPotion;
  300.         }
  301.  
  302.         if (getMyPlayer().getAnimation() != -1 || getMyPlayer().isMoving()
  303.                 || getMyPlayer().getInteracting() != null) {
  304.             return State.Waiting;
  305.         }
  306.  
  307.         if (GetEdibleFoods() == null) {
  308.             return State.Banking;
  309.         }
  310.  
  311.         if (!FleshCrawlers.contains(getMyPlayer().getLocation())
  312.                 && GetEdibleFoods() != null) {
  313.             return State.WalkingToFleshCrawlers;
  314.         }
  315.  
  316.         if (FleshCrawlers.contains(getMyPlayer().getLocation())
  317.                 && GetEdibleFoods() != null
  318.                 && getMyPlayer().getInteracting() == null) {
  319.             return State.Attack;
  320.         }
  321.         return State.IDLE;
  322.     }
  323.  
  324.     public boolean onStart() {
  325.         sleep(1000, 2000);
  326.         env.disableRandom("Improved Rewards Box");
  327.         ABTime = System.currentTimeMillis();
  328.         startTime = System.currentTimeMillis();
  329.         E_startTime = skills.getCurrentExp(Skills.STRENGTH)
  330.                 + skills.getCurrentExp(Skills.ATTACK)
  331.                 + skills.getCurrentExp(Skills.DEFENSE)
  332.                 + skills.getCurrentExp(Skills.RANGE)
  333.                 + skills.getCurrentExp(Skills.CONSTITUTION);
  334.  
  335.         if (GetEdibleFoods() != null) {
  336.             FoodID = GetEdibleFoods().getID();
  337.         } else {
  338.             log("Start with food you want to use!");
  339.         }
  340.  
  341.         if (GetPotion() != null) {
  342.             PotionID = GetPotion().getID();
  343.             NumOfPots = inventory.getCount(PotionID);
  344.         } else {
  345.             log("Start with ammount of potions per inventory you want to use!");
  346.         }
  347.         loop();
  348.         return true;
  349.     }
  350.  
  351.     public RSNPC getNextNPC() {
  352.         RSNPC o = npcs.getNearest(new Filter<RSNPC>() {
  353.             public boolean accept(RSNPC n) {
  354.                 if (n.getName().equals("Flesh Crawler") && !n.isInCombat()) {
  355.                     return true;
  356.                 }
  357.                 return false;
  358.             }
  359.         });
  360.         if (o != null) {
  361.             return o;
  362.         } else {
  363.             return null;
  364.         }
  365.     }
  366.  
  367.     public void doAttack() { // will immprove upon this
  368.         RSNPC npc;
  369.         npc = getNextNPC();
  370.         mouse.move(npc.getScreenLocation());
  371.         if (menu.contains("Attack")) {
  372.             menu.doAction("Attack");
  373.             sleep(1300, 1500);
  374.             dist = false;
  375.         }
  376.         sleep(200, 300);
  377.     }
  378.  
  379.     public void processAttack() {
  380.         RSNPC npc = getNextNPC();
  381.         if (npc != null && !npc.isInCombat()) {
  382.             if (npc.isOnScreen()) {
  383.                 doAttack();
  384.             } else {
  385.                 walking.walkTileMM(npc.getLocation());
  386.                 sleep(700, 800);
  387.             }
  388.         }
  389.  
  390.     }
  391.  
  392.     public void Bank() {
  393.         if (Bank.contains(getMyPlayer().getLocation())) {
  394.             bank.open();
  395.             int z = 0;
  396.             do {
  397.                 z++;
  398.                 if (z >= 10) {
  399.                     bank.open();
  400.                     z = 0;
  401.                 }
  402.                 sleep(150, 200);
  403.             } while (!bank.isOpen());
  404.             if (bank.isOpen()) {
  405.                 sleep(1000, 2000);
  406.                 if (inventory.getCount() != 0) {
  407.                     bank.depositAll();
  408.                     int q = 0;
  409.                     do {
  410.                         sleep(350, 400);
  411.                         q++;
  412.                     } while (q <= 10 && inventory.getCount() != 0);
  413.                 }
  414.  
  415.                 if (NumOfPots != 0) {
  416.                     int e = 0;
  417.                     while (e <= NumOfPots) {
  418.                         bank.withdraw(PotionID, 1);
  419.                         e++;
  420.                         sleep(500, 1000);
  421.                     }
  422.                 }
  423.  
  424.                 if (!inventory.contains(FoodID) && bank.getCount(FoodID) >= 20) {
  425.                     bank.withdraw(FoodID, 0);
  426.                     int t = 0;
  427.                     do {
  428.                         sleep(150, 200);
  429.                         t++;
  430.                     } while (t <= 10 && !inventory.contains(FoodID));
  431.                 }
  432.                 bank.close();
  433.             }
  434.         } else {
  435.             WalkToBank();
  436.         }
  437.     }
  438.  
  439.     public void RoundlyChecks() {
  440.         mouse.setSpeed(random(4, 7));
  441.         if (camera.getPitch() < 70) {
  442.             camera.setPitch(random(80, 95));
  443.         }
  444.         if (walking.getEnergy() >= random(45, 65) && !walking.isRunEnabled()) {
  445.             Point p = new Point(random(715, 730), random(100, 115));
  446.             mouse.click(p, true);
  447.         }
  448.         if (inventory.contains(14664)) {
  449.             inventory.getItem(14664).doAction("Drop");
  450.         }
  451.     }
  452.  
  453.     public int loop() {
  454.         RoundlyChecks();
  455.         switch (getState()) {
  456.         case Banking:
  457.             Bank();
  458.             break;
  459.  
  460.         case WalkingToFleshCrawlers:
  461.             walkToFleshCrawlers();
  462.             break;
  463.  
  464.         case NeedToEat:
  465.             EatFood();
  466.             break;
  467.  
  468.         case NeedToDrinkPotion:
  469.             DrinkPotion();
  470.             break;
  471.  
  472.         case Attack:
  473.             processAttack();
  474.             break;
  475.  
  476.         case Waiting:
  477.             long i = System.currentTimeMillis();
  478.             if (i - ABTime > random(60000, 240000)
  479.                     && FleshCrawlers.contains(getMyPlayer().getLocation())) {
  480.                 Antiban();
  481.                 ABTime = System.currentTimeMillis();
  482.             } else {
  483.                 sleep(300, 400);
  484.             }
  485.             break;
  486.         }
  487.         return 10;
  488.     }
  489.  
  490.     @SuppressWarnings("static-access")
  491.     public void Antiban() {
  492.         int[] skillsIDIndex = { 6, 14, 5, 4, 20, 18, 13, 2, 23, 17, 8, 16, 0,
  493.                 3, 22, 7, 12, 1, 24, 19, 11, 10, 9, 15, 21, 2, 2, 2 };
  494.         int NOS = skillsIDIndex.length;
  495.         switch (random(1, 10)) {
  496.         case 1:
  497.             camera.moveRandomly(1800);
  498.             sleep(1000, 1200);
  499.             break;
  500.  
  501.         case 2:
  502.             mouse.moveRandomly(500, 800);
  503.             sleep(1000, 2000);
  504.             break;
  505.  
  506.         case 3:
  507.             mouse.moveOffScreen();
  508.             sleep(2000, 3000);
  509.             break;
  510.  
  511.         case 4:
  512.             camera.setPitch(random(20, 70));
  513.             break;
  514.  
  515.         case 5:
  516.             game.openTab(game.TAB_STATS);
  517.             sleep(random(0, 3000));
  518.             switch (random(1, 5)) {
  519.             case 1:
  520.                 skills.doHover(Skills.STRENGTH);
  521.                 break;
  522.             case 2:
  523.                 skills.doHover(Skills.ATTACK);
  524.                 break;
  525.             case 3:
  526.                 skills.doHover(Skills.DEFENSE);
  527.                 break;
  528.             case 4:
  529.                 skills.doHover(Skills.CONSTITUTION);
  530.                 break;
  531.             case 5:
  532.                 skills.doHover(skillsIDIndex[random(1, NOS)]);
  533.                 break;
  534.             }
  535.             sleep(1000, 2000);
  536.             break;
  537.         case 6:
  538.             camera.setAngle(camera.getAngle() + random(-100, 100));
  539.             sleep(400, 500);
  540.             break;
  541.         case 7:
  542.             camera.setAngle(camera.getAngle() + random(-100, 100));
  543.             sleep(400, 500);
  544.             break;
  545.  
  546.         case 8:
  547.             game.openTab(game.TAB_STATS);
  548.             sleep(random(0, 3000));
  549.             switch (random(1, 5)) {
  550.             case 1:
  551.                 skills.doHover(Skills.STRENGTH);
  552.                 break;
  553.             case 2:
  554.                 skills.doHover(Skills.ATTACK);
  555.                 break;
  556.             case 3:
  557.                 skills.doHover(Skills.DEFENSE);
  558.                 break;
  559.             case 4:
  560.                 skills.doHover(Skills.CONSTITUTION);
  561.                 break;
  562.             case 5:
  563.                 skills.doHover(skillsIDIndex[random(1, NOS)]);
  564.                 break;
  565.             }
  566.             sleep(1000, 2000);
  567.             break;
  568.         case 9:
  569.             camera.moveRandomly(1800);
  570.             sleep(1000, 1200);
  571.             break;
  572.  
  573.         case 10:
  574.             mouse.moveRandomly(1500, 1800);
  575.             sleep(1000, 2000);
  576.             break;
  577.         }
  578.     }
  579.  
  580.     public void onFinish() {
  581.     }
  582.  
  583.     public void serverMessageRecieved(ServerMessageEvent e) {
  584.         if (e.toString().contains("under attack")) {
  585.             sleep(1000, 1200);
  586.         }
  587.         if (e.toString().contains("else is fighting")) {
  588.             dist = true;
  589.             sleep(200, 300);
  590.             processAttack();
  591.         }
  592.     }
  593.  
  594.     public boolean isHover(int x1, int y1, int x2, int y2) {
  595.         if (p != null) {
  596.             if (p.getX() >= x1 && p.getY() >= y1 && p.getX() <= x2
  597.                     && p.getY() <= y2) {
  598.                 return true;
  599.             } else {
  600.                 return false;
  601.             }
  602.         } else {
  603.             return false;
  604.         }
  605.     }
  606.  
  607.     public void mouseMoved(MouseEvent e) {
  608.         p = e.getPoint();
  609.     }
  610.  
  611.     private String formatTime() {
  612.         long time = System.currentTimeMillis() - startTime;
  613.         final StringBuilder stringAppend = new StringBuilder();
  614.         final long TSec = time / 1000;
  615.         final long TMin = TSec / 60;
  616.         final long THour = TMin / 60;
  617.         final int s = (int) TSec % 60;
  618.         final int m = (int) TMin % 60;
  619.         final int h = (int) THour;
  620.         if (time <= 0) {
  621.             return "00:00:00";
  622.         }
  623.         if (h < 10) {
  624.             stringAppend.append("0");
  625.         }
  626.         stringAppend.append(h);
  627.         stringAppend.append(":");
  628.         if (m < 10) {
  629.             stringAppend.append("0");
  630.         }
  631.         stringAppend.append(m);
  632.         stringAppend.append(":");
  633.         if (s < 10) {
  634.             stringAppend.append("0");
  635.         }
  636.         stringAppend.append(s);
  637.         return stringAppend.toString();
  638.     }
  639.  
  640.     private final BasicStroke stroke2 = new BasicStroke(2);
  641.     private final Color color1 = new Color(204, 255, 255);
  642.     private final Color color2 = new Color(0, 0, 204);
  643.     private final Color color3 = new Color(153, 0, 0);
  644.     private final BasicStroke stroke1 = new BasicStroke(5);
  645.     private final Font font1 = new Font("Lucida Sans", 1, 12);
  646.     public Point p;
  647.     private double RoE = 0;
  648.     private double E = 0;
  649.     private long E_currentTime = 0;
  650.     private long E_startTime = 0;
  651.     private long timeRunning = 0;
  652.  
  653.     public void updateVariables() {
  654.         currentTime = System.currentTimeMillis();
  655.         timeRunning = currentTime - startTime;
  656.         E_currentTime = skills.getCurrentExp(Skills.STRENGTH)
  657.                 + skills.getCurrentExp(Skills.ATTACK)
  658.                 + skills.getCurrentExp(Skills.DEFENSE)
  659.                 + skills.getCurrentExp(Skills.RANGE)
  660.                 + skills.getCurrentExp(Skills.CONSTITUTION);
  661.         E = (E_currentTime - E_startTime);
  662.         RoE = E / (1000 * timeRunning / (1000 * 60 * 60));
  663.     }
  664.  
  665.     public void onRepaint(Graphics g1) {
  666.         Graphics2D g = (Graphics2D) g1;
  667.         Point l = mouse.getLocation();
  668.         g.setColor(color1);
  669.         g.setStroke(stroke2);
  670.         g.drawLine(l.x, 0, l.x, 600);
  671.         g.drawLine(800, l.y, 0, l.y);
  672.         if (isHover(550, 435, 730, 465)) {
  673.             updateVariables();
  674.             g.setColor(color1);
  675.             g.fillRoundRect(548, 434, 187, 27, 16, 16);
  676.             g.setColor(color2);
  677.             g.setStroke(stroke1);
  678.             g.drawRoundRect(548, 434, 187, 27, 16, 16);
  679.             g.setFont(font1);
  680.             g.setColor(color3);
  681.             g.drawString("Unhover to hide progress", 563, 453);
  682.             g.setColor(color1);
  683.             g.fillRoundRect(548, 340, 184, 88, 16, 16);
  684.             g.setColor(color2);
  685.             g.drawRoundRect(548, 340, 184, 88, 16, 16);
  686.             g.setColor(color3);
  687.             g.drawString("Experience/Hour: " + Math.round(RoE) + " K/PH", 557,
  688.                     420);
  689.             if (E < 1000) {
  690.                 g.drawString("Experience: " + Math.round(E), 557, 390);
  691.             } else {
  692.                 g.drawString("Experience: " + (Math.round(E) / 1000) + " K",
  693.                         557, 390);
  694.             }
  695.             g.drawString("Time: " + formatTime(), 557, 360);
  696.         } else {
  697.             g.setColor(color1);
  698.             g.setColor(color1);
  699.             g.fillRoundRect(548, 434, 187, 27, 16, 16);
  700.             g.setColor(color2);
  701.             g.setStroke(stroke1);
  702.             g.drawRoundRect(548, 434, 187, 27, 16, 16);
  703.             g.setFont(font1);
  704.             g.setColor(color3);
  705.             g.drawString("Hover to show progress", 565, 453);
  706.  
  707.         }
  708.     }
  709.  
  710.     public void mouseDragged(MouseEvent arg0) {
  711.     }
  712. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement