Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import java.awt.event.KeyEvent;
- import java.util.Map;
- import org.rsbot.script.methods.Skills;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.wrappers.RSWeb;
- @ScriptManifest(authors = "CravenKnight", name = "ckMagicGlass", version = 1.0, description = "Hahaha")
- public class KNatureCrafter extends Script {
- RSTile Bank = new RSTile(2852, 2954);
- RSTile innerGateTile = new RSTile(2866, 2952);
- RSTile outerGateTile = new RSTile(2880,2952);
- RSTile altarTile = new RSTile(2868, 3017);
- RSTile exitPortalTile = new RSTile(2400, 4835);
- int natureRuneID = 561;
- int pureEssID = 7936;
- int gate1ID = 2261;
- int gate2ID = 2259;
- int cartID = 2216;
- int outerAltarID = 2460;
- int innerAltarID = 2486;
- int exitPortalID = 2473;
- int mosolRei = 500;
- public boolean onStart()
- {
- log("Welcome to the Test.");
- return true;
- }
- private void doDeposit()
- {
- log("doing banking");
- bank.open();
- bank.depositAll();
- sleep(random(100, 350));
- bank.withdraw(natureRuneID, 28);
- sleep(random(50, 200));
- bank.close();
- sleep(random(100, 350));
- walkToGate();
- }
- private void walkToGate()
- {
- RSWeb pitPath = web.getWeb(getMyPlayer().getLocation(), innerGateTile);
- log("walking to pit");
- if (pitPath != null)
- {
- pitPath.step();
- }
- if (calc.distanceTo(walking.getDestination()) <=3)
- {
- openGate();
- }
- }
- private void openGate()
- {
- RSObject gate1 = objects.getNearest(gate1ID);
- gate1.doAction("Open");
- sleep(random(1000, 2500));
- RSObject gate2 = objects.getNearest(gate2ID);
- gate2.doAction("Open");
- sleep(random(1000, 2500));
- RSObject cart = objects.getNearest(cartID);
- cart.doAction("Search");
- sleep(random(1000, 2000));
- }
- private void walkToAltar()
- {
- RSWeb pitPath = web.getWeb(getMyPlayer().getLocation(), altarTile);
- log("walking to pit");
- if (pitPath != null)
- {
- pitPath.step();
- }
- if (calc.distanceTo(walking.getDestination()) <=3)
- {
- enterAltar();
- }
- }
- private void enterAltar()
- {
- RSObject outerAltar = objects.getNearest(outerAltarID);
- outerAltar.doClick();
- sleep(random(1500,2500));
- camera.setPitch(false);
- sleep(random(450,800));
- RSObject innerAltar = objects.getNearest(innerAltarID);
- innerAltar.doAction("Craft-rune");
- sleep(random(3000,4000));
- camera.setPitch(true);
- sleep(random(450,800));
- walkToExit();
- }
- private void walkToExit()
- {
- RSWeb pitPath = web.getWeb(getMyPlayer().getLocation(), exitPortalTile);
- log("walking to pit");
- if (pitPath != null)
- {
- pitPath.step();
- }
- if (calc.distanceTo(walking.getDestination()) <=2)
- {
- RSObject exitPortal = objects.getNearest(exitPortalID);
- exitPortal.doAction("Enter");
- sleep(random(2000,2500));
- walkToOuterGate();
- }
- }
- private void walkToOuterGate()
- {
- RSWeb pitPath = web.getWeb(getMyPlayer().getLocation(), outerGateTile);
- log("walking to pit");
- if (pitPath != null)
- {
- pitPath.step();
- }
- if (calc.distanceTo(walking.getDestination()) <=3)
- {
- enterVillage();
- }
- }
- private void enterVillage()
- {
- RSNPC rei = npcs.getNearest(mosolRei);
- rei.doAction("Talk-to");
- interfaces.clickContinue();
- sleep(random(400,850));
- interfaces.clickContinue();
- sleep(random(400,850));
- interfaces.clickContinue();
- sleep(random(400,850));
- mouse.click(226,406,true);
- sleep(random(400,850));
- interfaces.clickContinue();
- sleep(random(400,850));
- walkToBank();
- }
- private void walkToBank()
- {
- RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), Bank);
- log("walking to bank.");
- if (walkWeb != null)
- {
- walkWeb.step();
- }
- if (calc.distanceTo(walking.getDestination()) <=4)
- {
- doDeposit();
- }
- }
- public void onFinish()
- {
- log("Thank you for using Test.");
- }
- @Override
- public int loop() {
- return (random(2000, 3000));
- }
- }
Add Comment
Please, Sign In to add comment