Jump to content

Script starts before GUI closes 25% of the time


Jack Shep

Recommended Posts

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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