Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Ethershade
Beginner


Joined: 17 Oct 2008
Posts: 11

PostPosted: Sun Oct 26, 2008 3:35 am   

Multiple macros for a single key?
 
Im wondering if its possible to have multiple macros activate from a single key

I have one macro on the 1 on the keypad that sends
#if (ESMODE="movement") {sw}

and another one on the 1 on the numpad that sends
#if (ESMODE="empathy") {GRID REPAIR @turret1}

Anyway, The second one works no matter what as long as the if condition is met, but the first one only works if the second one is closed/removed from the session. Any ideas how to get around this? I cannot put them in the same package or on the same macro, they must remain seperate from each other. The first one needs to be able to execute with or without the other.

I forgot to mention, the variable ESMODE is in the first package
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Oct 26, 2008 3:58 am   
 
Combine them into one macro. You are using one variable to determine what the macro is supposed to do, so just use a #CASE or #SWITCH to do that.

Alternatively, you could create separate macros and use #T+ and #T- to turn them on and off as needed. If you do things this way, know that you can only have one active macro per key at any one time.
_________________
EDIT: I didn't like my old signature
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Oct 26, 2008 10:32 am   
 
#case and #switch are definitely the way to go about this particular problem. If you're doing something more complex with your macros, you might want to consider using events. Your 1 macro would do #raise ButtonPressNumPad1 or something, and then you put all your code in different ButtonPressNumPad1 event handlers. You can then enable or disable the event handlers as you like.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net