Jump to content

Script starts before GUI closes 25% of the time


Recommended Posts

Posted

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.

Posted (edited)
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

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...