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.

Picking up small fishing net ?

Featured Replies

Hey,

 

Could someone help me with this piece of code ?

I'm trying to make a small fish net looter but my character does nothing.

		GroundItem net = getGroundItems().closest("Small fishing net");
		
		if(!inventory.isFull() && net != null) {
			
			net.interact("Take");
			
		}

 

Edited by LagunaPreza

10 minutes ago, FuryShark said:

Settings -> Options -> Debug -> Entity hover debug
look at the name 😛 

he has it spelled correctly, lol

@op how are you calling this method?

  • Author
13 minutes ago, Reminiscence said:

he has it spelled correctly, lol

@op how are you calling this method?

I've put this code in the OnLoop

2 minutes ago, LagunaPreza said:

I've put this code in the OnLoop

that's odd, the code should work then. either way, here you go.

 

import org.osbot.rs07.api.model.GroundItem;
import org.osbot.rs07.script.Script;

import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.ConditionalSleep;

import java.awt.*;

@ScriptManifest(name = "test", author = "Reminiscence", version = 1.0, info = "", logo = "") 
public class test extends Script {
	
	GroundItem net;

	public int onLoop() throws InterruptedException {
		net = groundItems.closest("Small fishing net");
		
		if (net != null && !inventory.isFull() && map.canReach(net)) {
			net.interact();
			sleepy(2500, net == null);
		}
		
		if (net == null)
			sleep(200);
		
		return 100;
	}
	
	public void sleepy(int time, boolean until) {
		new ConditionalSleep(time) {
			@Override
			public boolean condition() throws InterruptedException {
				return until;
			}
		}.sleep();
	}
}

 

  • Author
17 minutes ago, Reminiscence said:

that's odd, the code should work then. either way, here you go.

 


import org.osbot.rs07.api.model.GroundItem;
import org.osbot.rs07.script.Script;

import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.ConditionalSleep;

import java.awt.*;

@ScriptManifest(name = "test", author = "Reminiscence", version = 1.0, info = "", logo = "") 
public class test extends Script {
	
	GroundItem net;

	public int onLoop() throws InterruptedException {
		net = groundItems.closest("Small fishing net");
		
		if (net != null && !inventory.isFull() && map.canReach(net)) {
			net.interact();
			sleepy(2500, net == null);
		}
		
		if (net == null)
			sleep(200);
		
		return 100;
	}
	
	public void sleepy(int time, boolean until) {
		new ConditionalSleep(time) {
			@Override
			public boolean condition() throws InterruptedException {
				return until;
			}
		}.sleep();
	}
}

 

Thanks for the code but for some reason this also doesn't work for me..

My code now:

package core;

import org.osbot.rs07.api.model.GroundItem;
import org.osbot.rs07.script.Script;

import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.ConditionalSleep;

import java.awt.*;

@ScriptManifest(name = "Small Net Looter", author = "LagunaPreza", version = 1.0, info = "", logo = "")

public class NetLooter extends Script {

	@Override

	public void onStart() {

		// Code here will execute before the loop is started

	}

	@Override

	public void onExit() {

		// Code here will execute after the script ends

	}

	@Override

	public int onLoop() throws InterruptedException {
		
		GroundItem net;
		net = groundItems.closest("Small fishing net");
		
		if(net != null && !inventory.isFull() && map.canReach(net)) {
			
			net.interact("Take");
			sleepy(2500, net == null);
			
		}
		
		if(net == null) {
			
			sleep(200);
			
		}
		
		return 700; // The amount of time in milliseconds before the loop starts over

	}
	
	public void sleepy(int time, boolean until) {
		new ConditionalSleep(time) {
			@Override
			public boolean condition() throws InterruptedException {
				
				return until;
				
			}
			
			
		}.sleep();
		
		
	}

	@Override

	public void onPaint(Graphics2D g) {

		// This is where you will put your code for paint(s)

	}

}

 

What about it doesn't work? Does the script start? Does it hover over the object? Is there anything in the logger? Are you sure you're trying to loot a small fishing net? Is your inventory full? Can you walk to the fishing net?

Can you buy a small fishing net, drop it underneath you and run the script to see if it gets picked up?

4 hours ago, Reminiscence said:

he has it spelled correctly, lol

@op how are you calling this method?

Its not the spelling of the item im meaning...

Settings -> options -> debug -> Entity hover debug

ki7YvHT.png
its missing <col=ff9040> </col>

@LagunaPreza

Edited by FuryShark

18 minutes ago, FuryShark said:

Its not the spelling of the item im meaning...

Settings -> options -> debug -> Entity hover debug

ki7YvHT.png
its missing <col=ff9040> </col>

@LagunaPreza

ah that's awkward, it's tagged as an object instead of a grounditem. i wasn't aware of that lol

@LagunaPreza here's something that works then

import org.osbot.rs07.api.model.RS2Object;
import org.osbot.rs07.script.Script;

import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.ConditionalSleep;

import java.awt.*;

@ScriptManifest(name = "test", author = "Reminiscence", version = 1.0, info = "", logo = "") 
public class test extends Script {
	
	RS2Object net;

	public int onLoop() throws InterruptedException {
		net = objects.closestThatContains("Small fishing net");
		
		if (net != null && !inventory.isFull() && map.canReach(net)) {
			net.interact();
			sleepy(2500, net == null);
		}
		
		if (net == null)
			sleep(200);
		
		return 100;
	}
	
	public void sleepy(int time, boolean until) {
		new ConditionalSleep(time) {
			@Override
			public boolean condition() throws InterruptedException {
				return until;
			}
		}.sleep();
	}
}

since the object doesn't seem to disappear, i guess it makes no sense to have a conditionalsleep of this manner. you could just do a sleep(200) or something so it doesn't spam click like a typical bot would

Edited by Reminiscence

  • Author
1 hour ago, FuryShark said:

Its not the spelling of the item im meaning...

Settings -> options -> debug -> Entity hover debug

ki7YvHT.png
its missing <col=ff9040> </col>

@LagunaPreza

 

1 hour ago, Reminiscence said:

ah that's awkward, it's tagged as an object instead of a grounditem. i wasn't aware of that lol

@LagunaPreza here's something that works then


import org.osbot.rs07.api.model.RS2Object;
import org.osbot.rs07.script.Script;

import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.ConditionalSleep;

import java.awt.*;

@ScriptManifest(name = "test", author = "Reminiscence", version = 1.0, info = "", logo = "") 
public class test extends Script {
	
	RS2Object net;

	public int onLoop() throws InterruptedException {
		net = objects.closestThatContains("Small fishing net");
		
		if (net != null && !inventory.isFull() && map.canReach(net)) {
			net.interact();
			sleepy(2500, net == null);
		}
		
		if (net == null)
			sleep(200);
		
		return 100;
	}
	
	public void sleepy(int time, boolean until) {
		new ConditionalSleep(time) {
			@Override
			public boolean condition() throws InterruptedException {
				return until;
			}
		}.sleep();
	}
}

since the object doesn't seem to disappear, i guess it makes no sense to have a conditionalsleep of this manner. you could just do a sleep(200) or something so it doesn't spam click like a typical bot would

Ohh man, I didn't know that lol

Thanks for the help!

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.