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.

First time scripting. Bot standing. help?

Featured Replies

So i need some help since my bot just stands still and i get "error in script executor" in the logger.

this is my first time scripting, so trying to learn it all. Appreciate if the help can be in my  "noob level" of understanding!

 

This is the code....


 

Edited by obrandso

  • Author
5 hours ago, Gunman said:

@obrandso The script will forever be stuck in the first if statement if you don't have law runes.

Can i put in the first if statement like this..

if (!getInventory().contains("Law rune")) {
getwalking.webwalk(bankArea);
  if (!bankArea.contains(myPOS)) {
                getWalking().webWalk(bankArea);
            }

or how do i resolve this?

 if (!getInventory().contains("Law rune")) {
            if (!bankArea.contains(myPOS)) {
                getWalking().webWalk(bankArea);
            }
            
        }

!getInventory().contains("Law rune") <- if this returns true it will forever return true. Since it always returns true it will forever loop the code above^
 

Just move the banking stuff after the bank area check would probably fix this. Avoid using static sleeps when you can. Static being sleep(1000); or sleep(random (1000, 2000)); <- both are what I consider static. Another thing why is your onloop returning hopTo which is == -1? Change it to return like 500 or something.

  • Author
2 hours ago, Gunman said:

 if (!getInventory().contains("Law rune")) {
            if (!bankArea.contains(myPOS)) {
                getWalking().webWalk(bankArea);
            }
            
        }

!getInventory().contains("Law rune") <- if this returns true it will forever return true. Since it always returns true it will forever loop the code above^
 

Just move the banking stuff after the bank area check would probably fix this. Avoid using static sleeps when you can. Static being sleep(1000); or sleep(random (1000, 2000)); <- both are what I consider static. Another thing why is your onloop returning hopTo which is == -1? Change it to return like 500 or something.

So conditionalsleep better than static sleep?

 

if i change it to this code only, it would read the code under it if it returns false right?

and if true, it will keep looping the statement until i get to the bankArea?

but will it work like this then?

if (!getInventory().contains("Law rune")) {
getWalking().webWalk(bankArea);
}
            if (bankArea.contains(myPOS)) {
            getBank().open();


i wrote the code at night so i was a bit flumsy. I will change the return value...

 

EDIT: nvm i fixed it! thanks!

Edited by obrandso

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.