ScriptUO

Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Grandewd on August 31, 2014, 04:51:40 PM

Title: Stopping a script when it's menu is closed....
Post by: Grandewd on August 31, 2014, 04:51:40 PM
:)
Here's what I've been using to call all my menu's, of which I have many....  :-\

Code: [Select]
set #menuButton N/A
set %EndScript #false
Repeat
  If #MenuButton <> N/A
     {
     gosub #menuButton
     set #menuButton N/A
     }
until #menubutton = closed
halt  ; End script


I have 3 menu's called exactly like the above snippet.
If I close the menu with the red-x, two of them stop the menu script.  The 3rd one never will do that (and I want it to)...
Wtf am I missing?

 :-[
Title: Re: Stopping a script when it's menu is closed....
Post by: TrailMyx on August 31, 2014, 06:55:02 PM
So are you missing some information there?

If you get a menubutton value, you'll run the appropriate subroutine, but then you set menubutton to N/A so the script won't stop in that loop.  Can you post a bit more code to see what you've got as an example?

If I understand you correctly, you just need an "if" statement so that you don't overwrite the #menubutton value once "closed" has been clicked.

Code: [Select]
set #menuButton N/A
set %EndScript #false
Repeat
  If #MenuButton <> N/A
     {
     gosub #menuButton
     if #menuButton <> closed
        set #menuButton N/A
     }
until #menubutton = closed
halt  ; End script