Author Topic: Stopping a script when it's menu is closed....  (Read 1949 times)

0 Members and 1 Guest are viewing this topic.

Offline GrandewdTopic starter

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +24
  • Referrals: 0
    • View Profile
Stopping a script when it's menu is closed....
« on: August 31, 2014, 04:51:40 PM »
0
:)
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?

 :-[

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13303
  • Activity:
    0.4%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Stopping a script when it's menu is closed....
« Reply #1 on: August 31, 2014, 06:55:02 PM »
0
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
« Last Edit: August 31, 2014, 06:58:26 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Tags: