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

Untitled

By: a guest on Apr 25th, 2012  |  syntax: None  |  size: 17.44 KB  |  hits: 24  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import java.awt.*;
  2. import java.awt.event.*;
  3. import java.awt.image.BufferedImage;
  4. import java.io.*;
  5. import java.net.*;
  6.  
  7. import javax.imageio.ImageIO;
  8.  
  9. import org.powerbot.concurrent.Task;
  10. import org.powerbot.concurrent.strategy.Condition;
  11. import org.powerbot.concurrent.strategy.Strategy;
  12. import org.powerbot.game.api.ActiveScript;
  13. import org.powerbot.game.api.Manifest;
  14. import org.powerbot.game.api.methods.Calculations;
  15. import org.powerbot.game.api.methods.Game;
  16. import org.powerbot.game.api.methods.Tabs;
  17. import org.powerbot.game.api.methods.Widgets;
  18. import org.powerbot.game.api.methods.input.Mouse;
  19. import org.powerbot.game.api.methods.interactive.NPCs;
  20. import org.powerbot.game.api.methods.interactive.Players;
  21. import org.powerbot.game.api.methods.node.GroundItems;
  22. import org.powerbot.game.api.methods.tab.Inventory;
  23. import org.powerbot.game.api.methods.tab.Skills;
  24. import org.powerbot.game.api.methods.widget.Camera;
  25. import org.powerbot.game.api.util.Filter;
  26. import org.powerbot.game.api.util.Random;
  27. import org.powerbot.game.api.util.Time;
  28. import org.powerbot.game.api.util.Timer;
  29. import org.powerbot.game.api.wrappers.Area;
  30. import org.powerbot.game.api.wrappers.Tile;
  31. import org.powerbot.game.api.wrappers.interactive.NPC;
  32. import org.powerbot.game.api.wrappers.node.GroundItem;
  33. import org.powerbot.game.api.wrappers.node.Item;
  34. import org.powerbot.game.api.wrappers.widget.WidgetChild;
  35. import org.powerbot.game.bot.event.listener.PaintListener;
  36. import org.powerbot.game.api.methods.Walking;
  37.  
  38. @Manifest(name = "Deadly Red Spider Killer", authors = "Remco Borst", version = 1.0, description = "Kills deadly red spiders for XP in the Varroc dungeon and picks up charms ( start at the spiders )", premium = false)
  39. public class RDSK extends ActiveScript implements PaintListener {
  40.  
  41.         //Paint variables
  42.                 private final RenderingHints antialiasing = new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  43.                 private final Color color3 = new Color(255, 255, 255);
  44.                 private final BasicStroke stroke1 = new BasicStroke(1);
  45.                 private final Font font1 = new Font("Arial", 0, 12);
  46.                 private final Font font2 = new Font("Arial", 1, 16);
  47.         // XP int's
  48.         private static int startExp;
  49.         private static long startTime;
  50.         public int iAttackXP, iStrengthXP, iDefenceXP, iConstitutionXP, iRangeXP,
  51.                         iMagicXP;
  52.         public int iAttack2go, iStrength2go, iDefence2go, iConstitution2go;
  53.         // Levels
  54.         public int iCombatLVL;
  55.         public int iAttackLVL, iStrengthLVL, iDefenceLVL, iConstitutionLVL,
  56.                         iRangeLVL, iMagicLVL;
  57.  
  58.         public boolean cameraChanged = false;
  59.         public boolean botStarted = false;
  60.         public boolean frameOpened = false;
  61.         public boolean pickUpCharms = true;
  62.  
  63.         @Override
  64.         protected void setup() {
  65.                 // Set Starting XP per skill
  66.                 iAttackXP = Skills.getExperience(Skills.ATTACK);
  67.                 iStrengthXP = Skills.getExperience(Skills.STRENGTH);
  68.                 iDefenceXP = Skills.getExperience(Skills.DEFENSE);
  69.                 iConstitutionXP = Skills.getExperience(Skills.CONSTITUTION);
  70.                 iRangeXP = Skills.getExperience(Skills.RANGE);
  71.                 iMagicXP = Skills.getExperience(Skills.MAGIC);
  72.  
  73.                 // Set LVL's
  74.                 iAttackLVL = Skills.getLevel(Skills.ATTACK);
  75.                 iStrengthLVL = Skills.getLevel(Skills.STRENGTH);
  76.                 iDefenceLVL = Skills.getLevel(Skills.DEFENSE);
  77.                 iConstitutionLVL = Skills.getLevel(Skills.CONSTITUTION);
  78.                 iRangeLVL = Skills.getLevel(Skills.RANGE);
  79.                 iMagicLVL = Skills.getLevel(Skills.MAGIC);
  80.                 iCombatLVL = Players.getLocal().getLevel();
  81.  
  82.                 startTime = System.currentTimeMillis();
  83.  
  84.                 try {
  85.                         openGUI();
  86.                 } catch (InterruptedException e) {
  87.                         e.printStackTrace();
  88.                 }
  89.  
  90.                 // Execute Take
  91.                 Take Take = new Take();
  92.                 provide(new Strategy(Take, Take));
  93.  
  94.                 // AntiBan
  95.                 antiBan antiBan = new antiBan();
  96.                 provide(new Strategy(antiBan, antiBan));
  97.  
  98.                 // Execute Heal
  99.                 Heal Heal = new Heal();
  100.                 provide(new Strategy(Heal, Heal));
  101.  
  102.                 // Check and walk to area.
  103.                 areaCheck areaCheck = new areaCheck();
  104.                 provide(new Strategy(areaCheck, areaCheck));
  105.  
  106.                 // Execute openInvetory
  107.                 openInvetory openInvetory = new openInvetory();
  108.                 provide(new Strategy(openInvetory, openInvetory));
  109.  
  110.                 // Execute runCheck
  111.                 runCheck runCheck = new runCheck();
  112.                 provide(new Strategy(runCheck, runCheck));
  113.  
  114.                 // Execute runCheck
  115.                 moveCameraUp moveCameraUp = new moveCameraUp();
  116.                 provide(new Strategy(moveCameraUp, moveCameraUp));
  117.  
  118.                 // Execute Attack.
  119.                 Attack Attack = new Attack();
  120.                 provide(new Strategy(Attack, Attack));
  121.         }
  122.  
  123.         Timer xxx = new Timer(0);
  124.  
  125.         //Idk whos function this is, post name and credit will be given.
  126.                 private String formatTime(final long milliseconds)
  127.                 {
  128.                         final long t_seconds = milliseconds / 1000;
  129.                         final long t_minutes = t_seconds / 60;
  130.                         final long t_hours = t_minutes / 60;
  131.                         final long seconds = t_seconds % 60;
  132.                         final long minutes = t_minutes % 60;
  133.                         final long hours = t_hours % 500;
  134.  
  135.                         if( minutes < 10)
  136.                                 return hours + ": 0" + minutes + ":" + seconds;
  137.                         else
  138.                                 return hours + ":" + minutes + ":" + seconds;
  139.                 }
  140.         @Override
  141.         public void onRepaint(Graphics arg0) {
  142.                 int ExpGained = (Skills.getExperiences()[Skills.STRENGTH] - iStrengthXP);
  143.                 int ExpPerHour = (int)Math.floor((ExpGained * 3600000D) / (System.currentTimeMillis() - startTime) / 1000);
  144.                 String exphr = ExpPerHour + "k";
  145.                 String timeElapsed = formatTime(System.currentTimeMillis() - startTime);
  146.  
  147.                 Graphics2D g = (Graphics2D)arg0;
  148.                 g.setRenderingHints(antialiasing);
  149.  
  150.                 g.setColor(new Color(0,0,0,120));
  151.                 g.fillRoundRect(4, 227, 229, 109, 16, 16);
  152.                 g.setColor(Color.BLACK);
  153.                 g.setStroke(stroke1);
  154.                 g.drawRoundRect(4, 227, 229, 109, 16, 16);
  155.                 g.setFont(font1);
  156.                 g.setColor(color3);
  157.                 g.drawString("Time elapsed: " + timeElapsed, 22, 266);
  158.                 g.drawString("Experience gained: " + ExpGained, 22, 283);
  159.                 g.drawString("Exp/hr: " + exphr, 22, 301);
  160. //              g.drawString("Status: " + Status, 22, 319);
  161.                 g.setFont(font2);
  162.                 g.setColor(Color.GRAY);
  163.                 g.drawString("xScotts Stun Alcher ", 37, 248);
  164.  
  165.  
  166.  
  167.                 g.setColor(Color.RED);
  168.                 g.fillOval(Mouse.getX() - 4, Mouse.getY() - 4, 7, 7);
  169.                 g.setColor(Color.ORANGE);
  170.                 g.fillOval(Mouse.getX() -3, Mouse.getY() -3, 5, 5);
  171.  
  172.         }
  173.  
  174.         private void Logout() {
  175.                 WidgetChild LogoutCross = Widgets.get(746, 194);
  176.                 WidgetChild LogoutButton = Widgets.get(182, 7);
  177.                 LogoutCross.click(true);
  178.                 Time.sleep(1000);
  179.                 LogoutButton.click(true);
  180.                 Time.sleep(1000);
  181.                 stop();
  182.         }
  183.  
  184.         private class areaCheck implements Task, Condition {
  185.                 // Check if player is in the main area.. if not.. go there.
  186.                 @Override
  187.                 public boolean validate() {
  188.                         return true;
  189.                 }
  190.  
  191.                 @Override
  192.                 public void run() {
  193.                         if (botStarted && !anyItems()) {
  194.                                 Time.sleep(500);
  195.                                 if (Players.getLocal().getInteracting() == null && !anyItems()) {
  196.  
  197.                                         // Main spider area
  198.                                         Tile topRight = new Tile(3185, 9888, Game.getPlane());
  199.                                         Tile LeftBottom = new Tile(3175, 9880, Game.getPlane());
  200.                                         Tile centerTile = new Tile(3179, 9884, Game.getPlane());
  201.                                         Area centerArea = new Area(topRight, LeftBottom);
  202.  
  203.                                         if (!centerArea.contains(Players.getLocal().getLocation())) {
  204.                                                 Walking.walk(centerTile);
  205.                                                 Time.sleep(3000);
  206.                                         }
  207.                                 }
  208.                         }
  209.                 }
  210.         }
  211.  
  212.         private class runCheck implements Task, Condition {
  213.                 @Override
  214.                 public boolean validate() {
  215.                         return true;
  216.                 }
  217.  
  218.                 @Override
  219.                 public void run() {
  220.                         if (botStarted && !anyItems()) {
  221.                                 WidgetChild orb = Widgets.get(750, 3);
  222.  
  223.                                 try {
  224.                                         int runPercentage = Walking.getEnergy();
  225.                                         if (runPercentage == 100) {
  226.                                                 if (!Walking.isRunEnabled()) {
  227.                                                         // log.info("Turning runmode on");
  228.                                                         orb.interact("Turn run mode on");
  229.                                                 }
  230.                                         } else {
  231.                                                 // log.info("Running percentage = "+runPercentage);
  232.                                         }
  233.  
  234.                                 } catch (NumberFormatException nfe) {
  235.                                         log.info("Not a number exception");
  236.                                 }
  237.                         }
  238.                 }
  239.         }
  240.  
  241.         private class openInvetory implements Task, Condition {
  242.                 @Override
  243.                 public boolean validate() {
  244.                         return true;
  245.                 }
  246.  
  247.                 @Override
  248.                 public void run() {
  249.                         if (botStarted && !anyItems()) {
  250.                                 if (!Tabs.INVENTORY.open()) {
  251.                                         Tabs.INVENTORY.open();
  252.                                         Time.sleep(1000);
  253.                                 }
  254.                         }
  255.                 }
  256.         }
  257.  
  258.         private class antiBan implements Task, Condition {
  259.  
  260.                 @Override
  261.                 public boolean validate() {
  262.                         return true;
  263.                 }
  264.  
  265.                 @Override
  266.                 public void run() {
  267.                         if (botStarted && !anyItems()) {
  268.                                 int rnr = Random.nextInt(1, 600);
  269.                                 switch (rnr) {
  270.                                 case 300:
  271.                                         Camera.setAngle(Random.nextInt(200, 900));
  272.                                         break;
  273.                                 case 255:
  274.                                         WidgetChild stats1 = Widgets.get(746, 60);
  275.                                         if (!stats1.isVisible()) {
  276.                                                 stats1 = Widgets.get(548, 91);
  277.                                         }
  278.  
  279.                                         WidgetChild constitution = Widgets.get(320, 141);
  280.                                         if (!constitution.isVisible()) {
  281.                                                 constitution = Widgets.get(320, 4);
  282.                                         }
  283.  
  284.                                         // Open stats
  285.                                         stats1.click(true);
  286.                                         Time.sleep(1000);
  287.                                         // Hover constitution skill
  288.                                         constitution.hover();
  289.                                         Time.sleep(3000);
  290.  
  291.                                         break;
  292.                                 case 101:
  293.                                         WidgetChild stats2 = Widgets.get(746, 60);
  294.                                         if (!stats2.isVisible()) {
  295.                                                 stats2 = Widgets.get(548, 91);
  296.                                         }
  297.  
  298.                                         WidgetChild attack = Widgets.get(320, 9);
  299.                                         if (!attack.isVisible()) {
  300.                                                 attack = Widgets.get(320, 2);
  301.                                         }
  302.  
  303.                                         // Open stats
  304.                                         stats2.click(true);
  305.                                         Time.sleep(1000);
  306.                                         // Hover constitution skill
  307.                                         attack.hover();
  308.                                         Time.sleep(3000);
  309.  
  310.                                         break;
  311.                                 case 58:
  312.                                         Camera.setPitch(false);
  313.                                         Time.sleep(1000);
  314.                                         Camera.setPitch(false);
  315.                                         Time.sleep(500);
  316.                                         Camera.setPitch(false);
  317.                                         Time.sleep(500);
  318.                                         Camera.setPitch(true);
  319.                                         Time.sleep(1000);
  320.                                         Camera.setPitch(true);
  321.                                         Time.sleep(500);
  322.                                         Camera.setPitch(true);
  323.                                 }
  324.                         }
  325.                 }
  326.  
  327.         }
  328.  
  329.         private class moveCameraUp implements Task, Condition {
  330.                 @Override
  331.                 public boolean validate() {
  332.                         return true;
  333.                 }
  334.  
  335.                 @Override
  336.                 public void run() {
  337.                         if (botStarted) {
  338.                                 if (cameraChanged == false) {
  339.                                         Camera.setPitch(true);
  340.                                         Time.sleep(2000);
  341.                                         Camera.setPitch(true);
  342.                                         Time.sleep(500);
  343.                                         Camera.setPitch(true);
  344.                                         cameraChanged = true;
  345.                                 }
  346.                         }
  347.                 }
  348.         }
  349.  
  350.         private class Heal implements Task, Condition {
  351.  
  352.                 @Override
  353.                 public boolean validate() {
  354.                         return true;
  355.                 }
  356.  
  357.                 @Override
  358.                 public void run() {
  359.                         if (botStarted) {
  360.                                 int[] foodArray = { 13433, 319, 7178, 7180, 315, 2140, 2142,
  361.                                                 325, 2309, 347, 355, 333, 339, 351, 329, 361, 1891,
  362.                                                 1893, 1895, 1897, 1899, 1901, 379, 365, 373, 6705,
  363.                                                 7946, 2293, 2299, 383, 15266, 397, 2301, 2303, 391,
  364.                                                 7060, 7208, 7210, 7218, 7220, 15272, 385 };
  365.                                 boolean itemFound = false;
  366.  
  367.                                 try {
  368.                                         // Get current HP
  369.                                         WidgetChild health = Widgets.get(748).getChild(8);
  370.                                         int healthTotal = Integer.parseInt(health.getText());
  371.  
  372.                                         if (healthTotal < 190) {
  373.                                                 // Read inventory
  374.                                                 for (int inv = 0; inv < Inventory.getItems().length; inv++) {
  375.                                                         // See if item is food
  376.                                                         Item Item = Inventory.getItems()[inv];
  377.  
  378.                                                         for (int i = 0; i < foodArray.length; i++) {
  379.                                                                 if (foodArray[i] == Item.getId()) {
  380.                                                                         itemFound = true;
  381.                                                                         break;
  382.                                                                 }
  383.                                                         }
  384.  
  385.                                                         if (itemFound == true) {
  386.                                                                 // Eat
  387.                                                                 // log.info(""+Item.getWidgetChild().getId());
  388.                                                                 Item.getWidgetChild().interact("Eat");
  389.                                                                 Time.sleep(2500);
  390.                                                                 break;
  391.                                                         }
  392.  
  393.                                                 }
  394.  
  395.                                                 if (itemFound == false) {
  396.                                                         // Get food from bank.
  397.                                                         log.info("Running away -> then log out! you're outa food!!");
  398.  
  399.                                                         WidgetChild orb = Widgets.get(750, 3);
  400.  
  401.                                                         if (!Walking.isRunEnabled()) {
  402.                                                                 // log.info("Turning runmode on");
  403.                                                                 orb.interact("Turn run mode on");
  404.                                                         }
  405.  
  406.                                                         if (Walking.isRunEnabled()) {
  407.                                                                 Walking.walk(new Tile(3188, 9888, Game
  408.                                                                                 .getPlane()));
  409.                                                                 Time.sleep(4000);
  410.                                                                 Walking.walk(new Tile(3203, 9888, Game
  411.                                                                                 .getPlane()));
  412.                                                                 Time.sleep(4000);
  413.                                                                 Walking.walk(new Tile(3205, 9880, Game
  414.                                                                                 .getPlane()));
  415.                                                                 Time.sleep(4000);
  416.                                                         } else {
  417.                                                                 Walking.walk(new Tile(3188, 9888, Game
  418.                                                                                 .getPlane()));
  419.                                                                 Time.sleep(7000);
  420.                                                                 Walking.walk(new Tile(3203, 9888, Game
  421.                                                                                 .getPlane()));
  422.                                                                 Time.sleep(6000);
  423.                                                                 Walking.walk(new Tile(3205, 9880, Game
  424.                                                                                 .getPlane()));
  425.                                                                 Time.sleep(5000);
  426.                                                         }
  427.                                                         Logout();
  428.                                                 }
  429.                                         }
  430.  
  431.                                 } catch (NumberFormatException nfe) {
  432.                                         log.info("Not a number exception");
  433.                                 }
  434.  
  435.                         }
  436.                 }
  437.  
  438.         }
  439.  
  440.         public boolean anyItems() {
  441.                 GroundItem charm = GroundItems.getNearest(new Filter<GroundItem>() {
  442.                         @Override
  443.                         public boolean accept(GroundItem arg0) {
  444.                                 int foundItem = arg0.getGroundItem().getId();
  445.                                 int iGoldCharm = 12158; // Gold Charm
  446.                                 int iGreenCharm = 12159; // Green Charm
  447.                                 int iCrimsonCharm = 12160; // Crimson Charm
  448.                                 int iBlueCharm = 12163; // Blue Charm
  449.  
  450.                                 if (iGoldCharm == foundItem || iGreenCharm == foundItem
  451.                                                 || iCrimsonCharm == foundItem
  452.                                                 || iBlueCharm == foundItem) {
  453.                                         return true;
  454.                                 } else {
  455.                                         return false;
  456.                                 }
  457.                         }
  458.                 });
  459.  
  460.                 if (charm != null && pickUpCharms) {
  461.                         return true;
  462.                 } else {
  463.                         return false;
  464.                 }
  465.         }
  466.  
  467.         private class Take implements Task, Condition {
  468.  
  469.                 @Override
  470.                 public boolean validate() {
  471.                         return true;
  472.                 }
  473.  
  474.                 @Override
  475.                 public void run() {
  476.                         if (botStarted && pickUpCharms) {
  477.                                 if (Players.getLocal().getInteracting() == null) {
  478.                                         // If player is free -> look for charms.
  479.                                         GroundItem charm = GroundItems
  480.                                                         .getNearest(new Filter<GroundItem>() {
  481.                                                                 @Override
  482.                                                                 public boolean accept(GroundItem arg0) {
  483.                                                                         int foundItem = arg0.getGroundItem()
  484.                                                                                         .getId();
  485.                                                                         int iGoldCharm = 12158; // Gold Charm
  486.                                                                         int iGreenCharm = 12159; // Green Charm
  487.                                                                         int iCrimsonCharm = 12160; // Crimson Charm
  488.                                                                         int iBlueCharm = 12163; // Blue Charm
  489.  
  490.                                                                         if (iGoldCharm == foundItem
  491.                                                                                         || iGreenCharm == foundItem
  492.                                                                                         || iCrimsonCharm == foundItem
  493.                                                                                         || iBlueCharm == foundItem) {
  494.                                                                                 return true;
  495.                                                                         } else {
  496.                                                                                 return false;
  497.                                                                         }
  498.                                                                 }
  499.                                                         });
  500.  
  501.                                         if (charm != null) {
  502.                                                 if (Calculations.distance(Players.getLocal()
  503.                                                                 .getLocation(), charm.getLocation()) > 4) {
  504.                                                         Walking.walk(charm.getLocation());
  505.                                                         Time.sleep(2000);
  506.                                                 }
  507.  
  508.                                                 charm.interact("Take");
  509.                                                 Time.sleep(2500);
  510.                                         }
  511.                                 } else {
  512.                                         // Skip this.
  513.                                 }
  514.                         }
  515.                 }
  516.         }
  517.  
  518.         private class Attack implements Task, Condition {
  519.  
  520.                 @Override
  521.                 public boolean validate() {
  522.                         return true;
  523.                 }
  524.  
  525.                 @Override
  526.                 public void run() {
  527.                         if (botStarted && !anyItems()) {
  528.                                 if (Players.getLocal().getInteracting() == null) {
  529.                                         NPC RDS = NPCs.getNearest(new Filter<NPC>() {
  530.                                                 @Override
  531.                                                 public boolean accept(NPC arg0) {
  532.                                                         int foundNpc = arg0.getId();
  533.                                                         int iRDS = 63; // Red Deadly Spider
  534.  
  535.                                                         if (foundNpc == iRDS) {
  536.                                                                 return true;
  537.                                                         } else {
  538.                                                                 return false;
  539.                                                         }
  540.                                                 }
  541.                                         });
  542.  
  543.                                         if (RDS != null) {
  544.                                                 if (RDS.isOnScreen() && RDS.getHpPercent() > 0) {
  545.                                                         // On screen and not in combat, attack
  546.                                                         // log.info("Attacking RDS...");
  547.                                                         RDS.click(true);
  548.                                                         Time.sleep(1500);
  549.                                                 }
  550.                                         } else {
  551.                                                 //
  552.                                         }
  553.                                 }
  554.                         }
  555.                 }
  556.  
  557.         }
  558.  
  559.         private void openGUI() throws InterruptedException {
  560.                 Frame gui = new GUI();
  561.                 gui.setVisible(true);
  562.         }
  563.  
  564.         class GUI extends Frame {
  565.  
  566.                 private static final long serialVersionUID = 1L;
  567.                 public BufferedImage img;
  568.                 public Button bStart, PickOn, PickOff;
  569.  
  570.                 // Frame instellingen
  571.                 public GUI() {
  572.                         addWindowListener(new VensterHandler());
  573.                         setLayout(null);
  574.  
  575.                         // Buttons
  576.                         bStart = new Button("Start");
  577.                         bStart.setSize(100, 20);
  578.                         bStart.setLocation(470, 350);
  579.                         bStart.addActionListener(new StartHandler());
  580.                         add(bStart);
  581.  
  582.                         PickOn = new Button("On");
  583.                         PickOn.setSize(40, 20);
  584.                         PickOn.setLocation(310, 155);
  585.                         PickOn.addActionListener(new PickOnHandler());
  586.                         add(PickOn);
  587.  
  588.                         PickOff = new Button("Off");
  589.                         PickOff.setSize(40, 20);
  590.                         PickOff.setLocation(360, 155);
  591.                         PickOff.addActionListener(new PickOffHandler());
  592.                         add(PickOff);
  593.  
  594.                         // Disable On button by default -> it's true already.
  595.                         PickOn.setEnabled(false);
  596.  
  597.                         // IMAGES
  598.                         try {
  599.                                 URL url = new URL(getCodeBase(),
  600.                                                 "http://www.myitemsale.co.uk/RDSK.jpg");
  601.                                 img = ImageIO.read(url);
  602.                         } catch (IOException e) {
  603.                                 // Error loading image
  604.                         }
  605.  
  606.                         // SETTINGS
  607.                         setBackground(new Color(0, 0, 0));
  608.                         setSize(600, 400);
  609.                         setResizable(false);
  610.                         setTitle("Red deadly Spider Killer - By PHP-Remco");
  611.                         setVisible(true);
  612.                 }
  613.  
  614.                 // URL fix
  615.                 private URL getCodeBase() {
  616.                         return null;
  617.                 }
  618.  
  619.                 // Graphics
  620.                 public void paint(Graphics g) {
  621.                         g.drawImage(img, 0, 0, this);
  622.                 }
  623.  
  624.                 // START BOT SCRIPT
  625.                 private class StartHandler implements ActionListener {
  626.                         public void actionPerformed(ActionEvent e) {
  627.                                 // Start script here.
  628.                                 botStarted = true;
  629.                                 dispose();
  630.                         }
  631.                 }
  632.  
  633.                 private class PickOnHandler implements ActionListener {
  634.                         public void actionPerformed(ActionEvent e) {
  635.                                 // Start script here.
  636.                                 pickUpCharms = true;
  637.                                 PickOn.setEnabled(false);
  638.                                 PickOff.setEnabled(true);
  639.                         }
  640.                 }
  641.  
  642.                 private class PickOffHandler implements ActionListener {
  643.                         public void actionPerformed(ActionEvent e) {
  644.                                 // Start script here.
  645.                                 pickUpCharms = false;
  646.                                 PickOff.setEnabled(false);
  647.                                 PickOn.setEnabled(true);
  648.                         }
  649.                 }
  650.  
  651.                 private class VensterHandler extends WindowAdapter {
  652.                         public void windowClosing(WindowEvent e) {
  653.                                 // Start script here.
  654.                                 botStarted = true;
  655.                                 dispose();
  656.                         }
  657.                 }
  658.         }
  659. }