Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Map;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.methods.Walking;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTilePath;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.script.methods.Methods;
- import org.rsbot.script.methods.Bank;
- import org.rsbot.script.util.Timer;
- @ScriptManifest(authors = "WADIE", name = "OnionPick", version = 1.0, description = "Picks Onions")
- public class OnionPick extends Script {
- int[] OnionID = { 3366 };
- int[] BankdepositboxID = { 9398 };
- RSTile[] ftbank = { new RSTile(2957,3254), new RSTile(2968,3258), new RSTile(2976,3267), new RSTile(2980,3280), new RSTile(2988,3288), new RSTile(2998,3294), new RSTile(3004,3305), new RSTile(3006,3319), new RSTile(3006,3331), new RSTile(3006,3343), new RSTile(3006,3354), new RSTile(3012,3357)};
- RSTile[] btfield = { new RSTile(3009,3346), new RSTile(3007,3334), new RSTile(3007,3318), new RSTile(3005,3304), new RSTile(2996,3292), new RSTile(2984,3284), new RSTile(2976,3271), new RSTile(2968,3258), new RSTile(2954,3254)};
- public boolean onStart() {
- log("Lets Pick Some Onions");
- return true;
- }
- private boolean patharea(){
- RSArea area = new RSArea(new RSTile(2959, 3248), new RSTile(3021, 3359));
- return area.contains(getMyPlayer().getLocation());
- }
- private boolean atarea(){
- RSArea area = new RSArea(new RSTile(2943, 3243), new RSTile(3024, 3360));
- return area.contains(getMyPlayer().getLocation());
- }
- private boolean atBank(){
- RSArea area = new RSArea(new RSTile(3018, 3355), new RSTile(3010, 3358));
- return area.contains(getMyPlayer().getLocation());
- }
- private boolean atfield(){
- RSArea area = new RSArea(new RSTile(2955, 3255), new RSTile(2945, 3255));
- return area.contains(getMyPlayer().getLocation());
- }
- private void pickOnions() {
- RSObject onion = objects.getNearest(OnionID);
- onion.doAction("Pick");
- }
- private void dobank() {
- RSObject Bankdepositbox = objects.getNearest(BankdepositboxID);
- Bankdepositbox.doAction("Deposit");
- sleep (2200, 2400);
- mouse.move(348, 278, 4, 4);
- mouse.click(true);
- sleep (400, 600);
- mouse.move(433, 42, 4, 4);
- mouse.click(true);
- sleep (700, 1000);
- }
- public void onFinish() {
- log("Thanks For Using");
- }
- private boolean walktobank() {
- RSTile[] randomizedPath = walking.randomizePath(ftbank, 0, 0);
- return walking.walkPathMM(randomizedPath, 0);
- }
- private void banking(){
- walktobank() ;
- if (atBank())
- dobank();
- }
- private boolean walktofield() {
- RSTile[] reversedPath = walking.reversePath(ftbank);
- RSTile[] randomizedPath = walking.randomizePath(reversedPath,
- 0, 0);
- return walking.walkPathMM(randomizedPath);
- }
- public int loop() {
- if (atfield() && inventory.isFull()) {
- walktobank();
- } else if (atBank() && inventory.isFull()) {
- dobank();
- } else if(atBank() && !inventory.isFull()) {
- walktofield();
- } else if (atfield() && !inventory.isFull()) {
- pickOnions();
- }
- return (random(1550, 1650));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement