Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Color;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.wrappers.RSWeb;
- @ScriptManifest(
- authors = ("Qubiz"),
- version = 1.06,
- keywords = {"Qubiz", "Cosmic", "Runes", "Runecrafting"},
- description = "Crafts cosmic runes. Made by Qubiz.",
- name = "qCosmicCrafter")
- /* What does this bot do:
- *
- * The bot walks to the cosmic altar to craft cosmic runes (eventually by using pouches), and then banks them at the local bank in Zanaris.
- * When your agility level is 1 to 46 it will use the normal route, when your agility level is 46 to 66 it will use the second route, when your
- * level is 66 or higher it will use the third route (fastest route).
- * It will be supporting the talisman and the tiara.
- * The bot should stop when all of the pure essence is used, or when the user stops the bot (obviously).
- *
- */
- public class qCosmicCrafter extends Script {
- ////////////Variables////////////
- //items//
- int cosmicID = 564;
- int cosmicTiaraID = 5539;
- int cosmicTalismanID = 1454;
- int pureEssID = 7936;
- //objects//
- int cosmicAltarOutsideID = 2458;
- int cosmicAltarInsideID = 2484;
- int boothID = 52589;
- int portalID = 2471;
- RSObject altar = objects.getNearest(cosmicAltarOutsideID);
- //tiles//
- RSTile altarTile = new RSTile(2407,4379,0);
- RSTile insideAltarTile = new RSTile (0,0,0);
- RSTile bankTile = new RSTile(2381,4458,0);
- //time//
- long startTime;
- /////////////////////////////////
- public boolean onStart() {
- log("The bot started doing his stuff!");
- startTime = System.currentTimeMillis();
- return true;
- }
- private boolean atBank() {
- RSObject bank = objects.getNearest(boothID);
- if (bank.isOnScreen()) {
- return true;
- } else { return false; }
- }
- private boolean atAltar() {
- if (altar.isOnScreen()) {
- return true;
- } else { return false; }
- }
- private void useAltar() {
- if (altar.isOnScreen()) {
- altar.doClick();
- }
- }
- private void bank() {
- if(inventory.contains(cosmicID) && atBank() == true) {
- bank.open();
- if (bank.isOpen()) {
- sleep(50);
- bank.depositAll();
- sleep(random(1000, 1500));
- bank.close();
- }
- }
- }
- private void setRun() {
- if (walking.getEnergy()> random(30,100)) {
- walking.setRun(true);
- sleep(random(700,800));
- }
- }
- private void walkToAltar() {
- if (inventory.contains(pureEssID) && atBank() == true) {
- RSWeb walkWeb = web.getWeb(altarTile);
- if (walkWeb != null && !walkWeb.finished()) {
- walkWeb.step();
- if (calc.distanceTo(altarTile) <= 6) {
- useAltar();
- }
- }
- }
- }
- private void walkToBank() {
- if (inventory.contains(cosmicID) && atAltar() == true) {
- RSWeb walkWeb = web.getWeb(bankTile);
- if (walkWeb != null && !walkWeb.finished()) {
- walkWeb.step();
- if (calc.distanceTo(bankTile) <= 6) {
- bank();
- }
- }
- }
- }
- @Override
- public int loop() {
- walkToBank();
- return random(300, 500);
- }
- public void onFinish() {
- log("The bot finished doing his stuff.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement