Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 2nd, 2012  |  syntax: None  |  size: 63.85 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import java.awt.BasicStroke;
  2. import java.awt.Color;
  3. import java.awt.Graphics;
  4. import java.awt.Graphics2D;
  5. import java.awt.Point;
  6. import java.awt.Stroke;
  7. import java.awt.event.KeyEvent;
  8. import java.awt.geom.Line2D;
  9. import java.io.BufferedReader;
  10. import java.io.IOException;
  11. import java.io.InputStream;
  12. import java.io.InputStreamReader;
  13. import java.net.MalformedURLException;
  14. import java.net.URI;
  15. import java.net.URL;
  16. import java.net.URLConnection;
  17. import java.util.ArrayList;
  18. import java.util.Arrays;
  19. import java.util.Map;
  20.  
  21. import org.rsbot.bot.Bot;
  22. import org.rsbot.bot.input.Mouse;
  23. import org.rsbot.event.events.ServerMessageEvent;
  24. import org.rsbot.event.listeners.PaintListener;
  25. import org.rsbot.event.listeners.ServerMessageListener;
  26. import org.rsbot.script.Calculations;
  27. import org.rsbot.script.Constants;
  28. import org.rsbot.script.Script;
  29. import org.rsbot.script.ScriptManifest;
  30. import org.rsbot.script.wrappers.RSInterface;
  31. import org.rsbot.script.wrappers.RSInterfaceChild;
  32. import org.rsbot.script.wrappers.RSItemTile;
  33. import org.rsbot.script.wrappers.RSObject;
  34. import org.rsbot.script.wrappers.RSPlayer;
  35. import org.rsbot.script.wrappers.RSNPC;
  36. import org.rsbot.script.wrappers.RSTile;
  37. import org.rsbot.script.GEItemInfo;
  38.  
  39. @ScriptManifest(authors = { "Tmac" }, category = "Runecraft", name = "-
  40.  
  41. TmacNats-", version = 0.2)
  42. public class TmacNats extends Script implements ServerMessageListener,
  43.                 PaintListener {
  44.         public double updatedVersion;
  45.         public final double currentVersion = getClass().getAnnotation(
  46.                         ScriptManifest.class).version();
  47.  
  48.         private final AStarGC pathFinder = new AStarGC();
  49.  
  50.         public enum Action {
  51.                 BANK, GRAAHK, WALK, ENTER, CRAFT, RING, FILL, WITHDRAW_RING,
  52.  
  53. SUMMON
  54.         }
  55.  
  56.         int INTERFACE_BANK_INVENTORY = 92;     
  57.         RSTile ruinTile = new RSTile(2867, 3020);
  58.         RSTile teleportTile = new RSTile(2786, 3006);
  59.  
  60.         protected int getMouseSpeed() {
  61.                 return mouseSpeed;
  62.         }
  63.  
  64.         // GUI
  65.         private graahkcraftgui gui;
  66.         public boolean normalPath;
  67.  
  68.         public int sleepTime;
  69.         public int mouseSpeed;
  70.         public boolean startScript = false;
  71.         public boolean usePouches = false;
  72.         public boolean rest = true;
  73.  
  74.         public boolean checkspouch = false;
  75.         public boolean checkmpouch = false;
  76.         public boolean checklpouch = false;
  77.         public boolean checkgpouch = false;
  78.         // IDs
  79.         public final static int bankChestID = 4483;
  80.  
  81.         // goal point
  82.         Point dest;
  83.  
  84.         public final static int natID = 561;
  85.         public final static int pessID = 7936;
  86.         public final static int altarID = 2486;
  87.         public final static int ruinsID = 2460;
  88.         RSTile altarTile = new RSTile(2400, 4841);
  89.  
  90.         // pouches
  91.         public boolean emptiedPouches = false;
  92.         public boolean fillPouches = false;
  93.         public boolean filledPouches = false;
  94.  
  95.         public final static int smallpouch = 5509;
  96.         public final static int mediumpouch = 5510;
  97.         public final static int mediumpouchdecay = 5511;
  98.         public final static int largepouch = 5512;
  99.         public final static int largepouchdecay = 5513;
  100.         public final static int giantpouch = 5514;
  101.         public final static int giantpouchdecay = 5515;
  102.  
  103.         // equipment checks
  104.         public boolean ringDisappeared = false;
  105.         public boolean graahkDisappeared = false;
  106.         public boolean graahkAlreadySummoned;
  107.         // failsafe
  108.         public int failcount;
  109.  
  110.         // paint
  111.  
  112.         long scriptStartTime;
  113.         public int startXP;
  114.         public long startTime;
  115.         public int natPrice;
  116.         public int pessPrice;
  117.         public long time;
  118.         public int SHOWPAINT = 1;
  119.         public int naturerunecount;
  120.  
  121.         Thread Antiban = new antiban();
  122.  
  123.         public boolean onStart(Map<String, String> args) {
  124.                 try {
  125.                         URLConnection url = null;
  126.                         BufferedReader in = null;
  127.                         url = new URL(
  128.                                        
  129.  
  130. "http://tmacrsbot.webs.com/Scripts/graahkcraftv2VERSION.txt")
  131.                                         .openConnection();
  132.                         in = new BufferedReader(new InputStreamReader
  133.  
  134. ((InputStream) url
  135.                                         .getContent()));
  136.                         updatedVersion = Double.parseDouble(in.readLine());
  137.                 } catch (MalformedURLException e) {
  138.                         e.printStackTrace();
  139.                 } catch (IOException e) {
  140.                         e.printStackTrace();
  141.                 }
  142.                 if (!isLoggedIn()) {
  143.                         log("Please log in before starting.");
  144.                         return false;
  145.                 } else {
  146.                         startXP = skills.getCurrentSkillExp
  147.  
  148. (STAT_RUNECRAFTING);
  149.                         startTime = System.currentTimeMillis() - 1000;
  150.                         GEItemInfo natMarketPrice =
  151.  
  152. grandExchange.loadItemInfo(natID);
  153.                         GEItemInfo pessMarketPrice =
  154.  
  155. grandExchange.loadItemInfo(pessID);
  156.                         natPrice = natMarketPrice.getMarketPrice();
  157.                         pessPrice = pessMarketPrice.getMarketPrice();
  158.                         gui = new graahkcraftgui();
  159.                         gui.setVisible(true);
  160.                         while (!startScript) {
  161.                                 wait(10);
  162.                         }
  163.                         if (startScript)
  164.                                 return true;
  165.                 }
  166.                 return false;
  167.         }
  168.  
  169.         public int loop() {
  170.                 try {
  171.                         final Action action = getAction();
  172.                         log("Current action: " + getAction());
  173.                         if (action != null) {
  174.                                 switch (action) {
  175.                                 case BANK:
  176.                                         RSObject chest =
  177.  
  178. getNearestObjectByID(bankChestID);
  179.                                         RSTile chestTile = chest.getLocation
  180.  
  181. ();
  182.                                         if (tileOnScreen(chestTile)) {
  183.                                                 if (!
  184.  
  185. RSInterface.getInterface(INTERFACE_BANK).isValid()) {
  186.                                                         RSObject bankChest =
  187.  
  188. getNearestObjectByID(bankChestID);
  189.                                                         if (bankChest !=
  190.  
  191. null)
  192.                                                                 atObject
  193.  
  194. (bankChest, "Use");
  195.                                                         wait(sleepTime());
  196.                                                         while (getMyPlayer
  197.  
  198. ().isMoving()
  199.                                                                         ||
  200.  
  201. getMyPlayer().getAnimation() != -1) {
  202.                                                                 wait
  203.  
  204. (sleepTime());
  205.                                                                 Antiban.run
  206.  
  207. ();
  208.                                                         }
  209.                                                 } else {
  210.                                                         log("Depositing and
  211.  
  212. withdrawing");
  213.                 //Credits to Bloddyharry for banking method
  214.             if (bank.isOpen()) {
  215.                 bank.deposit(natID, 0);
  216.                 wait(random(800, 1000));
  217.                 if(!inventoryContains(pessID)) {
  218.                 bank.atItem(pessID, "Withdraw-All");
  219.                 wait(random(300, 400));
  220.                 if(inventoryContains(pessID));
  221.                 return(random(300,500));
  222.             }else{
  223.                 wait(random(300, 500));
  224.                 log("misclicked.. trying again :/");
  225.                 return(random(300, 500));
  226.                
  227.             }
  228.             }
  229.                                                         log("Ess count " +
  230.  
  231. getInventoryCount(pessID));
  232.                                                         if (usePouches && !
  233.  
  234. filledPouches
  235.                                                                         &&
  236.  
  237. getInventoryCount(pessID) >= 14) {
  238.                                                                 log("Fill
  239.  
  240. pouches.");
  241.                                                                 fillPouches =
  242.  
  243. true;
  244.                                                         }
  245.                                                         break;
  246.                                                 }
  247.                                         } else {
  248.                                                 walkTo(chestTile);
  249.                                                 while (getMyPlayer
  250.  
  251. ().isMoving()) {
  252.                                                         wait(sleepTime());
  253.                                                         Antiban.run();
  254.                                                 }
  255.                                                 break;
  256.                                         }
  257.                                 case WITHDRAW_RING:
  258.                                         RSObject chest2 =
  259.  
  260. getNearestObjectByID(bankChestID);
  261.                                         RSTile chestTile2 =
  262.  
  263. chest2.getLocation();
  264.                                         TOP: if (inventoryContains(2552)) {
  265.                                                 if (bank.isOpen())
  266.                                                         bank.close();
  267.                                                 leftClickInventoryItem(2552);
  268.                                                 ringDisappeared = false;
  269.                                                 break;
  270.                                         } else {
  271.                                                 if (bank.isOpen() &&
  272.  
  273. ringDisappeared) {
  274.                                                         log("Withdrawing a
  275.  
  276. new ring.");
  277.                                                        
  278.  
  279. bank.depositAllExcept(smallpouch, mediumpouch,
  280.                                                                        
  281.  
  282. mediumpouchdecay, largepouch,
  283.                                                                        
  284.  
  285. largepouchdecay, giantpouch,
  286.                                                                        
  287.  
  288. giantpouchdecay);
  289.                                                         withdraw(2552, "Ring
  290.  
  291. of duelling", false);
  292.                                                         wait(sleepTime());
  293.                                                         break TOP;
  294.                                                 } else {
  295.                                                         if (tileOnScreen
  296.  
  297. (chestTile2)) {
  298.                                                                 if (chest2 !=
  299.  
  300. null)
  301.                                                                        
  302.  
  303. atObject(chest2, "Use");
  304.                                                         } else
  305.                                                                 walkTo
  306.  
  307. (chestTile2);
  308.  
  309.                                                         break;
  310.                                                 }
  311.                                         }
  312.                                         break;
  313.                                 case SUMMON:
  314.                                         if (getNearestObjectByID(bankChestID)
  315.  
  316. == null) {
  317.                                                 break;
  318.                                         }
  319.                                         log("Inventory contains ? " +
  320.  
  321. inventoryContains(12810));
  322.                                         RSObject chest3 =
  323.  
  324. getNearestObjectByID(bankChestID);
  325.                                         RSTile chestTile3 =
  326.  
  327. chest3.getLocation();
  328.                                         TOP: if (inventoryContains(12810) ==
  329.  
  330. true) {
  331.                                                 log("inside");
  332.                                                 if (bank.isOpen())
  333.                                                         bank.close();
  334.                                                 if
  335.  
  336. (skills.getCurrentSkillLevel(STAT_SUMMONING) > 15) {
  337.                                                         log("no need to
  338.  
  339. recharge");
  340.                                                         if (distanceTo
  341.  
  342. (chestTile3) > 10) {
  343.                                                                 walkTo
  344.  
  345. (chestTile3);
  346.                                                         } else {
  347.                                                                
  348.  
  349. atInventoryItem(12810, "Summon");
  350.                                                                 if
  351.  
  352. (graahkAlreadySummoned) {
  353.                                                                         log
  354.  
  355. ("Waiting for current Graahk to disappear.");
  356.                                                                         wait
  357.  
  358. (60000);
  359.                                                                         break
  360.  
  361. TOP;
  362.                                                                 } else
  363.                                                                        
  364.  
  365. graahkDisappeared = false;
  366.                                                         }
  367.                                                 } else {
  368.                                                         log("recharing");
  369.                                                         RSObject obelisk =
  370.  
  371. getNearestObjectByID(29954);
  372.                                                         if (tileOnScreen
  373.  
  374. (obelisk.getLocation())) {
  375.                                                                 atObject
  376.  
  377. (obelisk, "Renew-points");
  378.                                                                 while
  379.  
  380. (getMyPlayer().getAnimation() != -1) {
  381.                                                                         wait
  382.  
  383. (sleepTime());
  384.                                                                        
  385.  
  386. Antiban.run();
  387.                                                                 }
  388.                                                                 break TOP;
  389.                                                         } else
  390.                                                                 walkTo
  391.  
  392. (obelisk.getLocation());
  393.                                                 }
  394.                                         } else {
  395.                                                 if (bank.isOpen()) {
  396.                                                        
  397.  
  398. bank.depositAllExcept(smallpouch, mediumpouch,
  399.                                                                        
  400.  
  401. mediumpouchdecay, largepouch,
  402.                                                                        
  403.  
  404. largepouchdecay, giantpouch,
  405.                                                                        
  406.  
  407. giantpouchdecay);
  408.                                                         withdraw(12810,
  409.  
  410. "Spirit Graahk Pouch", false);
  411.                                                         wait(sleepTime());
  412.                                                         break TOP;
  413.                                                 } else {
  414.                                                         if (tileOnScreen
  415.  
  416. (chestTile3)) {
  417.                                                                 if (chest3 !=
  418.  
  419. null)
  420.                                                                        
  421.  
  422. atObject(chest3, "Use");
  423.                                                         } else
  424.                                                                 walkTo
  425.  
  426. (chestTile3);
  427.  
  428.                                                         break TOP;
  429.                                                 }
  430.                                         }
  431.                                         break;
  432.                                 case FILL:
  433.                                         if (bank.isOpen()) {
  434.                                                 bank.close();
  435.                                         }
  436.                                         if (checkspouch)
  437.                                                 pouchFill(smallpouch);
  438.                                         if (checkmpouch) {
  439.                                                 if (inventoryContains
  440.  
  441. (mediumpouch))
  442.                                                         pouchFill
  443.  
  444. (mediumpouch);
  445.                                                 else
  446.                                                         pouchFill
  447.  
  448. (mediumpouchdecay);
  449.                                         }
  450.                                         if (checklpouch) {
  451.                                                 if (inventoryContains
  452.  
  453. (largepouch))
  454.                                                         pouchFill
  455.  
  456. (largepouch);
  457.                                                 else
  458.                                                         pouchFill
  459.  
  460. (largepouchdecay);
  461.                                         }
  462.                                         if (checkgpouch) {
  463.                                                 if (inventoryContains
  464.  
  465. (giantpouch))
  466.                                                         pouchFill
  467.  
  468. (giantpouch);
  469.                                                 else
  470.                                                         pouchFill
  471.  
  472. (giantpouchdecay);
  473.                                         }
  474.                                         filledPouches = true;
  475.                                         fillPouches = false;
  476.                                         break;
  477.                                 case GRAAHK:
  478.                                         if (bank.isOpen())
  479.                                                 bank.close();
  480.                                         RSNPC graahk = getNearestNPCByID
  481.  
  482. (7363);
  483.                                         setCameraAltitude(true);
  484.                                         walkTo(new RSTile(2443, 3096));
  485.                                         wait(random(500, 1000));
  486.                                         atNPC(graahk, "Interact");
  487.                                         wait(sleepTime());
  488.                                         while (getMyPlayer().isMoving()
  489.                                                         || getMyPlayer
  490.  
  491. ().getAnimation() != -1) {
  492.                                                 wait(sleepTime() + 400);
  493.                                                 Antiban.run();
  494.                                         }
  495.                                         wait(500);
  496.                                         if (RSInterface.getInterface
  497.  
  498. (228).isValid()) {
  499.                                                 clickMouse(random(140, 370),
  500.  
  501. random(424, 440), true);
  502.                                                 wait(sleepTime());
  503.                                                 while (getMyPlayer
  504.  
  505. ().isMoving()
  506.                                                                 ||
  507.  
  508. getMyPlayer().getAnimation() != -1) {
  509.                                                         wait(sleepTime());
  510.                                                         Antiban.run();
  511.                                                 }
  512.                                                 while (!tileOnMap
  513.  
  514. (teleportTile)) {
  515.                                                         int counter = 0;
  516.                                                         if (counter > 6000) {
  517.                                                                 break;
  518.                                                         }
  519.                                                         wait(1);
  520.                                                         counter++;
  521.                                                 }
  522.                                                 break;
  523.                                         } else {
  524.                                                 RSTile tile =
  525.  
  526. getRandomTileInArea(2455, 3094, 2440,
  527.                                                                 3082);
  528.                                                 Point p = tileToMinimap
  529.  
  530. (tile);
  531.                                                 clickMouse(p, false);
  532.                                                 Antiban.run();
  533.                                                 break;
  534.                                         }
  535.                                 case WALK:
  536.                                         if (getNearestObjectByID(ruinsID) ==
  537.  
  538. null) {
  539.                                                 if (normalPath) {
  540.                                                         if (getMyPlayer
  541.  
  542. ().getLocation().getX() < 2827) {
  543.                                                                 walkTo(new
  544.  
  545. RSTile(2830, 3010));
  546.                                                                 break;
  547.                                                         } else if
  548.  
  549. (getMyPlayer().getLocation().getX() < 2840
  550.                                                                         &&
  551.  
  552. getMyPlayer().getLocation().getX() >= 2827) {
  553.                                                                 walkTo(new
  554.  
  555. RSTile(2840, 3027));
  556.                                                                 break;
  557.                                                         } else if
  558.  
  559. (getMyPlayer().getLocation().getX() < 2854
  560.                                                                         &&
  561.  
  562. getMyPlayer().getLocation().getX() >= 2840) {
  563.                                                                 walkTo(new
  564.  
  565. RSTile(2860, 3028));
  566.                                                                 break;
  567.                                                         } else if
  568.  
  569. (getMyPlayer().getLocation().getX() >= 2854) {
  570.                                                                 walkTo
  571.  
  572. (ruinTile);
  573.                                                                 break;
  574.                                                         }
  575.                                                 } else
  576.                                                         walkTo(ruinTile);
  577.                                         }
  578.                                 case ENTER:
  579.                                         RSObject ruins =
  580.  
  581. getNearestObjectByID(ruinsID);
  582.                                         RSTile ruinsTile = ruins.getLocation
  583.  
  584. ();
  585.                                         if (tileOnScreen(ruinsTile)) {
  586.                                                 atObject(ruins, "Enter");
  587.                                                 wait(sleepTime());
  588.                                                 while (getMyPlayer
  589.  
  590. ().isMoving()
  591.                                                                 ||
  592.  
  593. getMyPlayer().getAnimation() != -1) {
  594.                                                         wait(sleepTime());
  595.                                                         Antiban.run();
  596.                                                 }
  597.                                                 break;
  598.                                         } else {
  599.                                                 if (normalPath) {
  600.                                                         if (getMyPlayer
  601.  
  602. ().getLocation().getX() < 2827) {
  603.                                                                 walkTo(new
  604.  
  605. RSTile(2830, 3010));
  606.                                                                 break;
  607.                                                         } else if
  608.  
  609. (getMyPlayer().getLocation().getX() < 2840
  610.                                                                         &&
  611.  
  612. getMyPlayer().getLocation().getX() >= 2827) {
  613.                                                                 walkTo(new
  614.  
  615. RSTile(2840, 3027));
  616.                                                                 break;
  617.                                                         } else if
  618.  
  619. (getMyPlayer().getLocation().getX() < 2854
  620.                                                                         &&
  621.  
  622. getMyPlayer().getLocation().getX() >= 2840) {
  623.                                                                 walkTo(new
  624.  
  625. RSTile(2860, 3028));
  626.                                                                 break;
  627.                                                         } else if
  628.  
  629. (getMyPlayer().getLocation().getX() >= 2854) {
  630.                                                                 walkTo
  631.  
  632. (ruinTile);
  633.                                                                 break;
  634.                                                         }
  635.                                                 } else
  636.                                                         walkTo(ruinsTile);
  637.                                         }
  638.                                 case CRAFT:
  639.                                         filledPouches = false;
  640.                                         RSObject altar =
  641.  
  642. getNearestObjectByID(altarID);
  643.                                         RSTile altarTile = altar.getLocation
  644.  
  645. ();
  646.                                         if (tileOnScreen(altarTile)) {
  647.                                                 while (inventoryContains
  648.  
  649. (pessID)
  650.                                                                 &&
  651.  
  652. getMyPlayer().getAnimation() != 791) {
  653.                                                         atObject(altar,
  654.  
  655. "Craft");
  656.                                                         wait(sleepTime() +
  657.  
  658. 1000);
  659.                                                 }
  660.                                                 while (getMyPlayer
  661.  
  662. ().isMoving()
  663.                                                                 ||
  664.  
  665. getMyPlayer().getAnimation() != -1) {
  666.                                                         wait(sleepTime());
  667.                                                         Antiban.run();
  668.                                                 }
  669.                                                 wait(sleepTime());
  670.                                                 while (getMyPlayer
  671.  
  672. ().isMoving()
  673.                                                                 ||
  674.  
  675. getMyPlayer().getAnimation() != -1) {
  676.                                                         wait(sleepTime());
  677.                                                         Antiban.run();
  678.                                                 }
  679.                                                 while (usePouches && !
  680.  
  681. emptiedPouches)
  682.                                                         emptyPouches();
  683.                                                 break;
  684.                                         } else {
  685.                                                 walkTo(altarTile);
  686.                                                 break;
  687.                                         }
  688.                                 case RING:
  689.                                         naturerunecount += getInventoryCount
  690.  
  691. (natID);
  692.                                         emptiedPouches = false;
  693.                                         openTab(TAB_EQUIPMENT);
  694.                                         clickMouse(random(683, 714), random
  695.  
  696. (369, 400), false);
  697.                                         atMenu("Castle Wars");
  698.                                         wait(sleepTime() + 1000);
  699.                                         while (getMyPlayer().getAnimation()
  700.  
  701. != -1) {
  702.                                                 wait(sleepTime());
  703.                                                 Antiban.run();
  704.                                         }
  705.                                         break;
  706.                                 }
  707.                         }
  708.                 } catch (Exception e) {
  709.                 }
  710.                 return random(80, 100);
  711.         }
  712.  
  713.         public void serverMessageRecieved(ServerMessageEvent e) {
  714.                 String message = e.getMessage();
  715.                 if (message.contains("Your ring of duelling crumbles to
  716.  
  717. dust.")) {
  718.                         ringDisappeared = true;
  719.                 } else if (message
  720.                                 .contains("<col=7f0000>You have 1 minute
  721.  
  722. before your familiar vanishes.")) {
  723.                         graahkDisappeared = true;
  724.                 } else if (message.contains("You already have a follower."))
  725.  
  726. {
  727.                         graahkAlreadySummoned = true;
  728.                 }
  729.         }
  730.  
  731.         public void onRepaint(Graphics g) {
  732.                 if (!bank.isOpen()) {
  733.                         Point p1 = null;
  734.                         if (getNearestNPCByID(7363) != null)
  735.                                 highlightTile(g, getNearestNPCByID
  736.  
  737. (7363).getLocation(),
  738.                                                 new Color(0, 255, 0, 80), new
  739.  
  740. Color(0, 0, 255, 20));
  741.                         highlightTile(g, getMyPlayer().getLocation(), new
  742.  
  743. Color(0, 255, 0,
  744.                                         80), new Color(0, 0, 255, 20));
  745.                         if (getNearestNPCByID(7363) != null)
  746.                                 p1 = Calculations.tileToScreen
  747.  
  748. (getNearestNPCByID(7363)
  749.                                                 .getLocation());
  750.                         Point p2 = Calculations.tileToScreen(getMyPlayer
  751.  
  752. ().getLocation());
  753.                         g.setColor(new Color(0, 0, 255, 50));
  754.                         if (getNearestNPCByID(7363) != null
  755.                                         && tileOnScreen(getNearestNPCByID
  756.  
  757. (7363).getLocation()))
  758.                                 g.drawLine(p1.x, p1.y, p2.x, p2.y);
  759.                 } else {
  760.                         final RSInterfaceChild natIF = bank.getItemByID
  761.  
  762. (natID);
  763.                         final RSInterfaceChild pessIF = bank.getItemByID
  764.  
  765. (pessID);
  766.                         g.setColor(Color.green);
  767.                         if (natIF != null && natIF.getAbsoluteY() < 270) {
  768.                                 g.drawRect(natIF.getAbsoluteX() - 1,
  769.  
  770. natIF.getAbsoluteY() - 1,
  771.                                                 natIF.getWidth() + 2,
  772.  
  773. natIF.getHeight() + 2);
  774.                         }
  775.                         g.setColor(Color.blue);
  776.                         if (pessIF != null && pessIF.getAbsoluteY() < 270) {
  777.                                 g.drawRect(pessIF.getAbsoluteX() - 1,
  778.                                                 pessIF.getAbsoluteY() - 1,
  779.  
  780. pessIF.getWidth() + 2,
  781.                                                 pessIF.getHeight() + 2);
  782.                         }
  783.                 }
  784.                 if (dest != null) {
  785.                         if (pointOnScreen(dest)) {
  786.                                 // add point to tile
  787.                         } else {
  788.                                 g.setColor(new Color(95, 1, 110, 180));
  789.                                 g.fillRect(dest.x - 3, dest.y - 3, 6, 6);
  790.                         }
  791.                 }
  792.  
  793.                 // main paint
  794.                 Mouse m = Bot.getClient().getMouse();
  795.                 g.setColor(new Color(0, 60, 0, 250));
  796.                 g.fillRect(340, 180, 176, 20);
  797.                 int XPgain = skills.getCurrentSkillExp(STAT_RUNECRAFTING) -
  798.  
  799. startXP;
  800.                 time = (System.currentTimeMillis() - startTime) / 1000;
  801.  
  802.                 // progress tab
  803.                 if (SHOWPAINT == 1) {
  804.                         g.setColor(new Color(0, 0, 0, 40));
  805.                 } else {
  806.                         g.setColor(new Color(0, 0, 0, 0));
  807.                 }
  808.                 g.fillRect(340, 180, 70, 20);
  809.                 if (SHOWPAINT == 1) {
  810.                         g.setColor(new Color(250, 250, 250, 200));
  811.                 } else {
  812.                         g.setColor(new Color(250, 250, 250, 100));
  813.                 }
  814.  
  815.                 g.drawString("Progress", 345, 193);
  816.  
  817.                 boolean hoverProgress = m.x >= 340 && m.x <= 400 && m.y >=
  818.  
  819. 180
  820.                                 && m.y < 200;
  821.                 if (hoverProgress) {
  822.                         SHOWPAINT = 1;
  823.                 }
  824.                 if (SHOWPAINT == 1) {
  825.                         g.setColor(new Color(250, 250, 250, 40));
  826.                         g.fillRect(340, 200, 176, 55);
  827.                         g.setColor(new Color(0, 60, 0, 150));
  828.                         g.fillRect(340, 200, 176, 110);
  829.                         g.setColor(new Color(250, 250, 250, 200));
  830.                         g
  831.                                         .drawString("-TmacNats- " +
  832.  
  833. currentVersion,
  834.                                                         350, 230);
  835.                         g.drawString("Ran for: " + time / 3600 + ":"
  836.                                         + ((time / 60 % 60 < 10) ? "0" : "")
  837.  
  838. + time / 60 % 60 + ":"
  839.                                         + ((time % 60 < 10) ? "0" : "") +
  840.  
  841. time % 60, 350, 245);
  842.                         g.drawString("Runes Crafted:" + naturerunecount, 350,
  843.  
  844. 260);
  845.                         g.drawString("XP Gained:" + XPgain, 350, 275);
  846.                         int xptolvl = skills.getXPToNextLevel
  847.  
  848. (STAT_RUNECRAFTING);
  849.                         int ptolvl = skills.getPercentToNextLevel
  850.  
  851. (STAT_RUNECRAFTING);
  852.                         g.drawString("XP to Lvl:" + xptolvl + " (" + ptolvl +
  853.  
  854. "%)", 350,
  855.                                         290);
  856.  
  857.                 }
  858.                 // calculations tab
  859.                 if (SHOWPAINT == 2) {
  860.  
  861.                         g.setColor(new Color(0, 0, 0, 40));
  862.                 } else {
  863.                         g.setColor(new Color(0, 0, 0, 0));
  864.                 }
  865.                 g.fillRect(410, 180, 106, 20);
  866.                 if (SHOWPAINT == 2) {
  867.                         g.setColor(new Color(250, 250, 250, 200));
  868.                 } else {
  869.                         g.setColor(new Color(250, 250, 250, 100));
  870.                 }
  871.                 g.drawString("Calculations", 415, 193);
  872.  
  873.                 boolean hoverCalculations = m.x >= 410 && m.x <= 516 && m.y
  874.  
  875. >= 180
  876.                                 && m.y < 200;
  877.                 if (hoverCalculations) {
  878.                         SHOWPAINT = 2;
  879.                 }
  880.                 if (SHOWPAINT == 2) {
  881.  
  882.                         long runTime = 0;
  883.                         long seconds = 0;
  884.                         long minutes = 0;
  885.                         long hours = time / 3600;
  886.                         runTime = (System.currentTimeMillis() -
  887.  
  888. scriptStartTime);
  889.                         seconds = runTime / 1000;
  890.                         if (seconds >= 60) {
  891.                                 minutes = seconds / 60;
  892.                                 seconds -= (minutes * 60);
  893.                         }
  894.                         if (minutes >= 60) {
  895.                                 hours = minutes / 60;
  896.                                 minutes -= (hours * 60);
  897.                         }
  898.  
  899.                         g.setColor(new Color(250, 250, 250, 40));
  900.                         g.fillRect(340, 200, 176, 55);
  901.                         g.setColor(new Color(0, 60, 0, 150));
  902.                         g.fillRect(340, 200, 176, 110);
  903.                         g.setColor(new Color(250, 250, 250, 200));
  904.                         g.drawString("Runes/Hour:" + (naturerunecount * 60 *
  905.  
  906. 60) / time,
  907.                                         350, 230);
  908.                         g.drawString("XP/Hour:" + (XPgain * 60 * 60) / time,
  909.  
  910. 350, 245);
  911.                         g.drawString("Nat price:" + natPrice, 350, 260);
  912.                         g.drawString("Pure Ess price:" + pessPrice, 350,
  913.  
  914. 275);
  915.                         int profit;
  916.                         if (skills.getCurrentSkillLevel(STAT_RUNECRAFTING) >=
  917.  
  918. 91)
  919.                                 profit = (natPrice * naturerunecount)
  920.                                                 - (pessPrice *
  921.  
  922. (naturerunecount / 2));
  923.                         else
  924.                                 profit = (natPrice - pessPrice) *
  925.  
  926. naturerunecount;
  927.                         g.drawString("Profit:" + profit, 350, 290);
  928.                         g.drawString("Profit/Hour:" + (profit * 60 * 60) /
  929.  
  930. time, 350, 305);
  931.  
  932.                 }
  933.                 // boxes
  934.                 g.setColor(new Color(0, 0, 0, 100));
  935.                 if (checkspouch) {
  936.                         g.fillRect(426, 206, 6, 6);
  937.                 } else {
  938.                         g.drawRect(426, 206, 6, 6);
  939.                 }
  940.                 if (checkmpouch) {
  941.                         g.fillRect(444, 205, 8, 8);
  942.                 } else {
  943.                         g.drawRect(444, 205, 8, 8);
  944.                 }
  945.                 if (checklpouch) {
  946.                         g.fillRect(464, 204, 10, 10);
  947.                 } else {
  948.                         g.drawRect(464, 204, 10, 10);
  949.                 }
  950.                 if (checkgpouch) {
  951.                         g.fillRect(488, 203, 12, 12);
  952.                 } else {
  953.                         g.drawRect(488, 203, 12, 12);
  954.                 }
  955.  
  956.                 // mouse
  957.                 Point p = getMouseLocation();
  958.                 long timeSince = Bot.getClient().getMouse
  959.  
  960. ().getMousePressTime();
  961.                 if (timeSince > System.currentTimeMillis() - 500)
  962.                         g.setColor(new Color(0, 140, 0, 150));
  963.  
  964.                 else
  965.                         g.setColor(new Color(0, 140, 0, 250));
  966.  
  967.                 g.drawOval((p.x - 3), (p.y - 3), 6, 6);
  968.                 g.fillOval((p.x - 3), (p.y - 3), 6, 6);
  969.                 g.drawOval(p.x - 6, p.y - 6, 12, 12);
  970.                 Stroke drawingStroke = new BasicStroke(1,
  971.  
  972. BasicStroke.CAP_SQUARE,
  973.                                 BasicStroke.JOIN_ROUND, 1, new float[] { 2 },
  974.  
  975. 1);
  976.                 Line2D line = new Line2D.Double(p.x, 0, p.x, 500);
  977.                 Graphics2D g2d = (Graphics2D) g;
  978.                 g2d.setStroke(drawingStroke);
  979.                 g2d.draw(line);
  980.                 Stroke drawingStroke1 = new BasicStroke(1,
  981.  
  982. BasicStroke.CAP_SQUARE,
  983.                                 BasicStroke.JOIN_ROUND, 1, new float[] { 2 },
  984.  
  985. 1);
  986.                 Line2D line1 = new Line2D.Double(0, p.y, 762, p.y);
  987.                 Graphics2D g2d1 = (Graphics2D) g;
  988.                 g2d1.setStroke(drawingStroke1);
  989.                 g2d1.draw(line1);
  990.         }
  991.  
  992.         // banking methods
  993.         private void withdraw(final int ID, final String name, final boolean
  994.  
  995. all) {
  996.                 if (failcount > 100) {
  997.                         log("Unable to withraw " + name
  998.                                         + ". You will be logged out in ten
  999.  
  1000. seconds.");
  1001.                         wait(random(9000, 11000));
  1002.                         while (bank.isOpen()) {
  1003.                                 closeBank();
  1004.                         }
  1005.                         stopAllScripts();
  1006.                 }
  1007.                 RSInterfaceChild bankItem = bank.getItemByID(ID);
  1008.                 if (bankItem == null) {
  1009.                         failcount++;
  1010.                         bankItem = bank.getItemByID(ID);
  1011.                 } else if (bankItem.getAbsoluteY() > 270) {
  1012.                         clickMouse(85, 308, 4, 5, true, 50);
  1013.                         wait(random(1200, 1500));
  1014.                         final int rand = random(0, Math.min(4, name.length()
  1015.  
  1016. - 2));
  1017.                         sendText(name.toLowerCase().substring(0, name.length
  1018.  
  1019. () - rand),
  1020.                                         false);
  1021.                         wait(random(900, 1200));
  1022.                         bankItem = bank.getItemByID(ID);
  1023.                         if (bankItem == null
  1024.                                         || bankItem.getAbsoluteY() > 270
  1025.                                         || !bank.atItem(ID, all ? "Withdraw-
  1026.  
  1027. All " + name
  1028.                                                         : "Withdraw-1 " +
  1029.  
  1030. name)
  1031.                                         && !bank.atItem(ID, all ? "Withdraw-
  1032.  
  1033. All " + name
  1034.                                                         : "Withdraw-1 " +
  1035.  
  1036. name)) {
  1037.                                 failcount++;
  1038.                                 withdraw(ID, name, all);
  1039.                         } else {
  1040.                                 clickMouse(50, 66, 7, 7, true);
  1041.                         }
  1042.                 } else {
  1043.                         bank
  1044.                                         .atItem(ID, all ? "Withdraw-All " +
  1045.  
  1046. name : "Withdraw-1 "
  1047.                                                         + name);
  1048.                 }
  1049.         }
  1050.  
  1051.         private void closeBank() {
  1052.                 clickMouse(489, 35, 3, 3, true, 20);
  1053.         }
  1054.  
  1055.         public int sleepTime() {
  1056.                 int time = sleepTime + random(-40, 40);
  1057.                 return time;
  1058.         }
  1059.  
  1060.         // get action
  1061.         public Action getAction() {
  1062.                 if (ringDisappeared == true
  1063.                                 && getNearestObjectByID(bankChestID) != null)
  1064.  
  1065. {
  1066.                         return Action.WITHDRAW_RING;
  1067.                 }
  1068.  
  1069.                 if (graahkDisappeared == true
  1070.                                 && getNearestObjectByID(bankChestID) != null
  1071.                                 && !ringDisappeared) {
  1072.                         return Action.SUMMON;
  1073.                 }
  1074.  
  1075.                 if ((getNearestObjectByID(bankChestID) != null) &&
  1076.  
  1077. fillPouches
  1078.                                 && !filledPouches && !ringDisappeared && !
  1079.  
  1080. graahkDisappeared) {
  1081.                         return Action.FILL;
  1082.                 }
  1083.  
  1084.                 if (getInventoryCount(pessID) < 20
  1085.                                 && (getNearestObjectByID(bankChestID) !=
  1086.  
  1087. null) && !fillPouches
  1088.                                 && !ringDisappeared && !graahkDisappeared) {
  1089.                         return Action.BANK;
  1090.                 }
  1091.  
  1092.                 if (getInventoryCount(pessID) >= 20 && !tileOnMap
  1093.  
  1094. (teleportTile)
  1095.                                 && getNearestObjectByID(bankChestID) != null
  1096.  
  1097. && !fillPouches
  1098.                                 && !ringDisappeared && !graahkDisappeared) {
  1099.                         return Action.GRAAHK;
  1100.                 }
  1101.  
  1102.                 if (getNearestObjectByID(ruinsID) == null
  1103.                                 && getNearestObjectByID(altarID) == null
  1104.                                 && getNearestObjectByID(bankChestID) == null)
  1105.  
  1106. {
  1107.                         return Action.WALK;
  1108.                 }
  1109.  
  1110.                 if (getNearestObjectByID(ruinsID) != null) {
  1111.                         return Action.ENTER;
  1112.                 }
  1113.  
  1114.                 if (getInventoryCount(pessID) >= 17
  1115.                                 && getNearestObjectByID(altarID) != null
  1116.                                 && getNearestObjectByID(ruinsID) == null) {
  1117.                         return Action.CRAFT;
  1118.                 }
  1119.  
  1120.                 if (getInventoryCount(pessID) == 0
  1121.                                 && getNearestObjectByID(altarID) != null
  1122.                                 && getNearestObjectByID(ruinsID) == null) {
  1123.                         return Action.RING;
  1124.                 }
  1125.                 return null;
  1126.         }
  1127.  
  1128.         // checks of character has a equipment on
  1129.         /*
  1130.          * private boolean equipmentContainsAny(int ... items) { for(int item
  1131.  
  1132. :
  1133.          * getEquipmentArray()) for(int id : items) if(item == id) return
  1134.  
  1135. true;
  1136.          * return false; }
  1137.          */
  1138.         // pouching methods
  1139.         private void emptyPouches() {
  1140.                 openTab(TAB_INVENTORY);
  1141.                 if (checkspouch)
  1142.                         pouchEmpty(smallpouch);
  1143.                 if (checkmpouch) {
  1144.                         if (inventoryContains(mediumpouch))
  1145.                                 pouchEmpty(mediumpouch);
  1146.                         else
  1147.                                 pouchEmpty(mediumpouchdecay);
  1148.                 }
  1149.                 if (checklpouch) {
  1150.                         if (inventoryContains(largepouch))
  1151.                                 pouchEmpty(largepouch);
  1152.                         else
  1153.                                 pouchEmpty(largepouchdecay);
  1154.                 }
  1155.                 if (checkgpouch) {
  1156.                         if (inventoryContains(giantpouch))
  1157.                                 pouchEmpty(giantpouch);
  1158.                         else
  1159.                                 pouchEmpty(giantpouchdecay);
  1160.                 }
  1161.                 emptiedPouches = true;
  1162.         }
  1163.  
  1164.         private boolean leftClickInventoryItem(int itemID) {
  1165.                 if (getCurrentTab() != TAB_INVENTORY
  1166.                                 && !RSInterface.getInterface
  1167.  
  1168. (INTERFACE_BANK).isValid()
  1169.                                 && !RSInterface.getInterface
  1170.  
  1171. (INTERFACE_STORE).isValid()) {
  1172.                         openTab(TAB_INVENTORY);
  1173.                 }
  1174.                 int[] items = getInventoryArray();
  1175.                 java.util.List<Integer> possible = new ArrayList<Integer>();
  1176.                 for (int i = 0; i < items.length; i++) {
  1177.                         if (items[i] == itemID) {
  1178.                                 possible.add(i);
  1179.                         }
  1180.                 }
  1181.                 if (possible.size() == 0)
  1182.                         return false;
  1183.                 int idx = possible.get(0);
  1184.                 Point t = getInventoryItemPoint(idx);
  1185.                 int x = t.x;
  1186.                 x += random(1, 35);
  1187.                 int y = t.y;
  1188.                 y += random(1, 30);
  1189.                 Point f = new Point(x, y);
  1190.                 clickMouse(f, 0, 0, true);
  1191.                 return true;
  1192.         }
  1193.  
  1194.         public boolean pouchFill(int i) {
  1195.                 int startCount = getInventoryCount(pessID);
  1196.                 leftClickInventoryItem(i);
  1197.                 if (i == smallpouch) {
  1198.                         if (inventoryContains(mediumpouch)) {
  1199.                                 hoverPouch(mediumpouch);
  1200.                         } else {
  1201.                                 hoverPouch(mediumpouchdecay);
  1202.                         }
  1203.                 } else if (i == mediumpouch || i == mediumpouchdecay) {
  1204.                         if (inventoryContains(largepouch)) {
  1205.                                 hoverPouch(largepouch);
  1206.                         } else {
  1207.                                 hoverPouch(largepouchdecay);
  1208.                         }
  1209.                 } else if (i == largepouch || i == largepouchdecay) {
  1210.                         if (inventoryContains(giantpouch)) {
  1211.                                 hoverPouch(giantpouch);
  1212.                         } else {
  1213.                                 hoverPouch(giantpouchdecay);
  1214.                         }
  1215.                 }
  1216.                 wait(sleepTime());
  1217.                 int endCount = getInventoryCount(pessID);
  1218.                 if ((endCount < startCount) || failcount >= 5) {
  1219.                         failcount = 0;
  1220.                         return true;
  1221.                 } else {
  1222.                         failcount++;
  1223.                         pouchFill(i);
  1224.                 }
  1225.                 return false;
  1226.         }
  1227.  
  1228.         public boolean pouchEmpty(int i) {
  1229.                 int startCount = getInventoryCount(pessID);
  1230.                 atInventoryItem(i, "mpty");
  1231.                 if (i == smallpouch) {
  1232.                         if (inventoryContains(mediumpouch)) {
  1233.                                 hoverPouch(mediumpouch);
  1234.                         } else {
  1235.                                 hoverPouch(mediumpouchdecay);
  1236.                         }
  1237.                 } else if (i == mediumpouch || i == mediumpouchdecay) {
  1238.                         if (inventoryContains(largepouch)) {
  1239.                                 hoverPouch(largepouch);
  1240.                         } else {
  1241.                                 hoverPouch(largepouchdecay);
  1242.                         }
  1243.                 } else if (i == largepouch || i == largepouchdecay) {
  1244.                         if (inventoryContains(giantpouch)) {
  1245.                                 hoverPouch(giantpouch);
  1246.                         } else {
  1247.                                 hoverPouch(giantpouchdecay);
  1248.                         }
  1249.                 }
  1250.                 wait(sleepTime());
  1251.                 int endCount = getInventoryCount(pessID);
  1252.                 if ((endCount > startCount) || failcount >= 5) {
  1253.                         failcount = 0;
  1254.                         return true;
  1255.                 } else {
  1256.                         failcount++;
  1257.                         pouchEmpty(i);
  1258.                 }
  1259.                 return false;
  1260.         }
  1261.  
  1262.         public boolean hoverPouch(int itemID) {
  1263.                 int[] pouch = getInventoryArray();
  1264.                 java.util.List<Integer> possible = new ArrayList<Integer>();
  1265.                 for (int i = 0; i < pouch.length; i++) {
  1266.                         if (pouch[i] == itemID) {
  1267.                                 possible.add(i);
  1268.                         }
  1269.                 }
  1270.                 if (possible.size() == 0)
  1271.                         return false;
  1272.                 int idx = possible.get(0);
  1273.                 Point t = getInventoryItemPoint(idx);
  1274.                 if (betweenPoints(getMouseLocation(), t) > 7) {
  1275.                         moveMouse(t, 5, 5);
  1276.                         return true;
  1277.                 } else {
  1278.                         return true;
  1279.                 }
  1280.         }
  1281.  
  1282.         public double betweenPoints(Point x, Point y) {
  1283.                 return (Math.hypot((x.x - y.x), (x.y - y.y)));
  1284.         }
  1285.  
  1286.         // paint
  1287.         private void highlightTile(final Graphics g, final RSTile t,
  1288.                         final Color outline, final Color fill) {
  1289.                 final Point pn = Calculations.tileToScreen(t.getX(), t.getY
  1290.  
  1291. (), 0, 0, 0);
  1292.                 final Point px = Calculations.tileToScreen(t.getX() + 1,
  1293.  
  1294. t.getY(), 0,
  1295.                                 0, 0);
  1296.                 final Point py = Calculations.tileToScreen(t.getX(), t.getY()
  1297.  
  1298. + 1, 0,
  1299.                                 0, 0);
  1300.                 final Point pxy = Calculations.tileToScreen(t.getX() + 1,
  1301.  
  1302. t.getY() + 1,
  1303.                                 0, 0, 0);
  1304.                 if (py.x == -1 || pxy.x == -1 || px.x == -1 || pn.x == -1) {
  1305.                         return;
  1306.                 }
  1307.                 g.setColor(outline);
  1308.                 g.drawPolygon(new int[] { py.x, pxy.x, px.x, pn.x }, new int
  1309.  
  1310. [] { py.y,
  1311.                                 pxy.y, px.y, pn.y }, 4);
  1312.                 g.setColor(fill);
  1313.                 g.fillPolygon(new int[] { py.x, pxy.x, px.x, pn.x }, new int
  1314.  
  1315. [] { py.y,
  1316.                                 pxy.y, px.y, pn.y }, 4);
  1317.         }
  1318.  
  1319.         private RSTile getRandomTileInArea(int maxX, int maxY, int minX, int
  1320.  
  1321. minY) {
  1322.                 int possibleX = maxX - minX;
  1323.                 int possibleY = maxY - minY;
  1324.                 int[] tileY = new int[possibleY];
  1325.                 int[] tileX = new int[possibleX];
  1326.                 for (int i = 0; i < (tileY.length); i++) {
  1327.                         tileY[i] = minY + i;
  1328.                 }
  1329.                 for (int i = 0; i < (tileX.length); i++) {
  1330.                         tileX[i] = minX + i;
  1331.                 }
  1332.                 int x = (int) (Math.random() * possibleX + 0);
  1333.                 int y = (int) (Math.random() * possibleY + 0);
  1334.                 RSTile tile = new RSTile(tileX[x], tileY[y]);
  1335.                 log(Arrays.toString(tileX));
  1336.                 log(Arrays.toString(tileY));
  1337.                 log("Tile returned " + tile);
  1338.                 if (tileOnMap(tile))
  1339.                         return tile;
  1340.                 else
  1341.                         return null;
  1342.         }
  1343.  
  1344.         public boolean walkTo(final RSTile tile) {
  1345.                 RSTile dest = getMyPlayer().getLocation();
  1346.                 RSTile[] path = null;
  1347.                 while (distanceTo(tile) > 3 || !tileOnScreen(tile)) {
  1348.                         if (distanceBetween(tile, dest) > 1) {
  1349.                                 dest = getClosestTileInRegion(tile);
  1350.                                 path = pathFinder.findPath(getMyPlayer
  1351.  
  1352. ().getLocation(), dest);
  1353.                         }
  1354.                         if (path == null) {
  1355.                                 return walkTileMM(checkTile(tile));
  1356.                         }
  1357.                         for (int i = path.length - 1; i >= 0; i--) {
  1358.                                 if (distanceTo(path[i]) < 17
  1359.                                                 && getRealDistanceTo(path[i],
  1360.  
  1361. false) < 60) {
  1362.                                         if (getDestination() != null) {
  1363.                                                 try {
  1364.                                                         if (distanceBetween
  1365.  
  1366. (getDestination(),
  1367.                                                                         path
  1368.  
  1369. [i]) <= 3) {
  1370.                                                                 break;
  1371.                                                         }
  1372.                                                 } catch (final Exception e) {
  1373.                                                         log.info("Walking
  1374.  
  1375. Error");
  1376.                                                 }
  1377.                                         }
  1378.                                         walkTileMM(checkTile(path[i]), 1, 1);
  1379.                                         wait(random(600, 1000));
  1380.                                         final RSTile cdest = getDestination
  1381.  
  1382. ();
  1383.                                         if (cdest != null && distanceTo
  1384.  
  1385. (cdest) > 6) {
  1386.                                                 wait(random(1000, 1200));
  1387.                                         }
  1388.                                         break;
  1389.                                 }
  1390.                         }
  1391.                         wait(random(50, 100));
  1392.                 }
  1393.                 return true;
  1394.         }
  1395.  
  1396.         private RSTile getClosestTileInRegion(final RSTile tile) {
  1397.                 if (tileInRegion(tile)) {
  1398.                         return tile;
  1399.                 }
  1400.                 final RSTile loc = getMyPlayer().getLocation();
  1401.                 final RSTile walk = new RSTile((loc.getX() + tile.getX()) /
  1402.  
  1403. 2, (loc
  1404.                                 .getY() + tile.getY()) / 2);
  1405.  
  1406.                 return tileInRegion(walk) ? walk : getClosestTileInRegion
  1407.  
  1408. (walk);
  1409.         }
  1410.  
  1411.         private RSTile checkTile(final RSTile tile) {
  1412.                 if (distanceTo(tile) < 17) {
  1413.                         return tile;
  1414.                 }
  1415.                 final RSTile loc = getMyPlayer().getLocation();
  1416.                 final RSTile walk = new RSTile((loc.getX() + tile.getX()) /
  1417.  
  1418. 2, (loc
  1419.                                 .getY() + tile.getY()) / 2);
  1420.                 return distanceTo(walk) < 17 ? walk : checkTile(walk);
  1421.         }
  1422.  
  1423.         private boolean tileInRegion(final RSTile tile) {
  1424.                 final int tileX = tile.getX() - Bot.getClient().getBaseX(),
  1425.  
  1426. tileY = tile
  1427.                                 .getY()
  1428.                                 - Bot.getClient().getBaseY();
  1429.                 return !(tileX < 0 || tileY < 0 || tileX > 103 || tileY >
  1430.  
  1431. 103);
  1432.         }
  1433.  
  1434.         public long timeToNext;
  1435.  
  1436.         // credits to DDM
  1437.         public class antiban extends Thread {
  1438.  
  1439.                 public void checkFriendsList() {
  1440.                         openTab(Constants.TAB_FRIENDS);
  1441.                         moveMouse(random(554, 709), random(227, 444));
  1442.                 }
  1443.  
  1444.                 public void checkSkills() {
  1445.                         openTab(Constants.TAB_STATS);
  1446.                         moveMouse(random(552, 603), random(420, 449));
  1447.                 }
  1448.  
  1449.                 public int getRandomMouseX(final int maxDistance) {
  1450.                         final Point p = getMouseLocation();
  1451.                         if (random(0, 2) == 0) {
  1452.                                 return p.x - random(0, p.x < maxDistance ?
  1453.  
  1454. p.x : maxDistance);
  1455.                         } else {
  1456.                                 return p.x
  1457.                                                 + random(1, 762 - p.x <
  1458.  
  1459. maxDistance ? 762 - p.x
  1460.                                                                 :
  1461.  
  1462. maxDistance);
  1463.                         }
  1464.                 }
  1465.  
  1466.                 public int getRandomMouseY(final int maxDistance) {
  1467.                         final Point p = getMouseLocation();
  1468.                         if (random(0, 2) == 0) {
  1469.                                 return p.y - random(0, p.y < maxDistance ?
  1470.  
  1471. p.y : maxDistance);
  1472.                         } else {
  1473.                                 return p.y
  1474.                                                 + random(1, 500 - p.y <
  1475.  
  1476. maxDistance ? 500 - p.y
  1477.                                                                 :
  1478.  
  1479. maxDistance);
  1480.                         }
  1481.                 }
  1482.  
  1483.                 public boolean moveMouseRandomly(int maxDistance) {
  1484.                         if (maxDistance == 0) {
  1485.                                 return false;
  1486.                         }
  1487.                         maxDistance = random(1, maxDistance);
  1488.                         final Point p = new Point(getRandomMouseX
  1489.  
  1490. (maxDistance),
  1491.                                         getRandomMouseY(maxDistance));
  1492.                         if (p.x < 1 || p.y < 1) {
  1493.                                 p.x = p.y = 1;
  1494.                         }
  1495.                         moveMouse(p);
  1496.                         if (random(0, 2) == 0) {
  1497.                                 return false;
  1498.                         }
  1499.                         return moveMouseRandomly(maxDistance / 2);
  1500.                 }
  1501.  
  1502.                 public long nextTime(final int waitTime) {
  1503.                         return time() + waitTime;
  1504.                 }
  1505.  
  1506.                 public long nextTime(final int min, final int max) {
  1507.                         return nextTime(random(min, max));
  1508.                 }
  1509.  
  1510.                 @Override
  1511.                 public void run() {
  1512.                         log("Antiban running");
  1513.                         try {
  1514.                                 final int roll = (int) (Math.random() *
  1515.  
  1516. 1000);
  1517.                                 if (timeToNext < time()) {
  1518.                                         if (roll > 995) {
  1519.                                         } else if (roll > 990 &&
  1520.  
  1521. getInventoryCount() < 23) {
  1522.                                                 checkSkills();
  1523.                                                 timeToNext =
  1524.  
  1525. System.currentTimeMillis()
  1526.                                                                 + random
  1527.  
  1528. (2000, 25000);
  1529.                                         } else if (roll > 985
  1530.                                                         && getInventoryCount
  1531.  
  1532. () < 23
  1533.                                                         && !
  1534.  
  1535. RSInterface.getInterface(751).getChild(15)
  1536.                                                                        
  1537.  
  1538. .getText().contains("Off")) {
  1539.                                                 checkFriendsList();
  1540.                                                 timeToNext =
  1541.  
  1542. System.currentTimeMillis()
  1543.                                                                 + random
  1544.  
  1545. (2000, 25000);
  1546.                                         } else if (roll > 980 &&
  1547.  
  1548. getInventoryCount() < 23) {
  1549.                                                 checkSkills();
  1550.                                                 timeToNext =
  1551.  
  1552. System.currentTimeMillis()
  1553.                                                                 + random
  1554.  
  1555. (2000, 25000);
  1556.                                         } else if (roll > 960) {
  1557.                                                 if (random(0, 2) == 0) {
  1558.                                                         setCameraRotation
  1559.  
  1560. ((int) (getCameraAngle() + (Math
  1561.                                                                        
  1562.  
  1563. .random() * 50 > 25 ? 1 : -1)
  1564.                                                                         * (30
  1565.  
  1566. + Math.random() * 90)));
  1567.                                                 } else {
  1568.                                                         final int key =
  1569.  
  1570. random(0, 3) < 0 ? KeyEvent.VK_UP
  1571.                                                                         :
  1572.  
  1573. KeyEvent.VK_DOWN;
  1574.                                                         Bot.getInputManager
  1575.  
  1576. ().pressKey((char) key);
  1577.                                                         Thread.sleep(random
  1578.  
  1579. (1000, 1500));
  1580.                                                         Bot.getInputManager
  1581.  
  1582. ().releaseKey((char) key);
  1583.                                                 }
  1584.                                         } else if (roll > 940) {
  1585.                                                 timeToNext =
  1586.  
  1587. System.currentTimeMillis()
  1588.                                                                 + random
  1589.  
  1590. (2000, 25000);
  1591.                                                 openTab
  1592.  
  1593. (Constants.TAB_INVENTORY);
  1594.                                         } else if (roll > 890 && !isRunning()
  1595.                                                         && getMyPlayer
  1596.  
  1597. ().isMoving()) {
  1598.                                                 if (getEnergy() > 50) {
  1599.                                                         clickMouse(random
  1600.  
  1601. (707, 762), random(90, 121), true);
  1602.                                                         timeToNext =
  1603.  
  1604. nextTime(500, 1200);
  1605.                                                 } else if (rest) {
  1606.                                                         Rest(100);
  1607.                                                         Run(true);
  1608.                                                         timeToNext =
  1609.  
  1610. nextTime(500, 1200);
  1611.                                                 }
  1612.                                                 Thread.sleep(random(300,
  1613.  
  1614. 1000));
  1615.                                         } else if (roll > 780) {
  1616.                                                 moveMouseRandomly(500);
  1617.                                                 timeToNext = nextTime(500,
  1618.  
  1619. 7500);
  1620.                                         }
  1621.                                 } else {
  1622.                                         Thread.yield();
  1623.                                 }
  1624.                         } catch (final InterruptedException e) {
  1625.                                 log("Interrupted");
  1626.                         }
  1627.                 }
  1628.  
  1629.                 public long time() {
  1630.                         return System.currentTimeMillis();
  1631.                 }
  1632.  
  1633.                 public boolean timePassed(final long time) {
  1634.                         return time() > time;
  1635.                 }
  1636.  
  1637.                 public void turnCameraRandom() {
  1638.                         setCameraRotation((int) (getCameraAngle() +
  1639.  
  1640. (Math.random() * 50 > 25 ? 1
  1641.                                         : -1)
  1642.                                         * (30 + Math.random() * 90)));
  1643.                 }
  1644.         }
  1645.  
  1646.         public void Rest(final int stopEnergy) {
  1647.                 rest(stopEnergy);
  1648.         }
  1649.  
  1650.         /*
  1651.          * public int getInventoryCount(int item){ int count = 0; int[]
  1652.  
  1653. itemarray =
  1654.          * getInventoryArray(); for(int i: itemarray){ if(itemarray[i] ==
  1655.  
  1656. item)
  1657.          * count++; } log(""+count); return count; }
  1658.          */
  1659.         public boolean Run(final boolean running) {
  1660.                 try {
  1661.                         final long startTime = System.currentTimeMillis();
  1662.                         while (System.currentTimeMillis() - startTime < 2000)
  1663.  
  1664. {
  1665.                                 if (running) {
  1666.                                         while (!isRunning()) {
  1667.                                                 wait(random(200, 230));
  1668.                                         }
  1669.                                         return true;
  1670.                                 } else {
  1671.                                         while (isRunning()) {
  1672.                                                 wait(random(200, 230));
  1673.                                         }
  1674.                                         return true;
  1675.                                 }
  1676.                         }
  1677.                         return false;
  1678.                 } catch (final Exception e) {
  1679.                         return false;
  1680.                 }
  1681.         }
  1682.  
  1683.         public class graahkcraftgui extends javax.swing.JFrame {
  1684.  
  1685.                 private static final long serialVersionUID = -
  1686.  
  1687. 4993921042786766283L;
  1688.  
  1689.                 /** Creates new form graahkcraftgui */
  1690.                 public graahkcraftgui() {
  1691.                         initComponents();
  1692.                 }
  1693.  
  1694.                 /**
  1695.                  * This method is called from within the constructor to
  1696.  
  1697. initialize the
  1698.                  * form. WARNING: Do NOT modify this code. The content of
  1699.  
  1700. this method is
  1701.                  * always regenerated by the Form Editor.
  1702.                  */
  1703.                 @SuppressWarnings("unchecked")
  1704.                 // <editor-fold defaultstate="collapsed" desc="Generated
  1705.  
  1706. Code">
  1707.                 private void initComponents() {
  1708.  
  1709.                         jTabbedPane1 = new javax.swing.JTabbedPane();
  1710.                         jPanel1 = new javax.swing.JPanel();
  1711.                         giantCheckBox = new javax.swing.JCheckBox();
  1712.                         usePouchesCheckBox = new javax.swing.JCheckBox();
  1713.                         smallCheckBox = new javax.swing.JCheckBox();
  1714.                         mediumCheckBox = new javax.swing.JCheckBox();
  1715.                         largeCheckBox = new javax.swing.JCheckBox();
  1716.                         sleepSlider = new javax.swing.JSlider();
  1717.                         jLabel1 = new javax.swing.JLabel();
  1718.                         jLabel2 = new javax.swing.JLabel();
  1719.                         mouseSlider = new javax.swing.JSlider();
  1720.                         pathTypeComboBox = new javax.swing.JComboBox();
  1721.                         jLabel3 = new javax.swing.JLabel();
  1722.                         jPanel2 = new javax.swing.JPanel();
  1723.                         jScrollPane1 = new javax.swing.JScrollPane();
  1724.                         jTextArea1 = new javax.swing.JTextArea();
  1725.                         jPanel3 = new javax.swing.JPanel();
  1726.                         jButton4 = new javax.swing.JButton();
  1727.                         jButton2 = new javax.swing.JButton();
  1728.                         jButton3 = new javax.swing.JButton();
  1729.                         jButton1 = new javax.swing.JButton();
  1730.  
  1731.                         setTitle("-TmacNats-");
  1732.                         setAlwaysOnTop(true);
  1733.                         setResizable(false);
  1734.  
  1735.                         jTabbedPane1.setBackground(new java.awt.Color(204,
  1736.  
  1737. 255, 204));
  1738.  
  1739.                         jPanel1.setBackground(new java.awt.Color(204, 255,
  1740.  
  1741. 204));
  1742.                         jPanel1.setToolTipText("Lower value means smaller
  1743.  
  1744. wait times");
  1745.  
  1746.                         giantCheckBox.setBackground(new java.awt.Color(204,
  1747.  
  1748. 255, 204));
  1749.                         giantCheckBox.setText("Giant");
  1750.                         giantCheckBox
  1751.                                         .addActionListener(new
  1752.  
  1753. java.awt.event.ActionListener() {
  1754.                                                 public void actionPerformed(
  1755.                                                                
  1756.  
  1757. java.awt.event.ActionEvent evt) {
  1758.                                                        
  1759.  
  1760. giantCheckBoxActionPerformed(evt);
  1761.                                                 }
  1762.                                         });
  1763.  
  1764.                         usePouchesCheckBox.setBackground(new java.awt.Color
  1765.  
  1766. (204, 255, 204));
  1767.                         usePouchesCheckBox.setText("Use pouches:");
  1768.                         usePouchesCheckBox
  1769.                                         .addActionListener(new
  1770.  
  1771. java.awt.event.ActionListener() {
  1772.                                                 public void actionPerformed(
  1773.                                                                
  1774.  
  1775. java.awt.event.ActionEvent evt) {
  1776.                                                        
  1777.  
  1778. usePouchesCheckBoxActionPerformed(evt);
  1779.                                                 }
  1780.                                         });
  1781.  
  1782.                         smallCheckBox.setBackground(new java.awt.Color(204,
  1783.  
  1784. 255, 204));
  1785.                         smallCheckBox.setText("Small");
  1786.  
  1787.                         mediumCheckBox.setBackground(new java.awt.Color(204,
  1788.  
  1789. 255, 204));
  1790.                         mediumCheckBox.setText("Medium");
  1791.  
  1792.                         largeCheckBox.setBackground(new java.awt.Color(204,
  1793.  
  1794. 255, 204));
  1795.                         largeCheckBox.setText("Large");
  1796.  
  1797.                         sleepSlider.setBackground(new java.awt.Color(204,
  1798.  
  1799. 255, 204));
  1800.                         sleepSlider.setFont(new java.awt.Font("Tahoma", 0,
  1801.  
  1802. 8)); // NOI18N
  1803.                         sleepSlider.setMajorTickSpacing(50);
  1804.                         sleepSlider.setMaximum(650);
  1805.                         sleepSlider.setMinimum(250);
  1806.                         sleepSlider.setMinorTickSpacing(1);
  1807.                         sleepSlider.setPaintLabels(true);
  1808.                         sleepSlider.setPaintTicks(true);
  1809.                         sleepSlider.setToolTipText("Lower value means smaller
  1810.  
  1811. wait times");
  1812.                         sleepSlider.setValue(400);
  1813.  
  1814.                         jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11));
  1815.                         jLabel1.setForeground(new java.awt.Color(102, 102,
  1816.  
  1817. 102));
  1818.                         jLabel1.setText("Sleep time");
  1819.  
  1820.                         jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11));
  1821.                         jLabel2.setForeground(new java.awt.Color(102, 102,
  1822.  
  1823. 102));
  1824.                         jLabel2.setText("Mouse speed");
  1825.  
  1826.                         mouseSlider.setBackground(new java.awt.Color(204,
  1827.  
  1828. 255, 204));
  1829.                         mouseSlider.setMajorTickSpacing(1);
  1830.                         mouseSlider.setMaximum(10);
  1831.                         mouseSlider.setMinimum(5);
  1832.                         mouseSlider.setMinorTickSpacing(1);
  1833.                         mouseSlider.setPaintLabels(true);
  1834.                         mouseSlider.setPaintTicks(true);
  1835.                         mouseSlider.setSnapToTicks(true);
  1836.                         mouseSlider.setToolTipText("Lower value means faster
  1837.  
  1838. mouse ");
  1839.                         mouseSlider.setValue(8);
  1840.  
  1841.                         pathTypeComboBox.setModel(new
  1842.  
  1843. javax.swing.DefaultComboBoxModel(
  1844.                                         new String[] { "Default", "Random"
  1845.  
  1846. }));
  1847.                         pathTypeComboBox
  1848.                                         .setToolTipText("Default - walks the
  1849.  
  1850. normal RCer path           Random - walks a random path everytime");
  1851.  
  1852.                         jLabel3.setText("Path type:");
  1853.  
  1854.                         javax.swing.GroupLayout jPanel1Layout = new
  1855.  
  1856. javax.swing.GroupLayout(
  1857.                                         jPanel1);
  1858.                         jPanel1.setLayout(jPanel1Layout);
  1859.                         jPanel1Layout
  1860.                                         .setHorizontalGroup(jPanel1Layout
  1861.                                                         .createParallelGroup(
  1862.                                                                        
  1863.  
  1864. javax.swing.GroupLayout.Alignment.LEADING)
  1865.                                                         .addGroup(
  1866.                                                                        
  1867.  
  1868. jPanel1Layout
  1869.                                                                                
  1870.  
  1871.         .createSequentialGroup()
  1872.                                                                                
  1873.  
  1874.         .addGroup(
  1875.                                                                                
  1876.  
  1877.                         jPanel1Layout
  1878.                                                                                
  1879.  
  1880.                                         .createParallelGroup(
  1881.                                                                                
  1882.  
  1883.                                                        
  1884.  
  1885. javax.swing.GroupLayout.Alignment.LEADING)
  1886.                                                                                
  1887.  
  1888.                                         .addGroup(
  1889.                                                                                
  1890.  
  1891.                                                         jPanel1Layout
  1892.                                                                                
  1893.  
  1894.                                                                        
  1895.  
  1896. .createSequentialGroup()
  1897.                                                                                
  1898.  
  1899.                                                                        
  1900.  
  1901. .addGroup(
  1902.                                                                                
  1903.  
  1904.                                                                                
  1905.  
  1906.         jPanel1Layout
  1907.                                                                                
  1908.  
  1909.                                                                                
  1910.  
  1911.                         .createParallelGroup(
  1912.                                                                                
  1913.  
  1914.                                                                                
  1915.  
  1916.                                        
  1917.  
  1918. javax.swing.GroupLayout.Alignment.LEADING)
  1919.                                                                                
  1920.  
  1921.                                                                                
  1922.  
  1923.                         .addGroup(
  1924.                                                                                
  1925.  
  1926.                                                                                
  1927.  
  1928.                                         jPanel1Layout
  1929.                                                                                
  1930.  
  1931.                                                                                
  1932.  
  1933.                                                        
  1934.  
  1935. .createSequentialGroup()
  1936.                                                                                
  1937.  
  1938.                                                                                
  1939.  
  1940.                                                         .addGap(
  1941.                                                                                
  1942.  
  1943.                                                                                
  1944.  
  1945.                                                                         28,
  1946.                                                                                
  1947.  
  1948.                                                                                
  1949.  
  1950.                                                                         28,
  1951.                                                                                
  1952.  
  1953.                                                                                
  1954.  
  1955.                                                                         28)
  1956.                                                                                
  1957.  
  1958.                                                                                
  1959.  
  1960.                                                         .addGroup(
  1961.                                                                                
  1962.  
  1963.                                                                                
  1964.  
  1965.                                                                        
  1966.  
  1967. jPanel1Layout
  1968.                                                                                
  1969.  
  1970.                                                                                
  1971.  
  1972.                                                                                
  1973.  
  1974.         .createParallelGroup(
  1975.                                                                                
  1976.  
  1977.                                                                                
  1978.  
  1979.                                                                                
  1980.  
  1981.                         javax.swing.GroupLayout.Alignment.LEADING)
  1982.                                                                                
  1983.  
  1984.                                                                                
  1985.  
  1986.                                                                                
  1987.  
  1988.         .addComponent(
  1989.                                                                                
  1990.  
  1991.                                                                                
  1992.  
  1993.                                                                                
  1994.  
  1995.                         mediumCheckBox)
  1996.                                                                                
  1997.  
  1998.                                                                                
  1999.  
  2000.                                                                                
  2001.  
  2002.         .addComponent(
  2003.                                                                                
  2004.  
  2005.                                                                                
  2006.  
  2007.                                                                                
  2008.  
  2009.                         smallCheckBox)
  2010.                                                                                
  2011.  
  2012.                                                                                
  2013.  
  2014.                                                                                
  2015.  
  2016.         .addComponent(
  2017.                                                                                
  2018.  
  2019.                                                                                
  2020.  
  2021.                                                                                
  2022.  
  2023.                         largeCheckBox)
  2024.                                                                                
  2025.  
  2026.                                                                                
  2027.  
  2028.                                                                                
  2029.  
  2030.         .addComponent(
  2031.                                                                                
  2032.  
  2033.                                                                                
  2034.  
  2035.                                                                                
  2036.  
  2037.                         giantCheckBox)))
  2038.                                                                                
  2039.  
  2040.                                                                                
  2041.  
  2042.                         .addGroup(
  2043.                                                                                
  2044.  
  2045.                                                                                
  2046.  
  2047.                                         jPanel1Layout
  2048.                                                                                
  2049.  
  2050.                                                                                
  2051.  
  2052.                                                        
  2053.  
  2054. .createSequentialGroup()
  2055.                                                                                
  2056.  
  2057.                                                                                
  2058.  
  2059.                                                         .addContainerGap()
  2060.                                                                                
  2061.  
  2062.                                                                                
  2063.  
  2064.                                                         .addComponent(
  2065.                                                                                
  2066.  
  2067.                                                                                
  2068.  
  2069.                                                                        
  2070.  
  2071. usePouchesCheckBox)))
  2072.                                                                                
  2073.  
  2074.                                                                        
  2075.  
  2076. .addGap(
  2077.                                                                                
  2078.  
  2079.                                                                                
  2080.  
  2081.         1,
  2082.                                                                                
  2083.  
  2084.                                                                                
  2085.  
  2086.         1,
  2087.                                                                                
  2088.  
  2089.                                                                                
  2090.  
  2091.         1)
  2092.                                                                                
  2093.  
  2094.                                                                        
  2095.  
  2096. .addGroup(
  2097.                                                                                
  2098.  
  2099.                                                                                
  2100.  
  2101.         jPanel1Layout
  2102.                                                                                
  2103.  
  2104.                                                                                
  2105.  
  2106.                         .createParallelGroup(
  2107.                                                                                
  2108.  
  2109.                                                                                
  2110.  
  2111.                                        
  2112.  
  2113. javax.swing.GroupLayout.Alignment.LEADING)
  2114.                                                                                
  2115.  
  2116.                                                                                
  2117.  
  2118.                         .addGroup(
  2119.                                                                                
  2120.  
  2121.                                                                                
  2122.  
  2123.                                         jPanel1Layout
  2124.                                                                                
  2125.  
  2126.                                                                                
  2127.  
  2128.                                                        
  2129.  
  2130. .createSequentialGroup()
  2131.                                                                                
  2132.  
  2133.                                                                                
  2134.  
  2135.                                                         .addGap(
  2136.                                                                                
  2137.  
  2138.                                                                                
  2139.  
  2140.                                                                         98,
  2141.                                                                                
  2142.  
  2143.                                                                                
  2144.  
  2145.                                                                         98,
  2146.                                                                                
  2147.  
  2148.                                                                                
  2149.  
  2150.                                                                         98)
  2151.                                                                                
  2152.  
  2153.                                                                                
  2154.  
  2155.                                                         .addGroup(
  2156.                                                                                
  2157.  
  2158.                                                                                
  2159.  
  2160.                                                                        
  2161.  
  2162. jPanel1Layout
  2163.                                                                                
  2164.  
  2165.                                                                                
  2166.  
  2167.                                                                                
  2168.  
  2169.         .createParallelGroup(
  2170.                                                                                
  2171.  
  2172.                                                                                
  2173.  
  2174.                                                                                
  2175.  
  2176.                         javax.swing.GroupLayout.Alignment.LEADING)
  2177.                                                                                
  2178.  
  2179.                                                                                
  2180.  
  2181.                                                                                
  2182.  
  2183.         .addComponent(
  2184.                                                                                
  2185.  
  2186.                                                                                
  2187.  
  2188.                                                                                
  2189.  
  2190.                         jLabel2)
  2191.                                                                                
  2192.  
  2193.                                                                                
  2194.  
  2195.                                                                                
  2196.  
  2197.         .addComponent(
  2198.                                                                                
  2199.  
  2200.                                                                                
  2201.  
  2202.                                                                                
  2203.  
  2204.                         jLabel1))
  2205.                                                                                
  2206.  
  2207.                                                                                
  2208.  
  2209.                                                         .addGap(
  2210.                                                                                
  2211.  
  2212.                                                                                
  2213.  
  2214.                                                                         150,
  2215.                                                                                
  2216.  
  2217.                                                                                
  2218.  
  2219.                                                                         150,
  2220.                                                                                
  2221.  
  2222.                                                                                
  2223.  
  2224.                                                                         150))
  2225.                                                                                
  2226.  
  2227.                                                                                
  2228.  
  2229.                         .addGroup(
  2230.                                                                                
  2231.  
  2232.                                                                                
  2233.  
  2234.                                        
  2235.  
  2236. javax.swing.GroupLayout.Alignment.TRAILING,
  2237.                                                                                
  2238.  
  2239.                                                                                
  2240.  
  2241.                                         jPanel1Layout
  2242.                                                                                
  2243.  
  2244.                                                                                
  2245.  
  2246.                                                        
  2247.  
  2248. .createSequentialGroup()
  2249.                                                                                
  2250.  
  2251.                                                                                
  2252.  
  2253.                                                         .addPreferredGap(
  2254.                                                                                
  2255.  
  2256.                                                                                
  2257.  
  2258.                                                                        
  2259.  
  2260. javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  2261.                                                                                
  2262.  
  2263.                                                                                
  2264.  
  2265.                                                         .addGroup(
  2266.                                                                                
  2267.  
  2268.                                                                                
  2269.  
  2270.                                                                        
  2271.  
  2272. jPanel1Layout
  2273.                                                                                
  2274.  
  2275.                                                                                
  2276.  
  2277.                                                                                
  2278.  
  2279.         .createParallelGroup(
  2280.                                                                                
  2281.  
  2282.                                                                                
  2283.  
  2284.                                                                                
  2285.  
  2286.                         javax.swing.GroupLayout.Alignment.LEADING)
  2287.                                                                                
  2288.  
  2289.                                                                                
  2290.  
  2291.                                                                                
  2292.  
  2293.         .addComponent(
  2294.                                                                                
  2295.  
  2296.                                                                                
  2297.  
  2298.                                                                                
  2299.  
  2300.                         sleepSlider,
  2301.                                                                                
  2302.  
  2303.                                                                                
  2304.  
  2305.                                                                                
  2306.  
  2307.                         javax.swing.GroupLayout.PREFERRED_SIZE,
  2308.                                                                                
  2309.  
  2310.                                                                                
  2311.  
  2312.                                                                                
  2313.  
  2314.                         javax.swing.GroupLayout.DEFAULT_SIZE,
  2315.                                                                                
  2316.  
  2317.                                                                                
  2318.  
  2319.                                                                                
  2320.  
  2321.                         javax.swing.GroupLayout.PREFERRED_SIZE)
  2322.                                                                                
  2323.  
  2324.                                                                                
  2325.  
  2326.                                                                                
  2327.  
  2328.         .addComponent(
  2329.                                                                                
  2330.  
  2331.                                                                                
  2332.  
  2333.                                                                                
  2334.  
  2335.                         mouseSlider,
  2336.                                                                                
  2337.  
  2338.                                                                                
  2339.  
  2340.                                                                                
  2341.  
  2342.                         javax.swing.GroupLayout.PREFERRED_SIZE,
  2343.                                                                                
  2344.  
  2345.                                                                                
  2346.  
  2347.                                                                                
  2348.  
  2349.                         javax.swing.GroupLayout.DEFAULT_SIZE,
  2350.                                                                                
  2351.  
  2352.                                                                                
  2353.  
  2354.                                                                                
  2355.  
  2356.                         javax.swing.GroupLayout.PREFERRED_SIZE))
  2357.                                                                                
  2358.  
  2359.                                                                                
  2360.  
  2361.                                                         .addGap(
  2362.                                                                                
  2363.  
  2364.                                                                                
  2365.  
  2366.                                                                         42,
  2367.                                                                                
  2368.  
  2369.                                                                                
  2370.  
  2371.                                                                         42,
  2372.                                                                                
  2373.  
  2374.                                                                                
  2375.  
  2376.                                                                        
  2377.  
  2378. 42))))
  2379.                                                                                
  2380.  
  2381.                                         .addGroup(
  2382.                                                                                
  2383.  
  2384.                                                         jPanel1Layout
  2385.                                                                                
  2386.  
  2387.                                                                        
  2388.  
  2389. .createSequentialGroup()
  2390.                                                                                
  2391.  
  2392.                                                                        
  2393.  
  2394. .addGap(
  2395.                                                                                
  2396.  
  2397.                                                                                
  2398.  
  2399.         36,
  2400.                                                                                
  2401.  
  2402.                                                                                
  2403.  
  2404.         36,
  2405.                                                                                
  2406.  
  2407.                                                                                
  2408.  
  2409.         36)
  2410.                                                                                
  2411.  
  2412.                                                                        
  2413.  
  2414. .addComponent(
  2415.                                                                                
  2416.  
  2417.                                                                                
  2418.  
  2419.         jLabel3)
  2420.                                                                                
  2421.  
  2422.                                                                        
  2423.  
  2424. .addGap(
  2425.                                                                                
  2426.  
  2427.                                                                                
  2428.  
  2429.         18,
  2430.                                                                                
  2431.  
  2432.                                                                                
  2433.  
  2434.         18,
  2435.                                                                                
  2436.  
  2437.                                                                                
  2438.  
  2439.         18)
  2440.                                                                                
  2441.  
  2442.                                                                        
  2443.  
  2444. .addComponent(
  2445.                                                                                
  2446.  
  2447.                                                                                
  2448.  
  2449.         pathTypeComboBox,
  2450.                                                                                
  2451.  
  2452.                                                                                
  2453.  
  2454.         javax.swing.GroupLayout.PREFERRED_SIZE,
  2455.                                                                                
  2456.  
  2457.                                                                                
  2458.  
  2459.         javax.swing.GroupLayout.DEFAULT_SIZE,
  2460.                                                                                
  2461.  
  2462.                                                                                
  2463.  
  2464.         javax.swing.GroupLayout.PREFERRED_SIZE)))
  2465.                                                                                
  2466.  
  2467.         .addContainerGap(
  2468.                                                                                
  2469.  
  2470.                         javax.swing.GroupLayout.DEFAULT_SIZE,
  2471.                                                                                
  2472.  
  2473.                         Short.MAX_VALUE)));
  2474.  
  2475.                         jPanel1Layout.linkSize
  2476.  
  2477. (javax.swing.SwingConstants.HORIZONTAL,
  2478.                                         new java.awt.Component[] {
  2479.  
  2480. mouseSlider, sleepSlider });
  2481.  
  2482.                         jPanel1Layout
  2483.                                         .setVerticalGroup(jPanel1Layout
  2484.                                                         .createParallelGroup(
  2485.                                                                        
  2486.  
  2487. javax.swing.GroupLayout.Alignment.LEADING)
  2488.                                                         .addGroup(
  2489.                                                                        
  2490.  
  2491. jPanel1Layout
  2492.                                                                                
  2493.  
  2494.         .createSequentialGroup()
  2495.                                                                                
  2496.  
  2497.         .addGap(18, 18, 18)
  2498.                                                                                
  2499.  
  2500.         .addGroup(
  2501.                                                                                
  2502.  
  2503.                         jPanel1Layout
  2504.                                                                                
  2505.  
  2506.                                         .createParallelGroup(
  2507.                                                                                
  2508.  
  2509.                                                        
  2510.  
  2511. javax.swing.GroupLayout.Alignment.BASELINE)
  2512.                                                                                
  2513.  
  2514.                                         .addComponent(
  2515.                                                                                
  2516.  
  2517.                                                         usePouchesCheckBox)
  2518.                                                                                
  2519.  
  2520.                                         .addComponent(
  2521.                                                                                
  2522.  
  2523.                                                         jLabel1))
  2524.                                                                                
  2525.  
  2526.         .addGroup(
  2527.                                                                                
  2528.  
  2529.                         jPanel1Layout
  2530.                                                                                
  2531.  
  2532.                                         .createParallelGroup(
  2533.                                                                                
  2534.  
  2535.                                                        
  2536.  
  2537. javax.swing.GroupLayout.Alignment.LEADING)
  2538.                                                                                
  2539.  
  2540.                                         .addGroup(
  2541.                                                                                
  2542.  
  2543.                                                         jPanel1Layout
  2544.                                                                                
  2545.  
  2546.                                                                        
  2547.  
  2548. .createSequentialGroup()
  2549.                                                                                
  2550.  
  2551.                                                                        
  2552.  
  2553. .addPreferredGap(
  2554.                                                                                
  2555.  
  2556.                                                                                
  2557.  
  2558.         javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  2559.                                                                                
  2560.  
  2561.                                                                        
  2562.  
  2563. .addComponent(
  2564.                                                                                
  2565.  
  2566.                                                                                
  2567.  
  2568.         smallCheckBox)
  2569.                                                                                
  2570.  
  2571.                                                                        
  2572.  
  2573. .addPreferredGap(
  2574.                                                                                
  2575.  
  2576.                                                                                
  2577.  
  2578.         javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  2579.                                                                                
  2580.  
  2581.                                                                        
  2582.  
  2583. .addComponent(
  2584.                                                                                
  2585.  
  2586.                                                                                
  2587.  
  2588.         mediumCheckBox)
  2589.                                                                                
  2590.  
  2591.                                                                        
  2592.  
  2593. .addPreferredGap(
  2594.                                                                                
  2595.  
  2596.                                                                                
  2597.  
  2598.         javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  2599.                                                                                
  2600.  
  2601.                                                                        
  2602.  
  2603. .addComponent(
  2604.                                                                                
  2605.  
  2606.                                                                                
  2607.  
  2608.         largeCheckBox)
  2609.                                                                                
  2610.  
  2611.                                                                        
  2612.  
  2613. .addPreferredGap(
  2614.                                                                                
  2615.  
  2616.                                                                                
  2617.  
  2618.         javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  2619.                                                                                
  2620.  
  2621.                                                                        
  2622.  
  2623. .addComponent(
  2624.                                                                                
  2625.  
  2626.                                                                                
  2627.  
  2628.         giantCheckBox))
  2629.                                                                                
  2630.  
  2631.                                         .addGroup(
  2632.                                                                                
  2633.  
  2634.                                                         jPanel1Layout
  2635.                                                                                
  2636.  
  2637.                                                                        
  2638.  
  2639. .createSequentialGroup()
  2640.                                                                                
  2641.  
  2642.                                                                        
  2643.  
  2644. .addGap(
  2645.                                                                                
  2646.  
  2647.                                                                                
  2648.  
  2649.         41,
  2650.                                                                                
  2651.  
  2652.                                                                                
  2653.  
  2654.         41,
  2655.                                                                                
  2656.  
  2657.                                                                                
  2658.  
  2659.         41)
  2660.                                                                                
  2661.  
  2662.                                                                        
  2663.  
  2664. .addComponent(
  2665.                                                                                
  2666.  
  2667.                                                                                
  2668.  
  2669.         jLabel2)
  2670.                                                                                
  2671.  
  2672.                                                                        
  2673.  
  2674. .addPreferredGap(
  2675.                                                                                
  2676.  
  2677.                                                                                
  2678.  
  2679.         javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  2680.                                                                                
  2681.  
  2682.                                                                        
  2683.  
  2684. .addComponent(
  2685.                                                                                
  2686.  
  2687.                                                                                
  2688.  
  2689.         mouseSlider,
  2690.                                                                                
  2691.  
  2692.                                                                                
  2693.  
  2694.         javax.swing.GroupLayout.PREFERRED_SIZE,
  2695.                                                                                
  2696.  
  2697.                                                                                
  2698.  
  2699.         javax.swing.GroupLayout.DEFAULT_SIZE,
  2700.                                                                                
  2701.  
  2702.                                                                                
  2703.  
  2704.         javax.swing.GroupLayout.PREFERRED_SIZE)))
  2705.                                                                                
  2706.  
  2707.         .addPreferredGap(
  2708.                                                                                
  2709.  
  2710.                         javax.swing.LayoutStyle.ComponentPlacement.RELATED,
  2711.                                                                                
  2712.  
  2713.                         javax.swing.GroupLayout.DEFAULT_SIZE,
  2714.                                                                                
  2715.  
  2716.                         Short.MAX_VALUE)
  2717.                                                                                
  2718.  
  2719.         .addGroup(
  2720.                                                                                
  2721.  
  2722.                         jPanel1Layout
  2723.                                                                                
  2724.  
  2725.                                         .createParallelGroup(
  2726.                                                                                
  2727.  
  2728.                                                        
  2729.  
  2730. javax.swing.GroupLayout.Alignment.BASELINE)
  2731.                                                                                
  2732.  
  2733.                                         .addComponent(
  2734.                                                                                
  2735.  
  2736.                                                         pathTypeComboBox,
  2737.                                                                                
  2738.  
  2739.                                                        
  2740.  
  2741. javax.swing.GroupLayout.PREFERRED_SIZE,
  2742.                                                                                
  2743.  
  2744.                                                        
  2745.  
  2746. javax.swing.GroupLayout.DEFAULT_SIZE,
  2747.                                                                                
  2748.  
  2749.                                                        
  2750.  
  2751. javax.swing.GroupLayout.PREFERRED_SIZE)
  2752.                                                                                
  2753.  
  2754.                                         .addComponent(
  2755.                                                                                
  2756.  
  2757.                                                         jLabel3))
  2758.                                                                                
  2759.  
  2760.         .addContainerGap())
  2761.                                                         .addGroup(
  2762.                                                                        
  2763.  
  2764. javax.swing.GroupLayout.Alignment.TRAILING,
  2765.                                                                        
  2766.  
  2767. jPanel1Layout
  2768.                                                                                
  2769.  
  2770.         .createSequentialGroup()
  2771.                                                                                
  2772.  
  2773.         .addContainerGap(38,
  2774.                                                                                
  2775.  
  2776.                         Short.MAX_VALUE)
  2777.                                                                                
  2778.  
  2779.         .addComponent(
  2780.                                                                                
  2781.  
  2782.                         sleepSlider,
  2783.                                                                                
  2784.  
  2785.                         javax.swing.GroupLayout.PREFERRED_SIZE,
  2786.                                                                                
  2787.  
  2788.                         javax.swing.GroupLayout.DEFAULT_SIZE,
  2789.                                                                                
  2790.  
  2791.                         javax.swing.GroupLayout.PREFERRED_SIZE)
  2792.                                                                                
  2793.  
  2794.         .addGap(105, 105, 105)));
  2795.  
  2796.                         jTabbedPane1.addTab("Main", jPanel1);
  2797.  
  2798.                         jPanel2.setBackground(new java.awt.Color(255, 204,
  2799.  
  2800. 204));
  2801.  
  2802.                         jTextArea1.setBackground(new java.awt.Color(255, 204,
  2803.  
  2804. 204));
  2805.                         jTextArea1.setColumns(20);
  2806.                         jTextArea1.setRows(5);
  2807.                         jTextArea1
  2808.                                         .setText("-TmacNats- by Tmac\n
  2809.  
  2810. \nThanks to \nDrizzt1112 and Aman");
  2811.                         jScrollPane1.setViewportView(jTextArea1);
  2812.  
  2813.                         javax.swing.GroupLayout jPanel2Layout = new
  2814.  
  2815. javax.swing.GroupLayout(
  2816.                                         jPanel2);
  2817.                         jPanel2.setLayout(jPanel2Layout);
  2818.                         jPanel2Layout.setHorizontalGroup
  2819.  
  2820. (jPanel2Layout.createParallelGroup(
  2821.                                        
  2822.  
  2823. javax.swing.GroupLayout.Alignment.LEADING).addComponent(
  2824.                                         jScrollPane1,
  2825.  
  2826. javax.swing.GroupLayout.DEFAULT_SIZE, 391,
  2827.                                         Short.MAX_VALUE));
  2828.                         jPanel2Layout.setVerticalGroup
  2829.  
  2830. (jPanel2Layout.createParallelGroup(
  2831.                                        
  2832.  
  2833. javax.swing.GroupLayout.Alignment.LEADING).addComponent(
  2834.                                         jScrollPane1,
  2835.  
  2836. javax.swing.GroupLayout.DEFAULT_SIZE, 184,
  2837.                                         Short.MAX_VALUE));
  2838.  
  2839.                         jTabbedPane1.addTab("Credits", jPanel2);
  2840.  
  2841.                         jPanel3.setBackground(new java.awt.Color(204, 204,
  2842.  
  2843. 255));
  2844.  
  2845.                         jButton4.setFont(new java.awt.Font("Verdana", 0,
  2846.  
  2847. 11)); // NOI18N
  2848.                         jButton4.setText("MSN: Tmac3d");
  2849.                         jButton4.addActionListener(new
  2850.  
  2851. java.awt.event.ActionListener() {
  2852.                                 public void actionPerformed
  2853.  
  2854. (java.awt.event.ActionEvent evt) {
  2855.                                         jButton4ActionPerformed(evt);
  2856.                                 }
  2857.                         });
  2858.  
  2859.                         javax.swing.GroupLayout jPanel3Layout = new
  2860.  
  2861. javax.swing.GroupLayout(
  2862.                                         jPanel3);
  2863.                         jPanel3.setLayout(jPanel3Layout);
  2864.                         jPanel3Layout
  2865.                                         .setHorizontalGroup(jPanel3Layout
  2866.                                                         .createParallelGroup(
  2867.                                                                        
  2868.  
  2869. javax.swing.GroupLayout.Alignment.LEADING)
  2870.                                                         .addGroup(
  2871.                                                                        
  2872.  
  2873. jPanel3Layout
  2874.                                                                                
  2875.  
  2876.         .createSequentialGroup()
  2877.                                                                                
  2878.  
  2879.         .addGap(55, 55, 55)
  2880.                                                                                
  2881.  
  2882.         .addComponent(
  2883.                                                                                
  2884.  
  2885.                         jButton4,
  2886.                                                                                
  2887.  
  2888.                         javax.swing.GroupLayout.PREFERRED_SIZE,
  2889.                                                                                
  2890.  
  2891.                         248,
  2892.                                                                                
  2893.  
  2894.                         javax.swing.GroupLayout.PREFERRED_SIZE)
  2895.                                                                                
  2896.  
  2897.         .addContainerGap(88,
  2898.                                                                                
  2899.  
  2900.                         Short.MAX_VALUE)));
  2901.                         jPanel3Layout
  2902.                                         .setVerticalGroup(jPanel3Layout
  2903.                                                         .createParallelGroup(
  2904.                                                                        
  2905.  
  2906. javax.swing.GroupLayout.Alignment.LEADING)
  2907.                                                         .addGroup(
  2908.                                                                        
  2909.  
  2910. jPanel3Layout
  2911.                                                                                
  2912.  
  2913.         .createSequentialGroup()
  2914.                                                                                
  2915.  
  2916.         .addGap(32, 32, 32)
  2917.                                                                                
  2918.  
  2919.         .addComponent(
  2920.                                                                                
  2921.  
  2922.                         jButton4,
  2923.                                                                                
  2924.  
  2925.                         javax.swing.GroupLayout.PREFERRED_SIZE,
  2926.                                                                                
  2927.  
  2928.                         109,
  2929.                                                                                
  2930.  
  2931.                         javax.swing.GroupLayout.PREFERRED_SIZE)
  2932.                                                                                
  2933.  
  2934.         .addContainerGap(43,
  2935.                                                                                
  2936.  
  2937.                         Short.MAX_VALUE)));
  2938.  
  2939.                         jTabbedPane1.addTab("Information", jPanel3);
  2940.  
  2941.                         jButton2.setText("Forum");
  2942.                         jButton2.addActionListener(new
  2943.  
  2944. java.awt.event.ActionListener() {
  2945.                                 public void actionPerformed
  2946.  
  2947. (java.awt.event.ActionEvent evt) {
  2948.                                         jButton2ActionPerformed(evt);
  2949.                                 }
  2950.                         });
  2951.  
  2952.                         jButton3.setText("Update");
  2953.                         jButton3.setEnabled(false);
  2954.                         jButton3.addActionListener(new
  2955.  
  2956. java.awt.event.ActionListener() {
  2957.                                 public void actionPerformed
  2958.  
  2959. (java.awt.event.ActionEvent evt) {
  2960.                                         jButton3ActionPerformed(evt);
  2961.                                 }
  2962.                         });
  2963.  
  2964.                         jButton1.setFont(new java.awt.Font("SansSerif", 1,
  2965.  
  2966. 11)); // NOI18N
  2967.                         jButton1.setText("START");
  2968.                         jButton1.addActionListener(new
  2969.  
  2970. java.awt.event.ActionListener() {
  2971.                                 public void actionPerformed
  2972.  
  2973. (java.awt.event.ActionEvent evt) {
  2974.                                         jButton1ActionPerformed(evt);
  2975.                                 }
  2976.                         });
  2977.  
  2978.                         javax.swing.GroupLayout layout = new
  2979.  
  2980. javax.swing.GroupLayout(
  2981.                                         getContentPane());
  2982.                         getContentPane().setLayout(layout);
  2983.                         layout
  2984.                                         .setHorizontalGroup(layout
  2985.                                                         .createParallelGroup(
  2986.                                                                        
  2987.  
  2988. javax.swing.GroupLayout.Alignment.LEADING)
  2989.                                                         .addGroup(
  2990.                                                                        
  2991.  
  2992. layout
  2993.                                                                                
  2994.  
  2995.         .createSequentialGroup()
  2996.                                                                                
  2997.  
  2998.         .addContainerGap()
  2999.                                                                                
  3000.  
  3001.         .addComponent(jButton2)
  3002.                                                                                
  3003.  
  3004.         .addPreferredGap(
  3005.                                                                                
  3006.  
  3007.                         javax.swing.LayoutStyle.ComponentPlacement.RELATED,
  3008.                                                                                
  3009.  
  3010.                         147, Short.MAX_VALUE)
  3011.                                                                                
  3012.  
  3013.         .addComponent(jButton3)
  3014.                                                                                
  3015.  
  3016.         .addPreferredGap(
  3017.                                                                                
  3018.  
  3019.                         javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  3020.                                                                                
  3021.  
  3022.         .addComponent(jButton1).addGap(34,
  3023.                                                                                
  3024.  
  3025.                         34, 34)).addComponent(
  3026.                                                                        
  3027.  
  3028. jTabbedPane1,
  3029.                                                                        
  3030.  
  3031. javax.swing.GroupLayout.DEFAULT_SIZE, 396,
  3032.                                                                        
  3033.  
  3034. Short.MAX_VALUE));
  3035.                         layout
  3036.                                         .setVerticalGroup(layout
  3037.                                                         .createParallelGroup(
  3038.                                                                        
  3039.  
  3040. javax.swing.GroupLayout.Alignment.LEADING)
  3041.                                                         .addGroup(
  3042.                                                                        
  3043.  
  3044. javax.swing.GroupLayout.Alignment.TRAILING,
  3045.                                                                        
  3046.  
  3047. layout
  3048.                                                                                
  3049.  
  3050.         .createSequentialGroup()
  3051.                                                                                
  3052.  
  3053.         .addComponent(
  3054.                                                                                
  3055.  
  3056.                         jTabbedPane1,
  3057.                                                                                
  3058.  
  3059.                         javax.swing.GroupLayout.DEFAULT_SIZE,
  3060.                                                                                
  3061.  
  3062.                         212, Short.MAX_VALUE)
  3063.                                                                                
  3064.  
  3065.         .addPreferredGap(
  3066.                                                                                
  3067.  
  3068.                         javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  3069.                                                                                
  3070.  
  3071.         .addGroup(
  3072.                                                                                
  3073.  
  3074.                         layout
  3075.                                                                                
  3076.  
  3077.                                         .createParallelGroup(
  3078.                                                                                
  3079.  
  3080.                                                        
  3081.  
  3082. javax.swing.GroupLayout.Alignment.BASELINE)
  3083.                                                                                
  3084.  
  3085.                                         .addComponent(
  3086.                                                                                
  3087.  
  3088.                                                         jButton2)
  3089.                                                                                
  3090.  
  3091.                                         .addComponent(
  3092.                                                                                
  3093.  
  3094.                                                         jButton3)
  3095.                                                                                
  3096.  
  3097.                                         .addComponent(
  3098.                                                                                
  3099.  
  3100.                                                         jButton1))
  3101.                                                                                
  3102.  
  3103.         .addContainerGap()));
  3104.  
  3105.                         pack();
  3106.                 }// </editor-fold>
  3107.  
  3108.                 private void giantCheckBoxActionPerformed
  3109.  
  3110. (java.awt.event.ActionEvent evt) {
  3111.                         // TODO add your handling code here:
  3112.                 }
  3113.  
  3114.                 private void usePouchesCheckBoxActionPerformed(
  3115.                                 java.awt.event.ActionEvent evt) {
  3116.                         // TODO add your handling code here:
  3117.                 }
  3118.  
  3119.                 private void jButton2ActionPerformed
  3120.  
  3121. (java.awt.event.ActionEvent evt) {
  3122.                         if (!java.awt.Desktop.isDesktopSupported()) {
  3123.                                 log("Unable to open page. You can manually
  3124.  
  3125. open the page; the url is http://www.rsbot.org/vb/showthread.php?t=116644");
  3126.                                 return;
  3127.                         }
  3128.                         java.awt.Desktop desktop =
  3129.  
  3130. java.awt.Desktop.getDesktop();
  3131.                         if (!desktop.isSupported
  3132.  
  3133. (java.awt.Desktop.Action.BROWSE)) {
  3134.                                 log("Unable to open page. You can manually
  3135.  
  3136. open the page; the url is http://www.rsbot.org/vb/showthread.php?t=116644");
  3137.                                 return;
  3138.                         }
  3139.                         try {
  3140.                                 desktop.browse(new URI(
  3141.                                                
  3142.  
  3143. "http://www.rsbot.org/vb/showthread.php?t=116644"));
  3144.                                 log("Successfully opened page.");
  3145.                         } catch (Exception e) {
  3146.                                 log(e.getMessage());
  3147.                                 return;
  3148.                         }
  3149.                 }
  3150.  
  3151.                 private void jButton3ActionPerformed
  3152.  
  3153. (java.awt.event.ActionEvent evt) {
  3154.                         // update
  3155.                 }
  3156.  
  3157.                 private void jButton1ActionPerformed
  3158.  
  3159. (java.awt.event.ActionEvent evt) {
  3160.                         if (usePouchesCheckBox.isSelected()) {
  3161.                                 usePouches = true;
  3162.                                 if (smallCheckBox.isSelected())
  3163.                                         checkspouch = true;
  3164.                                 if (mediumCheckBox.isSelected())
  3165.                                         checkmpouch = true;
  3166.                                 if (largeCheckBox.isSelected())
  3167.                                         checklpouch = true;
  3168.                                 if (giantCheckBox.isSelected())
  3169.                                         checkgpouch = true;
  3170.                         }
  3171.                         if (pathTypeComboBox.getSelectedItem().equals
  3172.  
  3173. ("Default")) {
  3174.                                 normalPath = true;
  3175.                         }
  3176.                         mouseSpeed = mouseSlider.getValue();
  3177.                         sleepTime = sleepSlider.getValue();
  3178.                         setVisible(false);
  3179.                         startScript = true;
  3180.                 }
  3181.  
  3182.                 private void jButton4ActionPerformed
  3183.  
  3184. (java.awt.event.ActionEvent evt) {
  3185.                         // paypal link
  3186.                         // https://www.paypal.com/cgi-bin/webscr?cmd=_s-
  3187.  
  3188. xclick&hosted_button_id=7582494
  3189.                         if (!java.awt.Desktop.isDesktopSupported()) {
  3190.                                 log("Unable to open page. You can manually
  3191.  
  3192. open the page; the url is https://www.paypal.com/cgi-bin/webscr?cmd=_s-
  3193.  
  3194. xclick&hosted_button_id=7582494");
  3195.                                 return;
  3196.                         }
  3197.                         java.awt.Desktop desktop =
  3198.  
  3199. java.awt.Desktop.getDesktop();
  3200.                         if (!desktop.isSupported
  3201.  
  3202. (java.awt.Desktop.Action.BROWSE)) {
  3203.                                 log("Unable to open page. You can manually
  3204.  
  3205. open the page; the url is https://www.paypal.com/cgi-bin/webscr?cmd=_s-
  3206.  
  3207. xclick&hosted_button_id=7582494");
  3208.                                 return;
  3209.                         }
  3210.                         try {
  3211.                                 desktop
  3212.                                                 .browse(new URI(
  3213.                                                                
  3214.  
  3215. "https://www.paypal.com/cgi-bin/webscr?cmd=_s-
  3216.  
  3217. xclick&hosted_button_id=7582494"));
  3218.                                 log("Successfully opened page.");
  3219.                         } catch (Exception e) {
  3220.                                 log(e.getMessage());
  3221.                                 return;
  3222.                         }
  3223.                 }
  3224.  
  3225.                 /**
  3226.                  * @param args
  3227.                  *            the command line arguments
  3228.                  */
  3229.                 public void main(String args[]) {
  3230.                         java.awt.EventQueue.invokeLater(new Runnable() {
  3231.                                 public void run() {
  3232.                                         new graahkcraftgui().setVisible
  3233.  
  3234. (true);
  3235.                                 }
  3236.                         });
  3237.                 }
  3238.  
  3239.                 // Variables declaration - do not modify
  3240.                 private javax.swing.JCheckBox giantCheckBox;
  3241.                 private javax.swing.JButton jButton1;
  3242.                 private javax.swing.JButton jButton2;
  3243.                 private javax.swing.JButton jButton3;
  3244.                 private javax.swing.JButton jButton4;
  3245.                 private javax.swing.JLabel jLabel1;
  3246.                 private javax.swing.JLabel jLabel2;
  3247.                 private javax.swing.JLabel jLabel3;
  3248.                 private javax.swing.JPanel jPanel1;
  3249.                 private javax.swing.JPanel jPanel2;
  3250.                 private javax.swing.JPanel jPanel3;
  3251.                 private javax.swing.JScrollPane jScrollPane1;
  3252.                 private javax.swing.JTabbedPane jTabbedPane1;
  3253.                 private javax.swing.JTextArea jTextArea1;
  3254.                 private javax.swing.JCheckBox largeCheckBox;
  3255.                 private javax.swing.JCheckBox mediumCheckBox;
  3256.                 private javax.swing.JSlider mouseSlider;
  3257.                 private javax.swing.JComboBox pathTypeComboBox;
  3258.                 private javax.swing.JSlider sleepSlider;
  3259.                 private javax.swing.JCheckBox smallCheckBox;
  3260.                 private javax.swing.JCheckBox usePouchesCheckBox;
  3261.                 // End of variables declaration
  3262.  
  3263.         }
  3264.  
  3265. }
  3266.  
  3267. class AStarGC {// Credits to Jacmob who credited DDM who credited some other
  3268.  
  3269. guy
  3270.  
  3271.         private class Node {
  3272.  
  3273.                 public int x, y;
  3274.                 public Node parent;
  3275.                 public double g, f;
  3276.  
  3277.                 public Node(final int x, final int y) {
  3278.                         this.x = x;
  3279.                         this.y = y;
  3280.                         g = f = 0;
  3281.                 }
  3282.  
  3283.                 public boolean isAt(final Node another) {
  3284.                         return x == another.x && y == another.y;
  3285.                 }
  3286.  
  3287.                 public RSTile toRSTile(final int baseX, final int baseY) {
  3288.                         return new RSTile(x + baseX, y + baseY);
  3289.                 }
  3290.  
  3291.         }
  3292.  
  3293.         private int[][] blocks;
  3294.  
  3295.         public AStarGC() {
  3296.  
  3297.         }
  3298.  
  3299.         private Node cheapestNode(final ArrayList<Node> open) {
  3300.                 Node c = null;
  3301.                 for (final Node t : open) {
  3302.                         if (c == null || t.f < c.f) {
  3303.                                 c = t;
  3304.                         }
  3305.                 }
  3306.                 return c;
  3307.         }
  3308.  
  3309.         private double diagonalHeuristic(final Node current, final Node end)
  3310.  
  3311. {
  3312.                 final double dx = Math.abs(current.x - end.x);
  3313.                 final double dy = Math.abs(current.y - end.y);
  3314.                 final double diag = Math.min(dx, dy);
  3315.                 final double straight = dx + dy;
  3316.                 return Math.sqrt(2.0) * diag + straight - 2 * diag;
  3317.         }
  3318.  
  3319.         public RSTile[] findPath(final RSTile cur, final RSTile dest) {
  3320.                 final int baseX = Bot.getClient().getBaseX(), baseY =
  3321.  
  3322. Bot.getClient()
  3323.                                 .getBaseY();
  3324.                 final int currX = cur.getX() - baseX, currY = cur.getY() -
  3325.  
  3326. baseY;
  3327.                 final int destX = dest.getX() - baseX, destY = dest.getY() -
  3328.  
  3329. baseY;
  3330.                 if (currX < 0 || currY < 0 || currX > 103 || currY > 103 ||
  3331.  
  3332. destX < 0
  3333.                                 || destY < 0 || destX > 103 || destY > 103) {
  3334.                         return null;
  3335.                 }
  3336.                 final ArrayList<Node> closed = new ArrayList<Node>(), open =
  3337.  
  3338. new ArrayList<Node>();
  3339.                 blocks = Bot.getClient().getRSGroundDataArray()
  3340.  
  3341. [Bot.getClient()
  3342.                                 .getPlane()].getBlocks();
  3343.                 Node current = new Node(currX, currY);
  3344.                 final Node destination = new Node(destX, destY);
  3345.                 open.add(current);
  3346.                 while (open.size() > 0) {
  3347.                         current = cheapestNode(open);
  3348.                         closed.add(current);
  3349.                         open.remove(open.indexOf(current));
  3350.                         for (final Node n : getSurroundingWalkableNodes
  3351.  
  3352. (current)) {
  3353.                                 if (!isIn(closed, n)) {
  3354.                                         if (!isIn(open, n)) {
  3355.                                                 n.parent = current;
  3356.                                                 n.g = current.g +
  3357.  
  3358. getAdditionalCost(n, current);
  3359.                                                 n.f = n.g +
  3360.  
  3361. diagonalHeuristic(n, destination);
  3362.                                                 open.add(n);
  3363.                                         } else {
  3364.                                                 final Node old = getNode
  3365.  
  3366. (open, n);
  3367.                                                 if (current.g +
  3368.  
  3369. getAdditionalCost(old, current) < old.g) {
  3370.                                                         old.parent = current;
  3371.                                                         old.g = current.g +
  3372.  
  3373. getAdditionalCost(old, current);
  3374.                                                         old.f = old.g +
  3375.  
  3376. diagonalHeuristic(old, destination);
  3377.                                                 }
  3378.                                         }
  3379.                                 }
  3380.                         }
  3381.                         if (isIn(closed, destination)) {
  3382.                                 return getPath(closed.get(closed.size() - 1),
  3383.  
  3384. baseX, baseY);
  3385.                         }
  3386.                 }
  3387.                 return null;
  3388.         }
  3389.  
  3390.         private double getAdditionalCost(final Node start, final Node end) {
  3391.                 double cost = 1.0;
  3392.                 if (!(start.x == end.y) || start.x == end.y) {
  3393.                         cost = Math.sqrt(2.0);
  3394.                 }
  3395.                 return cost;
  3396.         }
  3397.  
  3398.         private Node getNode(final ArrayList<Node> nodes, final Node key) {
  3399.                 for (final Node n : nodes) {
  3400.                         if (n.isAt(key)) {
  3401.                                 return n;
  3402.                         }
  3403.                 }
  3404.                 return null;
  3405.         }
  3406.  
  3407.         private RSTile[] getPath(final Node endNode, final int baseX,
  3408.                         final int baseY) {
  3409.                 final ArrayList<RSTile> reversePath = new ArrayList<RSTile>
  3410.  
  3411. ();
  3412.                 Node p = endNode;
  3413.                 while (p.parent != null) {
  3414.                         reversePath.add(p.toRSTile(baseX, baseY));
  3415.                         final int next = (int) (Math.random() * 4 + 5);
  3416.                         for (int i = 0; i < next && p.parent != null; i++) {
  3417.                                 p = p.parent;
  3418.                         }
  3419.                 }
  3420.                 final RSTile[] fixedPath = new RSTile[reversePath.size()];
  3421.                 for (int i = 0; i < fixedPath.length; i++) {
  3422.                         fixedPath[i] = reversePath.get(fixedPath.length - 1 -
  3423.  
  3424. i);
  3425.                 }
  3426.                 return fixedPath;
  3427.         }
  3428.  
  3429.         private ArrayList<Node> getSurroundingWalkableNodes(final Node t) {
  3430.                 final ArrayList<Node> tiles = new ArrayList<Node>();
  3431.                 final int curX = t.x, curY = t.y;
  3432.                 if (curX > 0 && curY < 103
  3433.                                 && (blocks[curX - 1][curY + 1] & 0x1280138)
  3434.  
  3435. == 0
  3436.                                 && (blocks[curX - 1][curY] & 0x1280108) == 0
  3437.                                 && (blocks[curX][curY + 1] & 0x1280120) == 0)
  3438.  
  3439. {
  3440.                         tiles.add(new Node(curX - 1, curY + 1));
  3441.                 }
  3442.                 if (curY < 103 && (blocks[curX][curY + 1] & 0x1280120) == 0)
  3443.  
  3444. {
  3445.                         tiles.add(new Node(curX, curY + 1));
  3446.                 }
  3447.                 if (curX > 0 && curY < 103
  3448.                                 && (blocks[curX - 1][curY + 1] & 0x1280138)
  3449.  
  3450. == 0
  3451.                                 && (blocks[curX - 1][curY] & 0x1280108) == 0
  3452.                                 && (blocks[curX][curY + 1] & 0x1280120) == 0)
  3453.  
  3454. {
  3455.                         tiles.add(new Node(curX + 1, curY + 1));
  3456.                 }
  3457.                 if (curX > 0 && (blocks[curX - 1][curY] & 0x1280108) == 0) {
  3458.                         tiles.add(new Node(curX - 1, curY));
  3459.                 }
  3460.                 if (curX < 103 && (blocks[curX + 1][curY] & 0x1280180) == 0)
  3461.  
  3462. {
  3463.                         tiles.add(new Node(curX + 1, curY));
  3464.                 }
  3465.                 if (curX > 0 && curY > 0
  3466.                                 && (blocks[curX - 1][curY - 1] & 0x128010e)
  3467.  
  3468. == 0
  3469.                                 && (blocks[curX - 1][curY] & 0x1280108) == 0
  3470.                                 && (blocks[curX][curY - 1] & 0x1280102) == 0)
  3471.  
  3472. {
  3473.                         tiles.add(new Node(curX - 1, curY - 1));
  3474.                 }
  3475.                 if (curY > 0 && (blocks[curX][curY - 1] & 0x1280102) == 0) {
  3476.                         tiles.add(new Node(curX, curY - 1));
  3477.                 }
  3478.                 if (curX < 103 && curY > 0
  3479.                                 && (blocks[curX + 1][curY - 1] & 0x1280183)
  3480.  
  3481. == 0
  3482.                                 && (blocks[curX + 1][curY] & 0x1280180) == 0
  3483.                                 && (blocks[curX][curY - 1] & 0x1280102) == 0)
  3484.  
  3485. {
  3486.                         tiles.add(new Node(curX + 1, curY - 1));
  3487.                 }
  3488.                 return tiles;
  3489.         }
  3490.  
  3491.         private boolean isIn(final ArrayList<Node> nodes, final Node key) {
  3492.                 return getNode(nodes, key) != null;
  3493.         }
  3494.  
  3495. }