How to end a macro in a loop?

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

OnyxSkyDV
a lesser mummy
a lesser mummy
Posts: 46
Joined: Wed Sep 18, 2002 1:02 pm

How to end a macro in a loop?

Post by OnyxSkyDV » Fri Jun 20, 2003 12:07 pm

I have had a few occasions where a macro was either in a loop, or calculating so much that I was unable to type in a /end to stop it.

I tried creating a social and mapping that to a hot button, but still was unable to get a keystroke in there to cancel the macro.

Any ideas?


Thanks!

OnyxSkyDV

AarynD
a lesser mummy
a lesser mummy
Posts: 45
Joined: Thu Jan 02, 2003 11:25 am

Post by AarynD » Fri Jun 20, 2003 12:58 pm

CTRL-ALT-DEL, go to task manager, highlight the Everquest game, and hit End Task. Once that is done, go back and recode your macro to not get stuck in an endless loop :p

- Aaryn

Lane
a hill giant
a hill giant
Posts: 201
Joined: Fri Dec 06, 2002 11:57 am

Post by Lane » Fri Jun 20, 2003 1:04 pm

I have some sucess using the following tactic:

Press Enter then press "/" really fast
Press Enter then press "e" really fast
keep going till you get "/end" in the chat window.

This has always worked, but then it wasn't stuck in a hard loop, it was just doing stupid stuff real fast.

-Lane

kagonis
a hill giant
a hill giant
Posts: 228
Joined: Sat May 24, 2003 8:48 pm

Post by kagonis » Fri Jun 20, 2003 2:24 pm

In the time it takes you to type that a macro might have screwed more things up than is actually funny ;)

Better to do as Aaryn said, write it so it doesnt lock up ;)

The tradeskill combiner thing someone made, where they made 2 sub routines to automatically figure out the delay to drop and pick stuff on or off cursor is practically impossible to stop once running.

Insert a /delay somewhere, just /delay 5 or so, at that spot it is possible to hit the hotbutton and make it stop.

Or you can put a max on the loop, so that it will never increment beyond a given number. Like if you have a combine where there is no way you can make more than 100 combines, then make the macro autostop after 100 loops no matter what.

I'm sure other people have more and better suggestions ;)

boldor
a ghoul
a ghoul
Posts: 94
Joined: Tue Sep 10, 2002 11:46 am

Post by boldor » Fri Jun 20, 2003 3:00 pm

If you are running two characters. You could possible also do:

Code: Select all

#chat tell

|at end of your press of combind button have a 
/doevents


Sub Event_Chat
/endmacro
/return
I stumbled across this in one of the recent macros posted in Depot.

gameboy
a lesser mummy
a lesser mummy
Posts: 64
Joined: Fri Nov 08, 2002 12:28 pm

Post by gameboy » Fri Jun 20, 2003 3:25 pm

I have a hotkey for '/endmacro'
Works great.

OnyxSkyDV
a lesser mummy
a lesser mummy
Posts: 46
Joined: Wed Sep 18, 2002 1:02 pm

How did you do the hotkey?

Post by OnyxSkyDV » Fri Jun 20, 2003 4:41 pm

Is it just a social mapped to one of the hotbuttons on the left side? If so, that does not work. Like mentioned earlier, this particular macro pretty much takes control and you are unlikely to get a keystroke in to stop it...

I'll try the delay at the end of the combine and see what I can do. Maybe a counter so that every 10 or so combines it delays for 5secs... should be effective enough.

Thanks for the suggestions.


OnyxSkyDV

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Re: How to end a macro in a loop?

Post by wassup » Fri Jun 20, 2003 4:50 pm

OnyxSkyDV wrote:I have had a few occasions where a macro was either in a loop, or calculating so much that I was unable to type in a /end to stop it.

I tried creating a social and mapping that to a hot button, but still was unable to get a keystroke in there to cancel the macro.

Any ideas?


Thanks!

OnyxSkyDV
If you are talking about a macro I put up...

The problem is tradeskill macro's generally leave the CTRL key pressed until the macro finishes.

Guess why you can't get /endmacro in :)

To end one of my macro's all I do is hit the CTRL key on my keyboard and then hit my /endmacro hotkey, or just wait for the quantity selector to pop up... which effectively ends the macro.

AarynD
a lesser mummy
a lesser mummy
Posts: 45
Joined: Thu Jan 02, 2003 11:25 am

Post by AarynD » Fri Jun 20, 2003 5:10 pm

hehe, I used to run into that CTRL DOWN key a while back... I modified my scripts to only have the key down only for as long as i needed to be down, then the corresponding /sendkey command was sent to raise the ctrl key.

- Aaryn

User avatar
Imperfect
Macro Author
Macro Author
Posts: 319
Joined: Fri Jun 14, 2002 1:52 am

Post by Imperfect » Fri Jun 20, 2003 5:21 pm

/hot End /end

Then mash key like crazy.

User avatar
BlueSkies
a ghoul
a ghoul
Posts: 132
Joined: Tue Oct 01, 2002 6:22 pm

Post by BlueSkies » Sat Jun 21, 2003 12:59 pm

When I was writing tradeskill macros of my own, I'd leave checks in place to see if I was targetting myself, and if so, to end immediately, like so:

Code: Select all

:LoopMe
    /if $target(name)==$char(name) /endmacro
    /if 1!=0 /goto :LoopMe
I scattered "/if $target(name)==$char(name) /endmacro" throughout my code, mostly at the start of all my loops. I found this to be the best way to end if I get stuck, because I've noticed that the 'TAB' keystroke seems to go through regardless of the control / shift / alt key positions. And since TAB targets your character... ;)

Give it a try.

[edit] Oh yeah -- [F1] can be used to target yourself too. :P
Live your dreams! Blue Skies everyone

Lane
a hill giant
a hill giant
Posts: 201
Joined: Fri Dec 06, 2002 11:57 am

Post by Lane » Sat Jun 21, 2003 4:19 pm

I used the "Ctrl" + "/end" button idea and it works good.

Was making things in PoK and could reply in just a few seconds to people wanting ot buy things.

-Lane