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.

Can anyone help me pls ?

Featured Replies

- I using this code to activate actions in onLoop, my question is what i need put in the last return state (red color)... I understood that using for example: 

if (inventory.contains("Coins")

return State.Buy;

The case Buy will be called and the player will buy something, but the last return state (red color) have no if statement to activate it and im confused at what to put here.

private getStateif return 
        return ;
    return State.??

My other question is: When this private State getState() {} call one case how can i stop the verification until the case completes the actions inside it, because for example:

in private State getState have the statement:

if (!inventory.contains("Coins")

return State.Go_Bank_Withdraw_Coins;

And in onLoop have the code:

switch (getState()) {

case Go_Bank_Withdraw_Coins:

if (!BankArea.contains(myPlayer)){

walking.Webwalk(BankArea)}

break;

}

The verification in private State getState will not stop until the case complete, contrariwise will keep calling the case.

Edited by RuneMaker4657

If you're unsure about what's going on, i'd suggest switching over to a slightly simpler structure: the 'if' statement!

Work straight in the onLoop. For example:

if (getBank().isOpen() {
	if (!getInventory().isEmpty() {
		getBank().depositAll();
	}
} else { 
	getBank().open();
}

At some point, I will update my guide as I think it's a little too abstracted for a beginner to programming altogether.

Apa

  • Author
21 minutes ago, Apaec said:

If you're unsure about what's going on, i'd suggest switching over to a slightly simpler structure: the 'if' statement!

Work straight in the onLoop. For example:


if (getBank().isOpen() {
	if (!getInventory().isEmpty() {
		getBank().depositAll();
	}
} else { 
	getBank().open();
}

At some point, I will update my guide as I think it's a little too abstracted for a beginner to programming altogether.

Apa

Yeah its work when the script is simple but this states with coins was just an random example... the script that i using switch states have 490 lines, i cant put all if statements in onLoop.

ill try rewrite this removing the states, and call

private void() throws InterruptedException {}

in onLoop.. but i think will keep not stop the verifications until the methods done.

Edited by RuneMaker4657

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.