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.

Script functioning really random

Featured Replies

So im writing a script that trains couple skills randomly, but its not functioning properly at all.
Here are some things that arent working properly:

-When mining, my sleepUntil never escapes on condition (checking both mined rocks ids on that position or player animation)

-Detects that it doesnt have pickaxe, runs to bank (printing on logger), logger says that it arrived to the destination (osbots print), and 70% of the time it does a 360 and starts running to the mining area, while still printing "Going to bank"

-Not sure about this, gonna have to recheck it later, but the getWalking().webwalk(bank1, bank2) might made me walk to the 2nd closest bank 

-Config 43 returns 4, while on config debugger its 100 (either air strike or a magic spell selected on attack tab)
-Config 108 returns 3, while on debugger its 11 (same as above)

if dangerArea contains player
    // run to tile x
else if... 

else if trainingArea contains player
    // attack npc
else 
    // walk to trainingArea

it does its thing, then attacks the npc, ignores the sleepUntil, and runs to tile x. On the same loop above the npc.interact(), the distance between player and danger returns around 90, and if he was infact in the dangerArea it shouldnt even skip the first if. 

I need help, ive been working for like 3 days on that, and im just trashing my code and filling it with random comments. Ive got no idea whats wrong or what to do


 

It sounds like you're having trouble with your onLoop() cycling before you've finished your task. Some events such as web walking have built-in break handlers and other methods require you to implement your own sleeps.

I would recommend logging more output to see exactly what's going on. If you see code triggering before you're done processing a method that's a good indicator that you need to add a sleep there.

Your logic is also extremely important. If a method returns a boolean, but you're not using that value anywhere that is something you should consider. Ask yourself exactly what a method is doing and what the output is. I think you may be using some methods with good intentions, but they might not work exactly how you think they do.

For example: getWalking().webwalk(bank1, bank2) according to the api "Walks to closest reachable destination area".

Edited by ExtraBotz

9 hours ago, k0rd said:

So im writing a script that trains couple skills randomly, but its not functioning properly at all.
Here are some things that arent working properly:

-When mining, my sleepUntil never escapes on condition (checking both mined rocks ids on that position or player animation)

-Detects that it doesnt have pickaxe, runs to bank (printing on logger), logger says that it arrived to the destination (osbots print), and 70% of the time it does a 360 and starts running to the mining area, while still printing "Going to bank"

-Not sure about this, gonna have to recheck it later, but the getWalking().webwalk(bank1, bank2) might made me walk to the 2nd closest bank 

-Config 43 returns 4, while on config debugger its 100 (either air strike or a magic spell selected on attack tab)
-Config 108 returns 3, while on debugger its 11 (same as above)

if dangerArea contains player
    // run to tile x
else if... 

else if trainingArea contains player
    // attack npc
else 
    // walk to trainingArea

it does its thing, then attacks the npc, ignores the sleepUntil, and runs to tile x. On the same loop above the npc.interact(), the distance between player and danger returns around 90, and if he was infact in the dangerArea it shouldnt even skip the first if. 

I need help, ive been working for like 3 days on that, and im just trashing my code and filling it with random comments. Ive got no idea whats wrong or what to do


 

Pretty sure most of these issues are just flawed script logic, if you provide some of you code I can take a look at it. :)

The webwalker doesn't always generate the shortest path, so if one bank is a little bit further it might be the closest at some points 😉

Edited by Khaleesi

  • Author

Forgot to mention that im scripting for couple of years now, just not on osbot. So i knew for a fact that it wanst a logical error, and thats why i was so confused.

After cleaning my code from all the mess i had created, i noticed that my dumbass had forgot to put a break on a couple of swiches. From what i recall, my ide was giving errors in such a case, but it didnt (guess i could remember wrong).

Script is finally working, thanks for the quick replyies <3

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.