Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.82 KB | None | 0 0
  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. int LobsterID = 377;
  13. int notedLobsterID = 378;
  14. 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)});
  15. Area StilesArea = new Area(new Tile(2847, 3141), new Tile(2853, 3145));
  16.  
  17. public boolean onStart() {
  18. log("Welcome");
  19. if (Game.isLoggedIn()) {
  20. log("Checking For Cage...");
  21. if (Inventory.contains(CageID)) {
  22. log("Cage Found");
  23. } else {
  24. log("Cage not found...");
  25. log("This script is not functional without a lobster cage");
  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.contains(CageID) && !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.contains(LobsterID) && !atSpot()) {
  45. return State.WALK_TO_SPOT;
  46. }
  47.  
  48. return State.WAITING;
  49. }
  50.  
  51.  
  52. @Override
  53. public int loop() {
  54. switch (getState()) {
  55. case FISHING:
  56. fish();
  57. case WALK_TO_STILES:
  58. StilesPath.traverse();
  59. case EXCHANGE:
  60. exchange();
  61. case WALK_TO_SPOT:
  62. StilesPath.reverse();
  63. }
  64.  
  65. return 590;
  66. }
  67.  
  68. public void fish() {
  69. if (Players.getLocal().getAnimation() != 619) {
  70. GameObject spot = Objects.getNearest(FishingSpot);
  71. if (spot != null) {
  72. spot.interact("Cage");
  73. }
  74. }
  75. }
  76.  
  77. boolean atStiles() {
  78. return StilesArea.contains(Players.getLocal().getLocation());
  79. }
  80.  
  81. boolean atSpot() {
  82. GameObject spot = Objects.getNearest(FishingSpot);
  83. if (spot != null) {
  84. return true;
  85. } else {
  86. return false;
  87. }
  88. }
  89.  
  90. public void exchange() {
  91. Npc stiles = Npcs.getNearest(Stiles);
  92. if (stiles != null) {
  93. stiles.interact("Exchange");
  94. }
  95. }
  96. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement