Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.10 KB | None | 0 0
  1. import java.awt.Graphics;
  2.  
  3. import xobot.client.callback.listeners.MessageListener;
  4. import xobot.client.callback.listeners.PaintListener;
  5. import xobot.script.ActiveScript;
  6. import xobot.script.Manifest;
  7. import xobot.script.methods.*;
  8. import xobot.script.util.Time;
  9. import xobot.script.wrappers.Path;
  10. import xobot.script.wrappers.Tile;
  11. import xobot.script.wrappers.interactive.GameObject;
  12.  
  13. @Manifest(authors = { "xBear" }, name = "monster", version = 1.0, description = "Cuts gems into Bolt Tips.")
  14.  
  15. public final class monster extends ActiveScript implements PaintListener, MessageListener {
  16.  
  17.     public boolean isAtHillGiantsLadder = false;
  18.     public boolean isAtDestination = false;
  19.  
  20.     Tile lumbridgeTile = new Tile(3221, 3219);
  21.  
  22.  
  23.     private int state = -1;
  24.  
  25.     public void walkTo() {
  26.         getState();
  27.         switch (state) {
  28.             case 1:
  29.                 //Teleport to Lumbridge
  30.                 break;
  31.  
  32.             case 2:
  33.                 //Already at Lumbridge
  34.                 break;
  35.  
  36.             case 0:
  37.                 //goHome();
  38.                 break;
  39.         }
  40.     }
  41.  
  42.     /*private void goHome() {
  43.         KeyBoard.typeWord("::home", true);
  44.         Time.sleep(2400, 3000);
  45.  
  46.     }*/
  47.  
  48.     public void getState(){
  49.  
  50.         if (NPCs.getNearest(4397) != null) {
  51.             System.out.println("Teleporting.");
  52.             state = 1;
  53.             isAtDestination = false;
  54.         } else if (Calculations.distanceTo(lumbridgeTile) < 20) {
  55.             isAtDestination = true;
  56.             System.out.println("At Lumbridge.");
  57.             state = 2;
  58.         }
  59.         else {
  60.             state = 0;
  61.             System.out.println("Teleporting home");
  62.             isAtDestination = false;
  63.         }
  64.     }
  65.  
  66.     public boolean onStart() {
  67.  
  68.         return true;
  69.     }
  70.  
  71.  
  72.  
  73.  
  74.         @Override
  75.         public void repaint(Graphics g1) {
  76.  
  77.  
  78.         }
  79.  
  80.  
  81.         @Override
  82.         public int loop() {
  83.             walkTo();
  84.  
  85.  
  86.             return 200;
  87.         }
  88.  
  89.     @Override
  90.     public void MessageRecieved(int i, String s, String s1, String s2) {
  91.  
  92.     }
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement