Exit a macro in a loop

macros macros macros

Moderators: Phineas, noivad

Post Reply
Ilda
Fresh off the Boat
Posts: 5
Joined: Sun May 20, 2012 7:29 pm
Profession: Hunter
Race: Sylvan
Player Status: Spambot

Exit a macro in a loop

Post by Ilda » Thu May 24, 2012 9:37 am

Hi,
How do you exit a macro that is running in a loop? For example, I made a macro to keep me logged in for a few minutes before going to sleep in a library so I can heal a bit first. But if I came back earlier than anticipated, and wanted to stop the macro, how would I do so?
Thanks,
Ilda

Ilda
Fresh off the Boat
Posts: 5
Joined: Sun May 20, 2012 7:29 pm
Profession: Hunter
Race: Sylvan
Player Status: Spambot

Re: Exit a macro in a loop

Post by Ilda » Thu May 24, 2012 10:36 am

nvm I find it

@env.click_interrupts (true/false) stops executing a macro when you click in the graphics pane of the game window (where clicks move your character).

User avatar
Talas
Exile
Posts: 599
Joined: Sun Aug 22, 2010 10:57 am
Profession: Fighter
Race: Concealed
Player Status: Active
Location: Munich, Germany
Contact:

Re: Exit a macro in a loop

Post by Talas » Fri May 25, 2012 1:13 am

you can always press CTRL+R to re-load your macros which stops all currently running macros. Much easier than to addapt exits to all your macros but maybe not so handy if you have many macros running at the same time ;)

User avatar
Frenzymac
Exile
Posts: 78
Joined: Thu Oct 25, 2007 3:59 am
Profession: Healer
Race: Human
Location: Austria

Re: Exit a macro in a loop

Post by Frenzymac » Fri May 25, 2012 1:40 am

SHIFT + ESC stops all macros at once, also @login macros. (Win client)

User avatar
Lorikeet
Pogue Mahone
Pogue Mahone
Posts: 3718
Joined: Sat Apr 05, 2003 12:58 pm
Profession: Healer
Race: Fen'neko
Player Status: Active
Contact:

Re: Exit a macro in a loop

Post by Lorikeet » Fri May 25, 2012 9:16 am

Frenzymac wrote:SHIFT + ESC stops all macros at once, also @login macros. (Win client)
Ctrl + Escape stops all on a Mac

User avatar
noivad
Order of the White Elephant
Order of the White Elephant
Posts: 3327
Joined: Wed Oct 08, 2003 4:04 pm
Profession: Fighter
Race: Sylvan
Player Status: Active
Location: SF Bay Area
Contact:

Re: Exit a macro in a loop

Post by noivad » Sun Jun 03, 2012 5:01 pm

If you want finer control do the following:

Outside any macro declare a variable. That makes it a global persistent variable that is set upon macro file loading:

Code: Select all

set keepAlive 1
within the macro test to see if the global macro is on or off

Code: Select all

f9 call keepAlive

keepAlive
{
//sample keepAlive macro
label LOOPSTART
if keepAlive == 0
     goto LOOPEND
else 
     // any keep alive command
     "/money\r"
     pause 480
     goto LOOPSTART
end if

label LOOPEND
setglobal keepAlive 1
}
then make a way to toggle the global variable:

Code: Select all

shift-F9 call toggleKeepAlive

toggleKeepAlive
{
      setglobal keepAlive 0
}
http://www.clanlord.net/
Org Du Lac's bestiary: http://bestiary.clanlord.net/index.html
Gil Galad’s Pirates http://pirates.clanlord.net/ & Ranger Studies: http://studies.clanlord.net/
?security warning:View cert•CL players assess valid by refs

Post Reply