- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import java.awt.Point;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTile;
- @ScriptManifest(authors = "DeadlyOreo", name = "OreoFisher", version = 1.0, description = "Guild Fisher")
- public class OreoFisher extends Script {
- private int spotID=312;
- private int lobID=377;
- private int bankBoothID = 49018;
- RSTile[] toBank = { new RSTile(2598, 3420), new RSTile(2593, 3420), new RSTile(2588, 3422), new RSTile(2585, 3422) };
- RSTile[] toFish = walking.reversePath(toBank);
- RSTile fishTile = new RSTile(2598, 3420);
- RSTile bankTile = new RSTile(2585, 3422);
- public boolean onStart(){
- log("Welcome to Oreo Fisher!");
- return true;
- }
- public void catchFish(){
- RSNPC fish = npcs.getNearest(spotID);
- if (fish != null && fish.isOnScreen() == true && getMyPlayer().getAnimation() == -1){
- Point m = calc.tileToScreen(fish.getLocation());
- mouse.move(m);
- mouse.click(false);
- sleep(500,1000);
- menu.doAction("age");
- }
- }
- private boolean walkToBankFromSpots() {
- RSTile[] randomizedPath = walking.randomizePath(toBank, 2, 2);
- return walking.walkPathMM(randomizedPath, 15);
- }
- private boolean atBank(){
- RSArea area = new RSArea(new RSTile(2585, 3420), new RSTile(2587, 3423));
- return area.contains(getMyPlayer().getLocation());
- }
- private void bank(){
- openBank();
- depositFish();
- closeBank();
- }
- private boolean walkToSpotsFromBank() {
- RSTile[] randomizedPath = walking.randomizePath(toFish, 2, 2);
- return walking.walkPathMM(randomizedPath, 15);
- }
- private boolean atFishingSpots(){
- RSArea area = new RSArea(new RSTile(2006, 3425), new RSTile(2611, 3412));
- return area.contains(getMyPlayer().getLocation());
- }
- private void openBank(){
- RSObject Booth = objects.getNearest(bankBoothID);
- if (Booth != null && !bank.isOpen()) {
- Booth.doAction("uickly");
- }
- }
- private void depositFish(){
- if (bank.isOpen()) {
- bank.deposit(lobID, 0);
- sleep(200, 500);
- }
- }
- private void closeBank() {
- if(bank.isOpen()){
- mouse.move(490, 36, 3, 3);
- sleep(200, 500);
- mouse.click(true);
- }
- }
- public void onFinish(){
- log("Thank you for using Oreo Fisher!");
- }
- @Override
- public int loop() {
- if (atFishingSpots() && inventory.isFull()) {
- walkToBankFromSpots();
- } else if (atBank() && inventory.isFull()){
- bank();
- } else if (atFishingSpots() && !inventory.isFull()) {
- catchFish();
- } else if (atBank() && !inventory.isFull()){
- walkToSpotsFromBank();
- }
- return (random(650, 950));
- }
- }