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 starts before GUI closes 25% of the time

Featured Replies

I have an if statement inside of my onLoop which contains all of the code that would normally be in the onLoop. The only way the code will run is if "started" equals "true", and the only place "started" is changed from "false" to "true" is inside of the action listener for my start button in the GUI. However, about 25% of the time the code inside of onLoop and the if statement runs even if you haven't hit "Start" in the GUI. Using the search tool I've found nowhere else in my code that changes "started" to true besides for that action listener. I don't know what to do.

  • Author
45 minutes ago, Juggles said:

Use paint and see if the action is returning true sometimes

 

I'll try this, but if it's returning true sometimes for no reason, how would I fix that?

Move your check to onStart() and remove the if from your onLoop().

if (!started) {
	stop();
	return;
}

 

I have ran into similar problems in the past that I believe were caused by caching issues between script executions. However, it would be worth seeing your code and for me to test whether I encounter the same problem.

Edited by liverare

If you're saving the

isStarted

boolean as a static and you're using this in a local script, you need to hit the refresh button on the script selector once to make sure all the static variables are being 'reset'.

Edited by Eagle Scripts

  • Author
On 11/14/2018 at 7:51 AM, Eagle Scripts said:

If you're saving the


isStarted

boolean as a static and you're using this in a local script, you need to hit the refresh button on the script selector once to make sure all the static variables are being 'reset'.

I need to refresh the script selector every time I run the script but this worked. However is this only because it's a local script? If it was an SDN script or a private script would it not have the issue?

Also is there a way to fix this issue with code?

Edited by Jack Shep

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.