joedezzy1

GiantSpiders

Mar 4th, 2014
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 17.10 KB | None | 0 0
  1. package scripts.GiantSpiderFighter;
  2.  
  3. import java.awt.BasicStroke;
  4. import java.awt.Color;
  5. import java.awt.Font;
  6. import java.awt.Graphics;
  7. import java.awt.Graphics2D;
  8.  
  9. import org.tribot.api.General;
  10. import org.tribot.api.Timing;
  11. import org.tribot.api.input.Mouse;
  12. import org.tribot.api2007.Banking;
  13. import org.tribot.api2007.Camera;
  14. import org.tribot.api2007.Game;
  15. import org.tribot.api2007.GameTab;
  16. import org.tribot.api2007.GameTab.TABS;
  17. import org.tribot.api2007.Inventory;
  18. import org.tribot.api2007.NPCs;
  19. import org.tribot.api2007.Objects;
  20. import org.tribot.api2007.Skills;
  21. import org.tribot.api2007.Player;
  22. import org.tribot.api2007.Skills.SKILLS;
  23. import org.tribot.api2007.Walking;
  24. import org.tribot.api2007.WebWalking;
  25. import org.tribot.api2007.types.RSItem;
  26. import org.tribot.api2007.types.RSModel;
  27. import org.tribot.api2007.types.RSNPC;
  28. import org.tribot.api2007.types.RSObject;
  29. import org.tribot.api2007.types.RSTile;
  30. import org.tribot.script.Script;
  31. import org.tribot.script.ScriptManifest;
  32. import org.tribot.script.interfaces.Painting;
  33.  
  34. @ScriptManifest(authors = { "jdezzy" }, category = "Combat", name = "FlawLess Spiderkiller")
  35.  
  36. public class GiantSpiders extends Script implements Painting{
  37.    
  38.     //Values
  39.     public int xphour;
  40.     public int Entrance_ID = 11798;
  41.     public int bankTrips = 0;
  42.     public int startLevel;
  43.     public int startXP;
  44.     public long TimeRan;
  45.     public long start;
  46.     public long end;
  47.     public String FOOD = "Lobster";
  48.     //Values
  49.    
  50.    
  51.     //Tiles && Paths
  52.     public RSTile[] BarbVillage = {rt(3089, 3418), rt(3080, 3416), rt(3084, 3418), rt(3081, 3418), rt(3082, 3424), rt(3085, 3424), rt(3083, 3426), rt(3078, 3424), rt(3079, 3422)};
  53.     public RSTile[] Spiders = {rt(2132, 5263), rt(2130, 5267), rt(2128, 5269), rt(2126, 5269), rt(2124, 5269), rt(2125, 5272), rt(2123, 5272), rt(2121, 5274), rt(2120, 5273), rt(2125, 5274), rt(2127, 5273), rt(2129, 5273), rt(2129, 5270)};
  54.     public RSTile[] Floor2 = {rt(2042, 5245), rt(2042, 5244), rt(2042, 5243), rt(2041, 5243), rt(2041, 5241)};
  55.     public RSTile[] Floor3 = {rt(2123 , 5252), rt(2124, 5254), rt(2122, 5254), rt(5129, 5254) };
  56.     public RSTile[] PrizeRoom = {rt(1914, 5222), rt(1912, 5221) , rt(1909, 5222), rt(1907, 5224), rt(1904, 5221), rt(1902, 5220), rt(1902, 5224), rt(2021, 5223), rt(2021, 5220), rt(2019, 5220), rt(2022, 5218), rt(2020, 5220), rt(2024, 5217), rt(2027, 5217), rt(2026, 5215), rt(2025, 5215) };
  57.     public RSTile Stronghold[] = {rt(1859, 5243) ,rt(1862, 5242)};
  58.     public RSTile Varrock[] = {rt(3210, 3424), rt(3213, 3424), rt(3218, 3424)};
  59.     //Tiles && Paths
  60.    
  61.     public boolean botIsRunning = true;
  62.    
  63.    
  64.     @Override
  65.     public void run() {
  66.        
  67.         startLevel = Skills.getXP(SKILLS.STRENGTH);
  68.             startXP = Skills.getXP(SKILLS.STRENGTH);
  69.                 start = System.currentTimeMillis();
  70.                     //paint values
  71.    
  72.             if(botIsRunning)
  73.                 GetStartingAction();   
  74.     }
  75.    
  76.     private void GetStartingAction() {
  77.         //gets starting action than sends in a loop
  78.        
  79.         if(IsOnScreen(Varrock))
  80.                 GetToTheBank();
  81.        
  82.             else if(IsOnScreen(BarbVillage))
  83.                 { EnterStronghold();
  84.                     GetToFloor3();
  85.                         DoorHandeler();
  86.                             Fight(); }
  87.        
  88.                 else if(AtFloor("Three"))
  89.                     { DoorHandeler();
  90.                         Fight(); }
  91.            
  92.             else if(IsOnScreen(Spiders))
  93.         Fight();
  94.    
  95.     }
  96.  
  97.  
  98.     private void Fight() {
  99.        
  100.         while(IsOnScreen(Spiders))
  101.         {   CheckHealth();
  102.            
  103.                 CheckPots();           
  104.    
  105.                     Attack();
  106.                
  107.                         sleep(0, 2603); }
  108.     }
  109.  
  110.  
  111.     private void AntiBan() {
  112.         int x = General.random(0, 75);
  113.         int y = General.random(0, 150);
  114.        
  115.         if(x == 47 || x == 74 )
  116.             { GameTab.open(TABS.STATS);
  117.                     sleep(800, 1200);
  118.                         Mouse.move(General.random(561, 598), General.random(244, 257));
  119.                             sleep(800, 3000);
  120.                                 GameTab.open(TABS.INVENTORY); }
  121.        
  122.         if(y == 34 || y == 86 || y == 22)
  123.             Camera.setCameraRotation(General.random(22, 300));     
  124.     }
  125.  
  126.  
  127.     private void CheckPots() {
  128.        
  129.         DrinkStr();
  130.                
  131.         DrinkAtk();
  132.        
  133.         DrinkDef();
  134.     }
  135.    
  136.     private void DrinkDef() {
  137.        
  138.         if(Skills.getCurrentLevel(SKILLS.DEFENCE) == (Skills.getActualLevel(SKILLS.DEFENCE)))  
  139.            
  140.             for(int z = 4; z <= 1 ; z--)
  141.                
  142.                 if(Inventory.find("Super attack("+ z +")").length > 0)
  143.                         { Inventory.find("Super attack("+ z +")")[0].click();
  144.                             sleep(2000, 4000); }
  145.     }
  146.  
  147.     private void DrinkAtk() {
  148.        
  149.         if(Skills.getCurrentLevel(SKILLS.ATTACK) == (Skills.getActualLevel(SKILLS.ATTACK)))
  150.            
  151.             for(int y = 4; y <= 1 ; y--)
  152.                
  153.                 if(Inventory.find("Super attack("+ y +")").length > 0)
  154.                     { Inventory.find("Super attack("+ y +")")[0].click();
  155.                         sleep(2000, 4000); }
  156.     }
  157.  
  158.     private void DrinkStr() {
  159.        
  160.         if(Skills.getCurrentLevel(SKILLS.STRENGTH) == (Skills.getActualLevel(SKILLS.STRENGTH)))
  161.            
  162.             for(int x = 4; x <= 1 ; x--)
  163.                
  164.                 if(Inventory.find("Super strength("+ x +")").length > 0)
  165.                     { Inventory.find("Super strength("+ x +")")[0].click();
  166.                             sleep(2000, 4000); }
  167.     }
  168.  
  169.     private void CheckHealth() {
  170.        
  171.         OpenInventory();
  172.        
  173.         if(WeNeedFood())
  174.             EatFood();
  175.     }
  176.  
  177.     private void OpenInventory() {
  178.         if(!GameTab.getOpen().equals(GameTab.TABS.INVENTORY))
  179.             GameTab.open(TABS.INVENTORY);
  180.     }
  181.  
  182.     private void EatFood() {
  183.         RSItem[] Food = Inventory.find(FOOD);
  184.        
  185.         if(WeHaveFoodToEat())
  186.             { Food[0].click();
  187.                  sleep(2000,3000); }
  188.        
  189.             if (!WeHaveFoodToEat())
  190.                     { if(Player.getRSPlayer().getHealth() < 60 && Food.length > 0) //saves a food as a failsafe --> WeHaveAnExtra()
  191.                         Food[0].click();
  192.                    
  193.                                 GetToTheBank(); }  
  194.     }
  195.  
  196.     private boolean WeHaveFoodToEat() {
  197.         RSItem[] Food = Inventory.find(FOOD);
  198.        
  199.         if(Food.length >= 2 && Player.getRSPlayer().getHealth() < 40)
  200.             return true;
  201.        
  202.                 else if(Food.length <= 1)
  203.                     return false;
  204.        
  205.                         else
  206.                             return false;
  207.     }
  208.  
  209.     private boolean WeNeedFood() {
  210.        
  211.         if(Player.getRSPlayer().getHealth() < 40)
  212.             return true;
  213.        
  214.                 else return false;
  215.     }
  216.  
  217.     private void GetToTheBank() {
  218.         println("Leaving");
  219.        
  220.             if(!IsOnScreen(Varrock))
  221.                 TeleportOut();
  222.            
  223.                 if(IsOnScreen(Varrock))
  224.                     WalkToBank();
  225.                
  226.                      else
  227.                         GetToTheBank();
  228.     }
  229.    
  230.     private void WalkBack() {
  231.        
  232.         WalkToVillage();
  233.            
  234.             EnterStronghold();
  235.                        
  236.                 GetToFloor3();
  237.            
  238.                     DoorHandeler();
  239.            
  240.                         Fight();
  241.            
  242.     }  
  243.    
  244.     private void WalkToVillage() {
  245.        
  246.         if(!IsOnScreen(BarbVillage))
  247.             { WebWalking.walkTo(new RSTile(General.random(3155, 3161), General.random(3419, 3423)));
  248.                 sleep(0,600);
  249.                     WebWalking.walkTo(new RSTile(General.random(3128, 3133), General.random(3413, 3415)));
  250.                         sleep(0,1000);
  251.                             WebWalking.walkTo(new RSTile(General.random(3110, 3114), General.random(3419, 3421)));
  252.                                 sleep(0,400);
  253.                                     WebWalking.walkTo(new RSTile(General.random(3084, 3079), General.random(3422, 3425)));
  254.                                         sleep(3500,7000); }
  255.        
  256.         else WebWalking.walkTo(new RSTile(General.random(3084, 3079), General.random(3422, 3425))); //Last walk so it doesnt repeat path
  257.     }
  258.  
  259.     private void GetToFloor3() {
  260.             Floor1();
  261.                 Floor2();
  262.                     println("At floor 3");
  263.     }
  264.  
  265.     private void Floor2() {
  266.        
  267.         if(!IsOnScreen(Floor2))
  268.             while(!IsOnScreen(Floor2))
  269.                 sleep(300);
  270.  
  271.                     EnterPortals();
  272.                    
  273.                         Walking.walkTo(rt(2022, 5217)); //walks to ladder in prize room
  274.                                 sleep(1000, 5000);
  275.                            
  276.                                     ClimbLadders();
  277.     }
  278.  
  279.     private RSTile rt(int tileX, int tileY) {
  280.        
  281.       int TileX = tileX + r(2, 5);
  282.         int TileY = tileY + r(2, 5);
  283.        
  284.             RSTile randomTile = new RSTile(r(tileX, TileX), r(tileY, TileY));
  285.        
  286.                 return randomTile;
  287.     }
  288.  
  289.     private int r(int min, int max) {
  290.         int randomInt = General.random(min, max);
  291.             return randomInt;
  292.     }
  293.  
  294.     private void Floor1() {
  295.        
  296.         Walking.walkTo(rt(1862, 5239)); //walks next to portal
  297.             sleep(1000, 3000);
  298.                 EnterPortals();
  299.        
  300.         Walking.walkTo(rt(1903, 5221)); //walks next to ladder
  301.             sleep(2000, 5000);
  302.                 ClimbLadders();
  303.        
  304.     }
  305.  
  306.     private void EnterStronghold() {
  307.         WaitForEntrance();
  308.        
  309.             while(!IsOnScreen(Stronghold))
  310.                 { Enter();
  311.                     sleep(2000, 5000); }
  312.            
  313.     }
  314.        
  315.     private void Enter() {
  316.        
  317.         RSObject[] Entrance = Objects.findNearest(10, Entrance_ID);
  318.  
  319.         if(Entrance.length > 0)
  320.             if(Entrance[0].isOnScreen())
  321.                 { Entrance[0].hover();
  322.                
  323.                     if(Game.getUptext().contains("Climb"))
  324.                         Entrance[0].click("Climb-down");
  325.                                 else Enter();
  326.                            
  327.                                     sleep(1000, 4000); }
  328.        
  329.             else { Camera.turnToTile(Entrance[0].getPosition());
  330.                                                     Enter(); }
  331.        
  332.          else if(Entrance.length == 0) //failsafe
  333.              { WalkToVillage();
  334.                         Enter(); }
  335.        
  336.     }
  337.  
  338.     private void WaitForEntrance() {
  339.         RSObject[] Entrance = Objects.findNearest(10, Entrance_ID);
  340.            
  341.                 if(Entrance.length == 0)
  342.                     while(Entrance.length == 0)
  343.                         { sleep(1000, 3000);
  344.                                 WalkToVillage(); } 
  345.     }
  346.  
  347.     private void ClimbLadders() {
  348.         RSObject[] Ladder = Objects.find(15, "Ladder");
  349.        
  350.             if(Ladder.length > 0)
  351.                 if(!Ladder[0].isOnScreen())
  352.                     { Camera.setCameraRotation(General.random(200,314));
  353.                         ClimbLadders(); }
  354.            
  355.             else if(Ladder[0].isOnScreen())
  356.                     while(InPrizeRoom())
  357.                         { Ladder[0].click("Climb-down");
  358.                             sleep(2000, 4000); }
  359.                
  360.             else { EnterPortals();
  361.                       ClimbLadders(); }
  362.     }
  363.    
  364.     private boolean InPrizeRoom() {
  365.        
  366.         for(int x = 0; x <= PrizeRoom.length - 1; x++)
  367.             if(PrizeRoom[x].isOnScreen())
  368.                     return true;
  369.        
  370.         return false;
  371.     }
  372.  
  373.     private void EnterPortals() {
  374.             RSObject[] Portal = Objects.find(15, "Portal");
  375.            
  376.             if(Portal.length > 0)      
  377.                 if(!Portal[0].isOnScreen())
  378.                     { Camera.setCameraRotation(General.random(90, 200));
  379.                         sleep(3000,5000); EnterPortals(); }
  380.                
  381.                 else if(Portal[0].isOnScreen())
  382.                         while(Portal[0].isOnScreen())
  383.                             { Portal[0].click();
  384.                                 sleep(2000, 4000); }
  385.                
  386.                     // else GetStartingAction(); //got lost where i was lol        
  387.     }
  388.    
  389.     private boolean AtFloor(String Floor) {
  390.        
  391.         if(Floor.equals("Two"))
  392.             { if(IsOnScreen(Floor2))
  393.                     return true;
  394.                          else
  395.                             return false; }
  396.        
  397.         else if(Floor.equals("Three"))
  398.             { if(IsOnScreen(Floor3))
  399.                     return true;
  400.                         else
  401.                             return false; }
  402.        
  403.         else
  404.             return false;
  405.     }
  406.    
  407.     private void GetSupplies() {
  408.        
  409.         Banking.depositAllExcept(5680, 379, 2440, 8007, 2436);
  410.        
  411.             Withdraw("Super strength(4)", 1);
  412.                 Withdraw("Super atttack(4)", 1);
  413.                     Withdraw("Super defence(4)", 1);
  414.                         Withdraw(FOOD, 23);
  415.                    
  416.         CloseBank();
  417.            
  418.                 bankTrips++;
  419.            
  420.                         WalkBack();
  421.     }
  422.    
  423.     private void CloseBank() {
  424.        
  425.         Banking.close();
  426.             sleep(1000, 2000);
  427.        
  428.             if(Banking.isBankScreenOpen()){
  429.                 while(Banking.isBankScreenOpen())
  430.                     { Banking.close();
  431.                          sleep(1000, 2000); }
  432.             }  
  433.     }
  434.    
  435.     public boolean IsInBank(String Item){
  436.        
  437.         if(Banking.find(Item).length > 1)  
  438.             return true;
  439.                 else return false; 
  440.     }
  441.    
  442.     public void Withdraw(String Item, int Amount){
  443.        
  444.         Banking.withdraw(Amount, Item);
  445.             sleep(2000, 3500);
  446.        
  447.                 if(Banking.find(Item).length > Amount){
  448.                     if(Inventory.find(Item).length < Amount)
  449.                         while(Inventory.find(Item).length < Amount)
  450.                                 { Banking.withdraw(Amount, Item);
  451.                                                 sleep(2000, 3500); }
  452.                 } else
  453.                     if(Item.equals(FOOD))
  454.                                 KillScript();
  455.     }
  456.  
  457.     private void KillScript() {
  458.         System.out.println("Out of food");
  459.             botIsRunning = false;
  460.                 run();
  461.     }
  462.  
  463.     private boolean IsOnScreen(RSTile Place[]) {
  464.        
  465.         for(int x = 0; x <= Place.length - 1; x++)
  466.              if(Place[x].isOnScreen())
  467.                     return true;
  468.        
  469.         return false;  
  470.     }
  471.    
  472.     private void WalkToBank() {
  473.        
  474.         WebWalking.walkTo(new RSTile(General.random(3195, 3199), General.random(3427, 3430)));
  475.             sleep(300,600);
  476.                 WebWalking.walkTo(new RSTile(General.random(3181, 3183), General.random(3436, 3438)));
  477.                     sleep(0, 500);
  478.        
  479.         WaitForBooth();
  480.        
  481.             OpenBooth();
  482.        
  483.                 GetSupplies();
  484.        
  485.     }
  486.    
  487.     private void OpenBooth() {
  488.        
  489.         RSObject[] BankBooth = Objects.findNearest(15, "Bank booth");
  490.        
  491.             if(!BankBooth[0].isOnScreen())
  492.                 { Camera.turnToTile(BankBooth[0].getPosition());
  493.                     sleep(860, 2031);
  494.                         OpenBooth();  }
  495.            
  496.                 else if(BankBooth[0].isOnScreen())
  497.                     while(BankBooth[0].isOnScreen() && !Banking.isBankScreenOpen())
  498.                             {Banking.openBankBooth();
  499.                                       sleep(3000,6000);}   
  500.     }
  501.  
  502.     private void WaitForBooth() {
  503.        
  504.         RSObject[] BankBooth = Objects.findNearest(15, "Bank booth");
  505.                
  506.                 if(BankBooth.length <= 0){
  507.                     println("Waiting for booth");
  508.                             sleep(300, 1023);
  509.                                 WaitForBooth(); }
  510.                
  511.                     else {  sleep(4304,7305);
  512.                                 OpenBooth(); }
  513.     }
  514.  
  515.     private void TeleportOut() {
  516.        
  517.         OpenInventory();
  518.        
  519.             RSItem[] VTab = Inventory.find(8007);
  520.        
  521.                 if(VTab.length != 0)
  522.                     { VTab[0].click("Varrock teleport");
  523.                          sleep(6000, 10000); }
  524.     }
  525.    
  526.     private void DoorHandeler() {
  527.        
  528.         Walking.walkTo(new RSTile(General.random(2132, 2133), 5256));
  529.                
  530.             while(Player.isMoving())
  531.                 sleep(300, 1000);
  532.            
  533.                     Door1();
  534.                         Door2();
  535.        
  536.         if(IsOnScreen(Spiders))
  537.             { WebWalking.walkTo(new RSTile(General.random(2123, 2127), General.random(5270, 5274)));
  538.                     sleep(1000, 3000);
  539.                         Fight(); }
  540.     }
  541.    
  542.    
  543.     private void Door2() {
  544.        
  545.         RSObject[] Door = Objects.findNearest(2, "Oozing barrier");
  546.        
  547.        
  548.         if(InDoor())
  549.            
  550.             { while(!ReadyForDoor2())
  551.                 { WebWalking.walkTo(new RSTile(General.random(2132, 2133), 5259)); //Tile infront of door
  552.                         sleep(3000, 4000); }
  553.            
  554.                         if(Door.length > 0 && Door[0].isOnScreen()) //else DoorHandeler    
  555.                                 if(ReadyForDoor2())
  556.                                         while(ReadyForDoor2())
  557.                                             { ClickDoor();
  558.                                                 if(WeGotThrough())
  559.                                                             WalkUpAndFight(); }
  560.                
  561.             }
  562.            
  563.     }
  564.  
  565.     private void WalkUpAndFight() {
  566.         WebWalking.walkTo(rt(2128, 5269));
  567.             Fight();
  568.     }
  569.  
  570.     private boolean WeGotThrough() {
  571.        
  572.         if(!ReadyForDoor2())
  573.             { sleep(2000, 4000);
  574.                     if(!ReadyForDoor2())
  575.                         return true;
  576.                             else return false; }
  577.        
  578.         else return false;
  579.     }
  580.  
  581.     private void Door1() {
  582.         RSObject[] Door = Objects.findNearest(10, "Oozing barrier");
  583.                
  584.                 if(Door.length > 0 && Door[0].isOnScreen()) //else DoorHandeler
  585.                             if(InFrontOfDoor())
  586.                                 { while(InFrontOfDoor())
  587.                                         ClickDoor(); } else DoorHandeler();
  588.                  
  589.                 else
  590.                     DoorHandeler();
  591.     }
  592.  
  593.     private boolean ReadyForDoor2() {
  594.        
  595.         if(Player.getPosition().equals(new RSTile(2132, 5259)) || Player.getPosition().equals(new RSTile(2133, 5259)))
  596.                 return true;
  597.        
  598.         else return false;
  599.        
  600.     }
  601.  
  602.     private boolean InDoor() {
  603.        
  604.         if(Player.getRSPlayer().getPosition().equals(new RSTile(2133, 5257, 0))  ||
  605.                 Player.getRSPlayer().getPosition().equals(new RSTile(2132, 5257, 0)))
  606.         return true;
  607.        
  608.         else return false;
  609.     }
  610.  
  611.     private void ClickDoor() {
  612.         RSObject[] Door = Objects.findNearest(2, "Oozing barrier");
  613.    
  614.             Door[0].hover();
  615.            
  616.                 if(Game.getUptext().contains("Open"))
  617.                     Door[0].click();
  618.  
  619.         sleep(500, 600);
  620.     }
  621.  
  622.     private boolean InFrontOfDoor() {
  623.         RSTile Position = Player.getRSPlayer().getPosition();
  624.        
  625.         if(Position.equals(new RSTile(2133, 5256, 0)) ||
  626.                 Position.equals(new RSTile(2133, 5255, 0)))
  627.            
  628.         return true;
  629.        
  630.         else return false;
  631.     }
  632.  
  633.     private void Attack(){
  634.         RSNPC[] GiantSpider = NPCs.findNearest("Giant spider");
  635.        
  636.             if(GiantSpider.length == 0)
  637.                 sleep(300);
  638.        
  639.                     if(WeCanAttack(GiantSpider))
  640.                         Hover(GiantSpider);
  641.  
  642.                             AntiBan1();
  643.     }
  644.    
  645.     private void AntiBan1() {
  646.        
  647.         int x = General.random(0, 1000);
  648.             if(x == 23 || x == 465)
  649.                     AntiBan();
  650.     }
  651.    
  652.    
  653.     private void Hover(RSNPC[] GiantSpider) {
  654.        
  655.         RSModel GiantSpiderModel = GiantSpider[0].getModel();
  656.             Mouse.setSpeed(General.random(125, 150));
  657.                
  658.                     GiantSpiderModel.hover();
  659.                    
  660.                         if(WeCanClick(GiantSpider))
  661.                             { GiantSpiderModel.click();
  662.                                     sleep(4000, 5000); }
  663.     }
  664.  
  665.     private boolean WeCanClick(RSNPC[] GiantSpider) {      
  666.        
  667.         if(Game.getUptext().contains("Attack") && GiantSpider[0].isOnScreen() && !(GiantSpider[0].isInCombat()))
  668.             return true; else return false;
  669.        
  670.     }
  671.  
  672.     private boolean WeCanAttack(RSNPC[] GiantSpider) {
  673.        
  674.         if(GiantSpider.length > 0 && GiantSpider[0].isOnScreen() && !(Player.getRSPlayer().isInCombat()) && !(GiantSpider[0].isInCombat()))
  675.             return true;  else return false;
  676.        
  677.     }
  678.  
  679.  
  680.     private final Color color1 = new Color(0, 0, 0);
  681.     private final Color color2 = new Color(255, 255, 255);
  682.  
  683.     private final BasicStroke stroke1 = new BasicStroke(1);
  684.  
  685.     private final Font font1 = new Font("Arial", 0, 15);
  686.  
  687.     private static final long startTime = System.currentTimeMillis();
  688.    
  689.     @Override
  690.     public void onPaint(Graphics g1) {
  691.         Graphics2D g = (Graphics2D)g1;
  692.         g.setColor(color1);
  693.         g.fillRect(289, 221, 229, 117);
  694.         g.setStroke(stroke1);
  695.         g.drawRect(289, 221, 229, 117);
  696.         g.setFont(font1);
  697.         g.setColor(color2);
  698.        
  699.         long timeRan = System.currentTimeMillis() - startTime;
  700.         int gainedXP = Skills.getXP(SKILLS.STRENGTH) - startXP;
  701.         long xpPerHour = (long)(gainedXP * 3600000 / timeRan);
  702.         g.drawString("X/P per hour: " + xpPerHour, 305, 246);
  703.         g.drawString("Time ran: " + Timing.msToString(timeRan), 307, 271);
  704.         g.drawString("Bank trips: " +bankTrips, 306, 296);
  705.         g.drawString("Coded by JDezzy", 346, 329);
  706.     }
  707. }
Advertisement
Add Comment
Please, Sign In to add comment