Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package CosmicLooter;
- import org.tbot.wrappers.Tile;
- public class CosmicLooterGlobal {
- public static int[] worldList = new int[]{302, 303, 304, 305, 306, 309, 310, 311, 312, 313, 314, 318, 320, 322, 327, 328, 329, 330, 333, 334, 336, 338, 341, 342, 343, 344, 346, 350, 351, 352, 354, 357, 358, 359, 360, 362, 367, 368, 369, 370, 374, 375, 376, 377, 378, 386};
- public static String cosmicRune = new String("Cosmic rune");
- public static Tile cosmicTile = new Tile(2947, 3898, 0);
- public static Tile lumbyTile = new Tile(3220, 3219, 0);
- }
- package CosmicLooter;
- import org.tbot.bot.TBot;
- import org.tbot.methods.Game;
- public class EndScript implements Node {
- @Override
- public boolean validate() {
- // if cosmic tile > 5 or lumbytile distance is less than 20
- return CosmicLooterGlobal.cosmicTile.distance() > 5 || CosmicLooterGlobal.lumbyTile.distance() < 20 && Game.isLoggedIn();
- }
- @Override
- public void execute() {
- // end script
- TBot.getBot().getScriptHandler().stopScript();
- }
- }
- package CosmicLooter;
- import org.tbot.internal.handlers.LogHandler;
- import org.tbot.methods.Game;
- import org.tbot.methods.GroundItems;
- import org.tbot.methods.tabs.Inventory;
- import java.util.Random;
- public class Hop implements Node{
- @Override
- public boolean validate() {
- return (GroundItems.getNearest(CosmicLooterGlobal.cosmicRune) == null && Game.isLoggedIn() && Game.getGameState() == 30);
- }
- @Override
- public void execute() {
- Game.instaHop(getRandom(CosmicLooterGlobal.worldList));
- }
- public static int getRandom(int[] array) {
- int random = (new Random()).nextInt(CosmicLooterGlobal.worldList.length);
- LogHandler.log(Integer.valueOf(array[random]));
- return array[random];
- }
- }
- package CosmicLooter;
- import org.tbot.internal.AbstractScript;
- import org.tbot.internal.Manifest;
- import org.tbot.internal.ScriptCategory;
- import org.tbot.methods.Game;
- @Manifest(
- version = 1.0D,
- name = "Cosmic Script",
- description = "",
- category = ScriptCategory.MONEY_MAKING,
- authors = {"Jebbyo"}
- )
- public class Main extends AbstractScript {
- private final Node[] nodes = {new Pickup(), new EndScript()};
- @Override
- public int loop() {
- if (Game.isLoggedIn()) {
- for (Node node : nodes) {
- final Node n = node;
- if (n.validate()) {
- n.execute();
- break;
- }
- }
- }
- return 150;
- }
- }
- package CosmicLooter;
- public interface Node {
- boolean validate();
- void execute();
- }
- package CosmicLooter;
- import org.tbot.internal.handlers.LogHandler;
- import org.tbot.methods.Game;
- import org.tbot.methods.GroundItems;
- import org.tbot.methods.Time;
- import org.tbot.wrappers.GroundItem;
- import java.util.Random;
- public class Pickup implements Node {
- GroundItem rune;
- @Override
- public boolean validate() {
- if(GroundItems.getNearest(CosmicLooterGlobal.cosmicRune) == null && Game.isLoggedIn()) {
- Game.instaHop(getRandom(CosmicLooterGlobal.worldList));
- Time.sleep(1000,2000);
- }
- return GroundItems.getNearest(CosmicLooterGlobal.cosmicRune) != null;
- }
- @Override
- public void execute() {
- if (GroundItems.getNearest(CosmicLooterGlobal.cosmicRune) != null) {
- this.rune = GroundItems.getNearest(CosmicLooterGlobal.cosmicRune);
- if (this.rune != null && rune.isOnScreen()) {
- this.rune.interact("Take " + this.rune.getName());
- Time.sleep(600, 1200);
- }
- }
- }
- public static int getRandom(int[] array) {
- int random = (new Random()).nextInt(CosmicLooterGlobal.worldList.length);
- LogHandler.log(Integer.valueOf(array[random]));
- return array[random];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement