Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.wrappers.RSTilePath;
- @ScriptManifest(authors = { "Snotboy808" }, version = 1.00, keywords = { "Clay Softener" }, description = "Start In Varrock East Bank.", name = "ClaySoftener")
- public class ClaySoftener extends Script {
- // ID's
- int clay = 434;
- int softClay = 1761;
- int bucket = 1925;
- int filledBucket = 1929;
- int fountainID = 24214;
- RSObject fountain;
- // Tiles
- RSTile[] TilesToFountain = { new RSTile(3253, 3421),
- new RSTile(3245, 3430), new RSTile(3240, 3434) };
- RSTilePath PathToFountain;
- RSTilePath PathToBank;
- // Path 1 void
- public void PathToFountain() {
- PathToFountain.traverse();
- }
- // Path 2 void
- public void PathToBank() {
- PathToFountain.reverse();
- }
- // Areas
- RSArea fountainArea = new RSArea(new RSTile(3236, 3431), new RSTile(3241,
- 3438));
- RSArea bankArea = new RSArea(new RSTile(3246, 3413), new RSTile(3261, 3426));
- public boolean onStart() {
- mouse.setSpeed(random(6, 8));
- PathToFountain = walking.newTilePath(TilesToFountain);
- PathToBank = walking.newTilePath(TilesToFountain).reverse();
- log("Enjoy :D");
- return true;
- }
- // Different Situations
- public boolean case1() {
- if (bankArea.contains(getMyPlayer().getLocation())) {
- return true;
- }
- return false;
- }
- public boolean case2() {
- if (!bankArea.contains(getMyPlayer().getLocation())) {
- return true;
- }
- return false;
- }
- public boolean case3() {
- if (fountainArea.contains(getMyPlayer().getLocation())) {
- return true;
- }
- return false;
- }
- public boolean case4() {
- if (!fountainArea.contains(getMyPlayer().getLocation())) {
- return true;
- }
- return false;
- }
- // Voids
- private void doBank() {
- final RSTile[] bankTiles = bankArea.getTileArray();
- if (bankArea.contains(bankTiles)) {
- if (bank.isOpen()) {
- bank.depositAllExcept(clay, bucket);
- sleep(600, 800);
- bank.withdraw(clay, 14);
- sleep(300, 500);
- bank.close();
- } else
- bank.open();
- }
- }
- private void soften() {
- if (inventory.getCount(filledBucket) == 14
- && inventory.getCount(clay) == 14) {
- inventory.useItem(inventory.getItem(filledBucket),
- (inventory.getItem(clay)));
- sleep(1500, 1800);
- mouse.move(266, 420);
- mouse.click(256, 410, isRunning());
- }
- }
- private void fill() {
- RSObject fountain = objects.getNearest(fountainID);
- if (inventory.getCount(bucket) == 14 && inventory.getCount(clay) == 14) {
- sleep(600, 800);
- mouse.setSpeed(12);
- inventory.useItem(inventory.getItem(bucket), fountain);
- }
- sleep(2000, 2400);
- }
- public void onFinish() {
- log("Thank you for using Snotboy808's ClaySoftener");
- }
- @Override
- public int loop() {
- if (inventory.getCount(softClay) == 14 && case3()
- && inventory.getCount(bucket) == 14) {
- PathToBank();
- }
- if (inventory.getCount(softClay) == 14 && case1()
- && inventory.getCount(bucket) == 14) {
- doBank();
- }
- if (inventory.getCount(clay) == 14 && case1()
- && inventory.getCount(bucket) == 14) {
- PathToFountain();
- }
- if (inventory.getCount(softClay) == 0 && case4()
- && inventory.getCount(bucket) == 14) {
- PathToFountain();
- }
- if (inventory.getCount(clay) != 14 && case3()
- && getMyPlayer().getAnimation() == -1) {
- fill();
- soften();
- }
- return random(300, 500);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement