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.

Issue with localWaler.walkPath

Featured Replies

  • Author

Thanks for understanding smile.png

Also, states are perfectly fine if you enjoy looking at 1000+ lines of code purely in onLoop. Now, for smaller scripts, this is no issue (2 of my scripts still use states, as do most of my private scripts), but of course when your scripts get larger management is a lot easier with a node system. Doing it earlier simply gets you used to using it which really does help, believe me.

Imagine all of these classes:

cc82a93632193feaa369702e137e5464.png

All clustered into one class, it gets pretty hectic (not saying it would all be there anyway, just using it as an example). Nodes also enforce an OOP programming style, which is infinitely more useful (think objects instead of global variables).

I think it might be worth my time to not try and dive head first into scripting overnight and instead take the time to take some Java courses first. I actually started John Purcell's "Java Tutorial for Complete Beginners" on Udemy and that's definitely going to help me out I think.

 

The next thing I want to tackle is GUI's because at the minute, I'm creating separate scripts for the same skill as I level (i.e. willow cutter, maple, iron miner, coal miner etc) so I think I might take a Swing class. Do you have any recommendations as to good resources for it?

Edited by omni4life

I think it might be worth my time to not try and dive head first into scripting overnight and instead take the time to take some Java courses first. I actually started John Purcell's "Java Tutorial for Complete Beginners" on Udemy and that's definitely going to help me out I think.

 

The next thing I want to tackle is GUI's because at the minute, I'm creating separate scripts for the same skill as I level (i.e. willow cutter, maple, iron miner, coal miner etc) so I think I might take a Swing class. Do you have any recommendations as to good resources for it?

 

I'm definitely not a good example for learning, as I just dive in without looking at anything, much like assembling IKEA furniture ;)

I believe there are a few good GUI tutorials on here, so look around the tutorial section!

Hey guys, kinda new to OSBot and wanted to know how to define areas.

 

I looked at his code and even looked at what tiles at Barbarian Outpost his bank area is pointing to, and that just confused me more since most of them aren't even in the bank. I am thinking the area to just be a box with 4 points and anything within the box is the area... But since there are more than 4 positions (or tiles) being defined, it just confuses me.

 

Can someone clarify on how to define an area? Can an area be used like how I am explaining it? And, what exactly is he trying to do when defining the area with 6 poistions?

 

Thanks in advance.

  • Author

Hey guys, kinda new to OSBot and wanted to know how to define areas.

 

I looked at his code and even looked at what tiles at Barbarian Outpost his bank area is pointing to, and that just confused me more since most of them aren't even in the bank. I am thinking the area to just be a box with 4 points and anything within the box is the area... But since there are more than 4 positions (or tiles) being defined, it just confuses me.

 

Can someone clarify on how to define an area? Can an area be used like how I am explaining it? And, what exactly is he trying to do when defining the area with 6 poistions?

 

Thanks in advance.

Hey man, I guess it's my chance to return the help I got smile.png

 

You're correct in saying the area I defined was wrong and should only have two points. That was my fault, I didn't properly know how to use Divine Utility yet and I was clicking the tiles for the area I wanted as opposed to selecting the two corners. Using Divine Utility, you select your top right and bottom left corners (or whatever two corners you see fit).

 

This is the corrected code to define the area within the Barbarian Outpost bank:

	Area bankArea = new Area(new Position(2536, 3575, 0), new Position(2535, 3571, 0));

This defines the two corners and creates a square/rectangle between them.

 

To walk to the bank I did the following: 

private Position[] bankPos = new Position[] { new Position(2519, 3580, 0), new Position(2525, 3571, 0),
new Position(2531, 3571, 0), new Position(2533, 3573, 0), new Position(2535, 3574, 0),
new Position(2536, 3573, 0), };

private State getState() { 
	if (inventory.isFull()) {
		return State.WALK2BANK;
	}
}

 

public int onLoop() throws InterruptedException {
		switch (getState()) {
		case WALK2BANK:
			status = "Walking to bank";
			localWalker.walkPath(bankPos);
			break;
    }
}

My banking method was as follows. Note the area check in line three:

		case BANK:
			log("Case Change to Bank");
			if (inventory.isFull() && bankArea.contains(myPlayer())) {
				status = "Banking";
				log("Status Change and condition check");
				Entity chest = objects.closest(true, bankChest);
				if (!bank.isOpen()) {
					if (chest != null) {
						if (chest.isVisible()) {
							if (!myPlayer().isMoving()) {
								chest.interact("Use");
								sleep(random(1000, 1500));
							}
						}
					} else {
						camera.toEntity(chest);
					}
				} else if (getInventory().contains(
						"Bronze axe, Iron axe, Steel axe, Black axe, Mithril axe, Adamant axe, Rune axe, Dragon axe")) {
					bank.depositAllExcept(
							"Bronze axe, Iron axe, Steel axe, Black axe, Mithril axe, Adamant axe, Rune axe, Dragon axe");
				} else {
					bank.depositAll();
					sleep(random(200, 300));
				}
			}
			break;

I hope this helps you, if you need any more help just say the word. I know the learning curve is steep, but it can be damn rewarding!

Edited by omni4life

Hey man, I guess it's my chance to return the help I got smile.png

 

I hope this helps you, if you need any more help just say the word. I know the learning curve is steep, but it can be damn rewarding!

 

Awesome help! Thank you for helping me out.

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.