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.

Threading paint before OnLoop

Featured Replies

Quick question on multithreading. My script uses a GUI which has two options: What tree type to cut and another dropbown menu for how big of an area you want to cut in. Now when the area size if being adjusted I want to paint it, while the main scriptloop has not started yet. 

How can I implement such a function?

14 minutes ago, Athylus said:

Quick question on multithreading. My script uses a GUI which has two options: What tree type to cut and another dropbown menu for how big of an area you want to cut in. Now when the area size if being adjusted I want to paint it, while the main scriptloop has not started yet. 

How can I implement such a function?

The onPaint method already runs on another Thread.
The main Script loop is another Thread which starts after the onStart.

OnPaint should be called consistently from when you start the script to when you end it; it has nothing to do with onLoop

So in your onPaint, perhaps have a call to your area painting class or gui class (or whatever you're doing), which asks for an optional wrapped area for example.

Best

Apa

 

There is nothing that is going to interfere with your GUI. The script hasn't started so if your GUI is open and a user is adjusting the area, the area on minimap will also adjust accordingly.

After the script starts, the thread that draws is separate from the onLoop thread,  there still isn't any interference.

  • Author

Except I have this in my onStart for my GUI:

synchronized(lock){
			try {
				lock.wait();
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}

Which is notified by my start button on GUI

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.