skillup event handler?

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

carpaltunnel
a lesser mummy
a lesser mummy
Posts: 31
Joined: Thu Sep 04, 2003 3:52 pm

skillup event handler?

Post by carpaltunnel » Mon Nov 03, 2003 5:44 pm

I wish I had done it long ago, but I never added an event handler to stop a macro at a particular skill, or simply stop upon gaining a skillup. I often have a limited supply of high trivial items and don't want to keep going until I run out, rather I stop when I doubt I'll get another increase with the remaining supplies and keep them till I have more stockpiled. I just put in a delay and watch for an increase and stop the macro manually. So, would just adding:

#event COMBINE_Skillup "You have become better at"

at the head. and

Sub Event_COMBINE_Skillup
/end keep keys

to my Sub's work? Here's a simple example:

| - mephit.mac -
|
#event COMBINE_Skillup "You have become better at"
Sub Main
:MakeStuff
/sendkey down ctrl

/finditem "mephit meat"
/if "$cursor()"=="NULL" /call Exit
/click left enviro 0

/finditem "dressing"
/if "$cursor()"=="NULL" /call Exit
/click left enviro 1

/finditem "loaf of breaet"
/if "$cursor()"=="NULL" /call Exit
/click left enviro 2

/autoinventory
/delay 7
/autoinventory

/goto :MakeStuff
/return

Sub Event_COMBINE_Skillup
/sendkey up ctrl
/end keep keys

Sub Exit
/sendkey up ctrl
/end keep keys

User avatar
blueninja
a grimling bloodguard
a grimling bloodguard
Posts: 541
Joined: Thu Aug 28, 2003 7:03 am
Location: Göteborg, Sweden

Post by blueninja » Mon Nov 03, 2003 7:32 pm

No you have to call /doevents somewhere in there too, the event will be queued and not processed until you call that.. I'd put it after the second /autoinv before /goto :makestuff..