Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import java.util.Map;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.script.methods.Magic;
- import org.rsbot.script.methods.Walking;
- import org.rsbot.script.methods.Game;
- import org.rsbot.script.methods.Camera;
- @ScriptManifest(authors = "Komatose", name = "The Chair Master", version = 1.0, description = "Power constructs chairs in a player owned house.")
- public class theChairMaster extends Script
- {
- boolean buildMode = false;
- boolean inHouse = false;
- //int[] bankerID = {6533, 6535};
- int oakPlankID = 8778;
- int[] blankChairID = {15411, 15412, 15410};
- int builtChairID = 13584;
- //saw, hammer, law, fire, earth, air
- int[] noDepositID = {8794, 2347, 563, 554, 557, 556};
- RSTile walkToGE = new RSTile(3165, 3487);
- public boolean onStart()
- {
- log("CHAIR MASTER ENGUAGE!");
- return true;
- }
- public void onFinish()
- {
- log("Thank you for using the Chair Master!");
- }
- private void setBuildOn()
- {
- sleep(5000, 7500);
- log("Turning build mode on.");
- game.openTab(12);
- sleep(200, 500);
- mouse.move(699, 429, 3, 3);
- sleep(200, 500);
- mouse.click(true);
- sleep(500, 1200);
- mouse.move(580, 269, 3, 3);
- sleep(200, 500);
- mouse.click(true);
- buildMode = true;
- }
- private void teleport()
- {
- if (!atGrandExchange())
- {
- log("Teleporting to Varrock.");
- magic.castSpell(40);
- game.openTab(4);
- inHouse = false;
- }
- else if (atGrandExchange())
- {
- log("Teleporting to your house.");
- magic.castSpell(48);
- game.openTab(4);
- }
- }
- /**private boolean atHouse()
- {
- RSArea area = new RSArea(new RSTile(8396, 2190), new RSTile(8410, 2201));
- return area.contains(getMyPlayer().getLocation());
- }*/
- private boolean atGrandExchange()
- {
- RSArea area = new RSArea(new RSTile(3157, 3462), new RSTile(3174, 3492));
- return area.contains(getMyPlayer().getLocation());
- }
- private boolean walkToBank()
- {
- log("Walking to the bank.");
- return walking.walkTo(walkToGE);
- }
- private void walkInHouse()
- {
- log("Walking into your house.");
- camera.setNorth();
- camera.setPitch(true);
- sleep(1000, 2500);
- mouse.move(628, 59, 2, 2);
- sleep(200, 500);
- mouse.click(true);
- sleep(4000, 6000);
- inHouse = true;
- }
- private void makeChair()
- {
- log("Making a chair.");
- RSObject blankChair = objects.getNearest(blankChairID);
- if (blankChair != null && getMyPlayer().getAnimation() == -1)
- {
- blankChair.doAction("Build");
- sleep(2000, 4000);
- mouse.move(112, 270, 3, 3);
- sleep(200, 500);
- mouse.click(true);
- sleep(1000, 2000);
- }
- }
- private void removeChair()
- {
- log("Removing a chair.");
- RSObject builtChair = objects.getNearest(builtChairID);
- if (builtChair != null && getMyPlayer().getAnimation() == -1)
- {
- builtChair.doAction("Remove");
- sleep(1000, 2000);
- mouse.move(261, 404, 5, 3);
- sleep(200, 500);
- mouse.click(true);
- sleep(1000, 2000);
- }
- }
- private void openBank()
- {
- log("Opening bank.");
- bank.open();
- sleep(500, 1500);
- }
- private void withdrawPlanks()
- {
- log("Withdrawing planks.");
- if(bank.isOpen())
- {
- bank.withdraw(oakPlankID, 22);
- sleep(200, 500);
- }
- sleep(500, 1500);
- }
- private void closeBank()
- {
- log("Closing the bank.");
- if(bank.isOpen())
- {
- mouse.move(490, 36, 3, 3);
- sleep(200, 500);
- mouse.click(true);
- }
- sleep(500, 1500);
- }
- private void bank()
- {
- openBank();
- withdrawPlanks();
- closeBank();
- }
- @Override
- public int loop()
- {
- if (!buildMode)
- {
- log("Calling setBuildOn method.");
- setBuildOn();
- }
- else if ( !atGrandExchange() && !inventory.contains(oakPlankID) )
- {
- log("Calling teleport to varrock method.");
- teleport();
- }
- else if ( atGrandExchange() && !inventory.contains(oakPlankID) )
- {
- log("Calling banking method.");
- walkToBank();
- bank();
- }
- else if( atGrandExchange() && inventory.contains(oakPlankID) )
- {
- log("Calling teleport to house method.");
- teleport();
- }
- else if ( !atGrandExchange() && inventory.contains(oakPlankID) )
- {
- log("Calling building methods.");
- if (!inHouse)
- {
- walkInHouse();
- }
- else if (inHouse)
- {
- makeChair();
- sleep(2200, 4200);
- removeChair();
- }
- }
- return random(1650, 3500);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement