Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

FREE FISHING SCRIPT

Featured Replies

Yeah I was kinda upset there was nothing on the SDN for free people could use to fish for trout and salmon at edgeville/barb AND bank the fish....So I made a script really quick that does just that figured you guys might like it? I'm too lazy to upload it so if someone wants to do that go ahead. It just catches fish and banks them as opposed to power fishing. No configurable options, just does that one thing. You're welcome to those who wanted this.

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;

import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.map.Position;
import org.osbot.rs07.api.map.constants.Banks;
import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.api.model.RS2Object;
import org.osbot.rs07.api.ui.Skill;
import org.osbot.rs07.api.ui.Tab;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;


@ScriptManifest(author = "Paradox68", info = "Paradox simple Edgeville fishing script.", name = "Paradox Simple Edge Fisher", version = 1.0, logo = "")
public class main extends Script {
	private long timeStart;
	private String state = "Initializing..";
	private int invCount = 0;
	private int caught = 0;
	private int lastMA = 0;
	Area fishArea = new Area( new Position(3111,3437,0), new Position(3100,3422,0));
	Area edgeBank = new Area( new Position(3098,3499,0), new Position(3091,3488,0));
	
	
	@Override
	public void onStart() {
		getExperienceTracker().start(Skill.FISHING);
		timeStart = System.currentTimeMillis();
		
	
	}
	@Override
	public void onPaint(Graphics2D g) {
		long timeElapsed = System.currentTimeMillis() - timeStart;
		long seconds = (timeElapsed / 1000) % 60;
		long minutes = (timeElapsed / (1000 * 60)) % 60;
		long hours = (timeElapsed / (1000 * 60 * 60)) % 24;
		g.setFont(new Font("Trebuchet MS", Font.PLAIN, 14));
		g.setColor(Color.white);
		
		g.drawString("x", (int)getMouse().getPosition().getX() - 4, (int)getMouse().getPosition().getY() + 5);
		g.drawString(state, 8, 50);
		g.drawString("Time Running: " + (hours >= 10 ? "" + hours : "0" + hours) + ":" + (minutes >= 10 ? "" + minutes : "0" + minutes) + ":" + (seconds >= 10 ? "" + seconds : "0" + seconds), 8, 65);
		g.drawString("XP Gained: " + getExperienceTracker().getGainedXP(Skill.FISHING) + " (" + getExperienceTracker().getGainedLevels(Skill.FISHING) + ")", 8, 80);
		g.drawString("Fish caught: " + caught, 8, 95);
	}
	
	private void randomizeMouse() {
		lastMA++;
		if (lastMA > 4) {
			int i = random(5);
			switch (i) {
			case 0:
			case 1:
				getMouse().moveOutsideScreen();
				break;
			case 2:
				getMouse().moveRandomly();
				break;
			case 3:
				getMouse().moveSlightly();
				lastMA = 3;
				break;
			case 4:
				getMouse().moveVerySlightly();
				break;
			case 5:
				getTabs().open(randomTab());
				if (getTabs().getOpen() == Tab.SKILLS) {
					getMouse().move(704, 283);
				}
			}
			
			lastMA = 0;	
		}
	}
	
