Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.scripts;
- import com.kbot2.scriptable.Script;
- import com.kbot2.scriptable.methods.wrappers.*;
- public class EssenceMiner extends Script {
- /*Path*/
- Tile[] fromBanktoMiddle = {new Tile(3253, 3420), new Tile(3258, 3410)};
- Tile[] fromMiddletoAubury = {new Tile(3258, 3410), new Tile(3253, 3401)};
- Tile[] fromAuburytoBank = {new Tile(3253, 3401), new Tile(3258, 3410), new Tile(3253, 3420)};
- /*Define*/
- NPC aubury;
- Obj essence;
- Obj port;
- Obj b;
- /*ID's*/
- int AUBURY_ID = 553;
- final int ESSENCE_ID = 2491;
- int PORTAL_ID = 2492;
- int BANK_ID = 11402;
- int status = 0;
- @Override
- public boolean active() {
- return true;
- }
- public String getName() {
- return "EssenceMiner";
- }
- @Override
- public String getAuthor() {
- return "SuperTaranta";
- }
- @Override
- public String getDescription() {
- return "Essence Miner";
- }
- @Override
- public boolean onStart() {
- log("Starting SuperTaranta's GayClub");
- return true;
- }
- public int loop() {
- if (!isLoggedIn()) {
- return random(1000, 1100);
- }
- if(walking.getEnergy() > 30)
- walking.setRunning(true);
- switch (status) {
- case 0:
- if (inventory.isFull()) {
- status = 6;
- } else {
- status = 1;
- }
- return random(300, 500);
- case 1:
- // From Bank To Aubury
- log("Walking from Bank to Middle");
- walking.walkPath(fromBanktoMiddle);
- while(getMyPlayer().isMoving())
- sleep(100);
- status = 2;
- return random(150, 300);
- case 2:
- // From Bank To Aubury
- log("Walking from Middle to Aubury");
- walking.walkPath(fromMiddletoAubury);
- while(getMyPlayer().isMoving())
- sleep(100);
- status = 3;
- return random(150, 300);
- case 3:
- //Teleport
- aubury = npcs.getClosest(20, AUBURY_ID);
- log("Teleporting");
- if (aubury != null) {
- aubury.doAction("Teleport");
- sleep(100);
- status = 2;
- } else {
- status = 4;
- return random(150,300);
- }
- case 4:
- //Find and Mine the Essence
- log("Looking and Mining Essence");
- essence = objects.getClosestObject(10, ESSENCE_ID);
- if (essence != null) {
- essence.doAction("Mine");
- if(inventory.isFull()){
- sleep(100);
- status = 5;
- }
- } else {
- log("Shit can't find ess");
- //whatever you want to do to find ess
- walking.objects.getClosestObject(30, ESSENCE_ID);
- sleep(100);
- return random(150, 300);
- }
- case 5:
- //Find Portal
- port = objects.getClosestObject(15, PORTAL_ID);
- log("Inventory full, looking for portal");
- if (inventory.isFull()) {
- port.doAction("Use");
- status = 6;
- } else {
- status = 4;
- return random(150, 300);
- }
- case 6:
- // From Aubury To Bank
- log("Walking from Aubury to Bank");
- walking.walkPath(fromAuburytoBank);
- while(getMyPlayer().isMoving())
- sleep(100);
- status = 7;
- return random(150, 300);
- case 7:
- // Check Bank
- b = getClosestObject(7, BANK_ID);
- log("Checking/Opening Bank");
- while (!bank.isOpen()) {
- if (b != null)
- b.doAction("Use-quickly");
- sleep(750, 1000);
- }
- status = 8;
- return random(150, 300);
- case 8:
- // Banking
- log("Banking");
- if (!bank.isOpen()) {
- status = 7;
- return 100;
- }
- while (inventory.getCount() > 1) {
- bank.depositAll(1436);
- }
- bank.close();
- sleep(350, 500);
- if (bank.isOpen())
- bank.close();
- status = 0;
- return random(150, 300);
- }
- return random(100, 300);
- }
- }
Add Comment
Please, Sign In to add comment