Been hunting some little monster and I'm tired to hitting play/stop from window every time.  So I decide to make a menu,  I find out that I can perform one action at the time. Heal my self, recall, invis.   Now I'm trying to attack a monster with spell  and keep casting until dead. 
I try this but it doesn't exit after the monster is dead.  What do I'm missing
gosub menu1
set #menuButton N/A
set %EndScript #false
Repeat
  If #MenuButton <> N/A
     {
     gosub #menuButton
     set #menuButton N/A
     }
until #menubutton = closed
Sub button1 ;  kill monster
 repeat
finditem xxx G_10
if #findcnt > 0
{
  set #ltargetkind 1
  set #ltargetid #findid
  event macro 15 17   
  target 3s
  event macro 22
  wait 2s
}
set #RESULT #FALSE
until #FALSE
event macro 3 0  Return_out
return #RESULT