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.

Stopping main loop when secondary thread takes over temporarily

Featured Replies

I'm writing a script for something that is semi-dangerous. I want to have a second thread that is constantly monitoring my hp level and I want this thread to take over and tele out if I get into trouble. The problem is I don't know how to "pause" the mainloop from outside of it. I'm not sure if i'm missing something obvious or what. Thanks for the help sorry for all the noob questions in chatbox.

If you're using states, put it as the first condition and it will always return true over anything else when the condition is met. 

 

If (myPlayer().isUnderAttacK()) {

return state.RUNBITCH; 
}

Put that at the top of the states and it will prioritize.

  • Author
1 minute ago, Juggles said:

If you're using states, put it as the first condition and it will always return true over anything else when the condition is met. 

 

If (myPlayer().isUnderAttacK()) {

return state.RUNBITCH; 
}

Put that at the top of the states and it will prioritize.

Alright I'll try that. Was gonna make it with nodes but if states makes it easier ill do it up. Thanks juggler :doge:

On 3/13/2017 at 5:23 PM, lizzzerd said:

Alright I'll try that. Was gonna make it with nodes but if states makes it easier ill do it up. Thanks juggler :doge:

You may still want to use threads instead of just putting the check at the beginning. If you incorporate conditionals sleeps in your methods you will not loop back to the check if you're being attacked in time.

Edited by zenitftw

  • Author
3 hours ago, zenitftw said:

You may still want to use threads instead of just putting the check at the beginning. If you incorporate conditionals sleeps in your methods you will not loop back to the check if you're being attacked in time.

yeah I just dont know how to safely let a secondary thread take over. But it's not that big of a deal if i die I can just make sure the death handling is on point.

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.