	private Tab randomTab() {
		int i = random(6);
		switch(i) {
		case 0:
		case 1:
			return Tab.INVENTORY;
		case 2:
			return Tab.EQUIPMENT;
		case 3:
			return Tab.ATTACK;
		case 4:
			return Tab.SKILLS;
		case 5:
			return Tab.FRIENDS;
		case 6:
			return Tab.QUEST;
		}
		return Tab.SKILLS;
	}
	
	
	@Override
	public int onLoop() throws InterruptedException {
		if (getInventory().isFull() && !edgeBank.contains(myPlayer()) && !getBank().isOpen()) {
			state = "Walking to bank";
			getWalking().webWalk(new Position(Banks.EDGEVILLE.getRandomPosition()));
		}
		
		if (getInventory().isFull() && edgeBank.contains(myPlayer()) && !getBank().isOpen()) {
			RS2Object bank = getObjects().closest("Bank booth");
			state = "Opening bank";
			if (bank != null) {
				if (bank.interact("Bank")) {
					state = "Depositing items";
					sleep(1000);
				}
			}
		}
		
		if (getInventory().isFull() && edgeBank.contains(myPlayer()) && getBank().isOpen()) {
			getBank().depositAllExcept("Fly fishing rod", "Feather");
			while (getInventory().contains("Trout") || getInventory().contains("Salmon")) {
				sleep(100);
			}
			state = "Closing bank";
			getBank().close();
		}
		
		if (!getInventory().isFull() && !fishArea.contains(myPlayer()) && !getBank().isOpen() ) {
			state = "Walking to fishing spots.";
			getWalking().webWalk(new Position(3102 + random(3), 3433 + random(3), 0));
		}
		
		if (!getInventory().isFull() && fishArea.contains(myPlayer())) {
			NPC spot = getNpcs().closest("Fishing spot");
			state = "Finding spot.";
			if (spot != null && spot.hasAction("Lure")) {
				spot.interact("Lure");
				sleep(2000);
				invCount = getInventory().getEmptySlots();
			}
			while (myPlayer().isAnimating()) {
				state = "Catching fish.";
				randomizeMouse();
				if (getInventory().getEmptySlots() != invCount && fishArea.contains(myPlayer())) {
					invCount = getInventory().getEmptySlots();
					caught += 1;
				}
				sleep(1000);
			}	
		}
		
		
		
		
		
		return random(500, 800);
	}
	
}

Not gonna wait two hours for a good proggy but here's one. Theoretically if it lasts through one full iteration, it can last through a billion....I did two iterations for posterity and cause i'm such a saint.

7166448e41a1ba3fa89c08a90bd48ff6.png

Edited by Paradox68

Gz on release, nice to see people releasing scripts for some of the people who dont have the means to get the premium ones, i had that problem for a while as couldnt use paypal

while (getInventory().contains("Trout") || getInventory().contains("Salmon")) {
                sleep(100);
}

u might get stuck here m8

  • Author
while (getInventory().contains("Trout") || getInventory().contains("Salmon")) {
                sleep(100);
}

u might get stuck here m8

 

 

Nah it won't get stuck because the onLoop calls depositAllExcept("Fly fishing rod", "Feather"); in the event before the while event is handled. So logically unless the computer somehow skips a line of code for the first time since the computer was invented, then the event should execute just fine. I ran the script for 8 hours yesterday no errors. If you feel more comfortable removing it, you're welcome to do so. I just used it so  depositAllExcept("Fly fishing rod", "Feather"); wasn't being called every 500-800ms while the bank was open. I'm sure there are better ways but as you can see this is not a full-measure script release.

Edited by Paradox68

  • Author

Since the script got a bit of love, here's an updated version of the original script with some mouse moving anti-ban methods, and switched to webwalking.

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;

import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.map.Position;
import org.osbot.rs07.api.map.constants.Banks;
import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.api.model.RS2Object;
import org.osbot.rs07.api.ui.Skill;
import org.osbot.rs07.api.ui.Tab;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;


@ScriptManifest(author = "Paradox68", info = "Paradox simple Edgeville fishing script.", name = "Paradox Simple Edge Fisher", version = 1.0, logo = "")
public class main extends Script {
	private long timeStart;
	private String state = "Initializing..";
	private int invCount = 0;
	private int caught = 0;
	private int lastMA = 0;
	Area fishArea = new Area( new Position(3111,3437,0), new Position(3100,3422,0));
	Area edgeBank = new Area( new Position(3098,3499,0), new Position(3091,3488,0));
	
	
	@Override
	public void onStart() {
		getExperienceTracker().start(Skill.FISHING);
		timeStart = System.currentTimeMillis();
		
	
	}
	@Override
	public void onPaint(Graphics2D g) {
		long timeElapsed = System.currentTimeMillis() - timeStart;
		long seconds = (timeElapsed / 1000) % 60;
		long minutes = (timeElapsed / (1000 * 60)) % 60;
		long hours = (timeElapsed / (1000 * 60 * 60)) % 24;
		g.setFont(new Font("Trebuchet MS", Font.PLAIN, 14));
		g.setColor(Color.white);
		
		g.drawString("x", (int)getMouse().getPosition().getX() - 4, (int)getMouse().getPosition().getY() + 5);
		g.drawString(state, 8, 50);
		g.drawString("Time Running: " + (hours >= 10 ? "" + hours : "0" + hours) + ":" + (minutes >= 10 ? "" + minutes : "0" + minutes) + ":" + (seconds >= 10 ? "" + seconds : "0" + seconds), 8, 65);
		g.drawString("XP Gained: " + getExperienceTracker().getGainedXP(Skill.FISHING) + " (" + getExperienceTracker().getGainedLevels(Skill.FISHING) + ")", 8, 80);
		g.drawString("Fish caught: " + caught, 8, 95);
	}
	
