Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 13th, 2010 | Syntax: Java | Size: 1.10 KB | Hits: 79 | Expires: Never
Copy text to clipboard
  1. import impsoft.bots.ColorBot;
  2. import impsoft.scripting.ibot.builtin.itemrec.ItemSlot;
  3. import impsoft.scripting.types.ColorScript;
  4.  
  5. import java.util.logging.Level;
  6. import java.util.logging.Logger;
  7.  
  8. public class threadTest extends ColorScript {
  9.  
  10.     public threadTest(ColorBot c) {
  11.         super(c);
  12.     }
  13.  
  14.     public void script() throws InterruptedException, Exception {
  15.         eatThread.run();
  16.  
  17.         while (true) {
  18.             sleep(1000);
  19.         }
  20.     }
  21.     Thread eatThread = new Thread() {
  22.  
  23.         public void run() {
  24.             setPriority(MAX_PRIORITY);
  25.             setName("AutoEat");
  26.  
  27.             while (true) {
  28.                 try {
  29.                     while (theMiniMapIndicators.getHealthPoints() < 80) {
  30.                         ItemSlot foodName = theTabs.Inventory.findItemSlot("Tuna");
  31.                         mouseClickLeft(foodName.getArea());
  32.                     }
  33.                 } catch (InterruptedException ex) {
  34.                     Logger.getLogger(threadTest.class.getName()).log(Level.SEVERE, null, ex);
  35.                 }
  36.             }
  37.         }
  38.     };
  39. }