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;
- @ScriptManifest(authors = "Test", name = "test", version = 1.0, description = "Test")
- public class TestScript extends Script {
- int[] WillowTreeID = { 5551, 5552, 5553 };
- int[] HatchetID = { 1351, 1355, 1349, 1353, 1361, 1357, 1359, 6739 };
- int[] StoreKeeperID = { 530, 531};
- int Willowlog = 1519;
- RSTile[] willowsToStore = { new RSTile(2969, 3195),
- new RSTile(2962, 3205), new RSTile(2954, 3210),
- new RSTile(2947, 3215)};
- RSTile[] StoreToWillows = {new RSTile(2947, 3215), new RSTile(2954, 3210),
- new RSTile(2962, 3205), new RSTile(2969, 3195),};
- public boolean onStart() {
- log("Powned by piepoloo!");
- return true;
- }
- private void ChopWillow() {
- log("Lets Chop");
- RSObject willow = objects.getNearest(WillowTreeID);
- if (willow != null && getMyPlayer().getAnimation() == -1) {
- willow.doAction("Chop");
- sleep(200, 600);
- }
- }
- // private void dropOre() {
- // inventory.dropAllExcept(pickID);
- // }
- private boolean WalkToStore() {
- RSTile[] randomizedPath = walking.randomizePath(willowsToStore, 2, 2);
- return walking.walkPathMM(randomizedPath);
- }
- private boolean WalkToWillows(){
- RSTile[] randdomizedPath = walking.randomizePath(StoreToWillows, 4, 4);
- return walking.walkPathMM(randdomizedPath);
- }
- private boolean atWillows() {
- RSArea area = new RSArea(new RSTile(2966, 3190), new RSTile(2976, 3200));
- return (area.contains(getMyPlayer().getLocation()));
- }
- private boolean atStore() {
- RSArea area = new RSArea(new RSTile(2947, 3212), new RSTile(2950, 3217));
- return area.contains(getMyPlayer().getLocation());
- }
- private void openStore() {
- RSObject StoreKeeper = objects.getNearest(StoreKeeperID);
- if (StoreKeeper != null && !store.isOpen()) {
- StoreKeeper.doClick(false);
- StoreKeeper.doAction("rade");
- }
- }
- private void SellWillow() {
- if (store.isOpen()) {
- mouse.click(581, 265, 5, 5, false);
- menu.doAction("Sell 50");
- sleep(200, 500);
- }
- }
- private void closeStore() {
- if (store.isOpen()) {
- mouse.move(487, 20, 3, 3);
- sleep(200, 500);
- WalkToWillows();
- }
- }
- private void Sell() {
- openStore();
- SellWillow();
- closeStore();
- }
- public void onFinish() {
- log("Thanks 4 using this script :)");
- }
- public int loop() {
- if (atWillows() && inventory.isFull()) {
- log("walk to store");
- WalkToStore();
- } else if (atStore() && inventory.isFull()) {
- log("lets sell this shit!");
- Sell();
- } else if (atWillows() && !inventory.isFull()) {
- log("lets try to cut some willow!");
- ChopWillow();
- }
- return (random(650, 950));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement