SHARE
TWEET

Untitled

a guest Jul 28th, 2017 105 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import com.rsbuddy.script.ActiveScript;
  2. import com.rsbuddy.script.Manifest;
  3. import com.rsbuddy.script.methods.*;
  4. import com.rsbuddy.script.wrappers.*;
  5.  
  6. @Manifest(name = "LobbyBoss", description = "Cages Lobsters in Karajama like a boss.", authors = "skutr3")
  7. public class LobbyBoss extends ActiveScript {
  8.  
  9.     int Stiles = 11267;
  10.     int CageID = 301;
  11.     int[] FishingSpot = {323, 324};
  12.  
  13.  
  14.     Area StilesArea = new Area(new Tile(2847, 3141), new Tile(2853, 3145));
  15.  
  16.     public boolean onStart() {
  17.         log("Welcome");
  18.         if (Game.isLoggedIn()) {
  19.             log("Checking For Cage...");
  20.             if (Inventory.contains(CageID)) {
  21.                 log("Cage Found");
  22.             } else {
  23.                 log("Cage not found...");
  24.                 log("This script is not functional without a lobster cage");
  25.                 return false;
  26.             }
  27.  
  28.         }
  29.  
  30.         return true;
  31.     }
  32.  
  33.     public enum State {
  34.         FISHING, WALK_TO_STILES, EXCHANGE, WALK_TO_SPOT, WAITING
  35.     }
  36.  
  37.     private State getState() {
  38.         if (!Inventory.isFull() && atSpot()) {
  39.             return State.FISHING;
  40.         } else if (Inventory.isFull() && !atStiles()) {
  41.             return State.WALK_TO_STILES;
  42.         } else if (Inventory.isFull() && atStiles()) {
  43.             return State.EXCHANGE;
  44.         } else if (!Inventory.isFull() && !atSpot()) {
  45.             return State.WALK_TO_SPOT;
  46.         }
  47.         log("WAITING");
  48.         return State.WAITING;
  49.     }
  50.  
  51.  
  52.     @Override
  53.     public int loop() {
  54.         switch (getState()) {
  55.             case FISHING:
  56.                 fish();
  57.                 break;
  58.             case WALK_TO_STILES:
  59.                 walkToStiles();
  60.                 break;
  61.             case EXCHANGE:
  62.                 exchange();
  63.                 break;
  64.             case WALK_TO_SPOT:
  65.                 walkToSpots();
  66.                 break;
  67.         }
  68.  
  69.         return 590;
  70.     }
  71.  
  72.     public void fish() {
  73.         Npc spot = Npcs.getNearest(FishingSpot);
  74.         if (Players.getLocal().isIdle()) {
  75.             if (spot != null) {
  76.                 if (containsAction(spot, "Cage")) {
  77.                     spot.interact("Cage");
  78.                     sleep(600, 1200);
  79.                 }
  80.             }
  81.         }
  82.     }
  83.  
  84.     boolean atStiles() {
  85.         return StilesArea.contains(Players.getLocal().getLocation());
  86.     }
  87.  
  88.     boolean atSpot() {
  89.         Npc spot = Npcs.getNearest(FishingSpot);
  90.         if (spot != null) {
  91.             return true;
  92.         } else {
  93.             return false;
  94.         }
  95.     }
  96.  
  97.     public boolean containsAction(Npc spot, String Cage) {
  98.         if (spot != null) {
  99.             for (String a : spot.getActions()) {
  100.                 if (spot != null && a.equalsIgnoreCase(Cage)) {
  101.                     return true;
  102.                 }
  103.             }
  104.         }
  105.         return false;
  106.     }
  107.  
  108.     public void exchange() {
  109.         Npc stiles = Npcs.getNearest(Stiles);
  110.         if (stiles.isOnScreen()) {
  111.             stiles.interact("Exchange");
  112.             sleep(600, 1200);
  113.         }
  114.     }
  115.  
  116.     public void walkToStiles() {
  117.         Walking.findPath(new Tile(2851, 3142)).traverse();
  118.     }
  119.  
  120.     public void walkToSpots() {
  121.         Walking.findPath(new Tile(2924, 3177)).traverse();
  122.     }
  123. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top