	private void randomizeMouse() {
		lastMA++;
		if (lastMA > 4) {
			int i = random(5);
			switch (i) {
			case 0:
			case 1:
				getMouse().moveOutsideScreen();
				break;
			case 2:
				getMouse().moveRandomly();
				break;
			case 3:
				getMouse().moveSlightly();
				lastMA = 3;
				break;
			case 4:
				getMouse().moveVerySlightly();
				break;
			case 5:
				getTabs().open(randomTab());
				if (getTabs().getOpen() == Tab.SKILLS) {
					getMouse().move(704, 283);
				}
			}
			
			lastMA = 0;	
		}
	}
	
	private Tab randomTab() {
		int i = random(6);
		switch(i) {
		case 0:
		case 1:
			return Tab.INVENTORY;
		case 2:
			return Tab.EQUIPMENT;
		case 3:
			return Tab.ATTACK;
		case 4:
			return Tab.SKILLS;
		case 5:
			return Tab.FRIENDS;
		case 6:
			return Tab.QUEST;
		}
		return Tab.SKILLS;
	}
	
	
	@Override
	public int onLoop() throws InterruptedException {
		if (getInventory().isFull() && !edgeBank.contains(myPlayer()) && !getBank().isOpen()) {
			state = "Walking to bank";
			getWalking().webWalk(new Position(Banks.EDGEVILLE.getRandomPosition()));
		}
		
		if (getInventory().isFull() && edgeBank.contains(myPlayer()) && !getBank().isOpen()) {
			RS2Object bank = getObjects().closest("Bank booth");
			state = "Opening bank";
			if (bank != null) {
				if (bank.interact("Bank")) {
					state = "Depositing items";
					sleep(1000);
				}
			}
		}
		
		if (getInventory().isFull() && edgeBank.contains(myPlayer()) && getBank().isOpen()) {
			getBank().depositAllExcept("Fly fishing rod", "Feather");
			while (getInventory().contains("Trout") || getInventory().contains("Salmon")) {
				sleep(100);
			}
			state = "Closing bank";
			getBank().close();
		}
		
		if (!getInventory().isFull() && !fishArea.contains(myPlayer()) && !getBank().isOpen() ) {
			state = "Walking to fishing spots.";
			getWalking().webWalk(new Position(3102 + random(3), 3433 + random(3), 0));
		}
		
		if (!getInventory().isFull() && fishArea.contains(myPlayer())) {
			NPC spot = getNpcs().closest("Fishing spot");
			state = "Finding spot.";
			if (spot != null && spot.hasAction("Lure")) {
				spot.interact("Lure");
				sleep(2000);
				invCount = getInventory().getEmptySlots();
			}
			while (myPlayer().isAnimating()) {
				state = "Catching fish.";
				randomizeMouse();
				if (getInventory().getEmptySlots() != invCount && fishArea.contains(myPlayer())) {
					invCount = getInventory().getEmptySlots();
					caught += 1;
				}
				sleep(1000);
			}	
		}
		
		
		
		
		
		return random(500, 800);
	}
	
}
  • 2 weeks later...
			while (myPlayer().isAnimating()) {

Don't use while loops in your scripts. The only while loop you should be using is the onLoop method that you're forced to override after extending script. Since your script is already looping, you could easily use an if statement to check if you're animating.

			while (myPlayer().isAnimating()) {

Don't use while loops in your scripts. The only while loop you should be using is the onLoop method that you're forced to override after extending script. Since your script is already looping, you could easily use an if statement to check if you're animating.

 

 

Good point, I'll keep this in mind too.

There are two mistakes on webwalk, you can change the next, send a complete code can do

post-31821-0-84960100-1453799568_thumb.jpg

post-31821-0-35376000-1453799738_thumb.jpg

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.