Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.rsbuddy.script.ActiveScript;
- import com.rsbuddy.script.Manifest;
- import com.rsbuddy.script.methods.*;
- import com.rsbuddy.script.wrappers.*;
- @Manifest(name = "LobbyBoss", description = "Cages Lobsters in Karajama like a boss.", authors = "skutr3")
- public class LobbyBoss extends ActiveScript {
- int Stiles = 11267;
- int CageID = 301;
- int[] FishingSpot = {323, 324};
- int LobsterID = 377;
- int notedLobsterID = 378;
- TilePath StilesPath = Walking.newTilePath(new Tile[]{new Tile(2924, 3178), new Tile(2914, 3172), new Tile(2900, 3170), new Tile(2887, 3164), new Tile(2876, 3157), new Tile(2864, 3148), new Tile(2854, 3143), new Tile(2851, 3142)});
- Area StilesArea = new Area(new Tile(2847, 3141), new Tile(2853, 3145));
- public boolean onStart() {
- log("Welcome");
- if (Game.isLoggedIn()) {
- log("Checking For Cage...");
- if (Inventory.contains(CageID)) {
- log("Cage Found");
- } else {
- log("Cage not found...");
- log("This script is not functional without a lobster cage");
- }
- }
- return true;
- }
- public enum State {
- FISHING, WALK_TO_STILES, EXCHANGE, WALK_TO_SPOT, WAITING
- }
- private State getState() {
- if (Inventory.contains(CageID) && !Inventory.isFull() && atSpot()) {
- return State.FISHING;
- } else if (Inventory.isFull() && !atStiles()) {
- return State.WALK_TO_STILES;
- } else if (Inventory.isFull() && atStiles()) {
- return State.EXCHANGE;
- } else if (!Inventory.contains(LobsterID) && !atSpot()) {
- return State.WALK_TO_SPOT;
- }
- return State.WAITING;
- }
- @Override
- public int loop() {
- switch (getState()) {
- case FISHING:
- fish();
- case WALK_TO_STILES:
- StilesPath.traverse();
- case EXCHANGE:
- exchange();
- case WALK_TO_SPOT:
- StilesPath.reverse();
- }
- return 590;
- }
- public void fish() {
- if (Players.getLocal().getAnimation() != 619) {
- GameObject spot = Objects.getNearest(FishingSpot);
- if (spot != null) {
- spot.interact("Cage");
- }
- }
- }
- boolean atStiles() {
- return StilesArea.contains(Players.getLocal().getLocation());
- }
- boolean atSpot() {
- GameObject spot = Objects.getNearest(FishingSpot);
- if (spot != null) {
- return true;
- } else {
- return false;
- }
- }
- public void exchange() {
- Npc stiles = Npcs.getNearest(Stiles);
- if (stiles != null) {
- stiles.interact("Exchange");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement