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.

Pandemic's Scripting Series: Part II - Path Walking and Simple Banking [UPDATED FOR OSBOT 2]

Featured Replies

  • 2 months later...

I am using the walkTile method in another script for personal use (nothing unique*), and one thing I notice is that it will spam click the minimap until the character is resting on that position, how would i go about so it won't do that. I am wanting it just to click once and walk to the general position and just continue on.

 

*I have an account which I'm trying to bot only using scripts I make myself, almost everything I'll make will already have a better made public script.

Edited by xarviar

  • Author

I am using the walkTile method in another script for personal use (nothing unique*), and one thing I notice is that it will spam click the minimap until the character is resting on that position, how would i go about so it won't do that. I am wanting it just to click once and walk to the general position and just continue on.

 

*I have an account which I'm trying to bot only using scripts I make myself, almost everything I'll make will already have a better made public script.

 

It shouldn't do that, have you modified it at all?

I am using the walkTile method in another script for personal use (nothing unique*), and one thing I notice is that it will spam click the minimap until the character is resting on that position, how would i go about so it won't do that. I am wanting it just to click once and walk to the general position and just continue on.

 

*I have an account which I'm trying to bot only using scripts I make myself, almost everything I'll make will already have a better made public script.

 

You could set different areas in the path and have it walk to the areas not the exact positions.

  • 1 month later...
  • 3 weeks later...

Im having trouble with one piece of code in particular this part
 

private boolean walkTile(Position p) throws InterruptedException {
    mouse.move(new MinimapTileDestination(bot, p), false);
    sleep(random(150, 250));
    mouse.click(false);
    int failsafe = 0;
    while (failsafe <10 && myPlayer().getPosition().distance(p) >2) {
    sleep(200);
    failsafe++;
    if (myPlayer().isMoving())
    failsafe = 0;
    }
    if (failsafe == 10)
    return false;
    return true;
    }
 
eclipse is telling me the constructer minimaptiledestination (bot, position) is undefined.
 
any ideas as to why this is?

 

Im having trouble with one piece of code in particular this part

 

private boolean walkTile(Position p) throws InterruptedException {
    mouse.move(new MinimapTileDestination(bot, p), false);
    sleep(random(150, 250));
    mouse.click(false);
    int failsafe = 0;
    while (failsafe <10 && myPlayer().getPosition().distance(p) >2) {
    sleep(200);
    failsafe++;
    if (myPlayer().isMoving())
    failsafe = 0;
    }
    if (failsafe == 10)
    return false;
    return true;
    }
 
eclipse is telling me the constructer minimaptiledestination (bot, position) is undefined.
 
any ideas as to why this is?

 

 

MiniMap

not Minimap.

 

org.osbot.rs07.input.mouse.MiniMapTileDestination;

Edited by Samaoru

Omg Thank you its been driving me nuts for hours! 

 

if you have your osbot client attached in the build path of the project which it should be, then you can hover over the error and 90% of the time it will show you a fix for the problem including spelling errors :)

private boolean walkTile(Position p) throws InterruptedException {
	client.moveMouse(new MinimapTileDestination(bot, p), false);
	sleep(random(150, 250));
	client.pressMouse();
	int failsafe = 0;
	while (failsafe < 10 && myPlayer().getPosition().distance(p) > 2) {
		sleep(200);
		failsafe++;
		if (myPlayer().isMoving())
			failsafe = 0;
	}
	if (failsafe == 10)
		return false;
	return true;
}

should be:

	private boolean walkTile(Position p) throws InterruptedException {
		mouse.move(new MiniMapTileDestination(bot, p), false);
		sleep(random(150, 250));
		mouse.click(false);
		int failsafe = 0;
		while (failsafe < 10 && myPlayer().getPosition().distance(p) > 2) {
			sleep(200);
			failsafe++;
			if (myPlayer().isMoving())
				failsafe = 0;
		}
		if (failsafe == 10)
			return false;
		return true;
	}

should it not? <3

I'm finding these really useful to learn from, thanks so much for taking the time to do this. 

Ok, I'm trying to get the banking to work and it will get to the bank & bank fine. But when it tries to get back to the mine it will start walking towards Wilderness. 

 

I tried adjusting several things and copying your exact source and I still have the problem... I've used this to make a script for normal logs & it all works up to the same point where it needs to walk back after banking.

 

Any ideas 

  • 3 weeks later...

I'm an intermediate coder...is there ever going to be a tutorial for intermediate/advanced scripters?

  • 4 months later...

 

 

Step VI: Banking

Now that we’ve managed to walk to and from the bank, let’s actually do some banking!

If we’re in the bank state, that means we’re already in the bank!

Now, let’s add this case to our onLoop() function (as seen above), by simply adding this after the last “break;” and before the ‘}’:


case BANK:
    RS2Object bankBooth = objects.closest("Bank booth");
    if (bankBooth != null) {
        if (bankBooth.interact("Bank")) {
            while (!bank.isOpen())
                sleep(250);
            bank.depositAll();
        }
    }
    break;

This looks for the bank booth, if it isn’t null and if we actually managed to click on it, we’ll wait til it’s open, then deposit everything except our pickaxe, which is hardcoded so you’ll have to change this to whatever pickaxe you’re using. We’ll automatically detect which pickaxe we’re using in the next tutorial.

 

 

What if the bank booth is a closed booth? One that can't be used, the script wouldn't look for another bank booth, but just keep waiting

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.