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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
shaun.murray
Magician


Joined: 23 Jul 2005
Posts: 334
Location: Chicago

PostPosted: Tue Aug 22, 2006 2:48 am   

looping and functions (kinda long)
 
I've got an auto rescue, and when I add people to the list, it creates a long variable and creates a trigger for them when they are attacked. But after I rescue them, it disables their trigger. After the fight is over, I want to reenable the trigger (helps with lag and getting spammed with rescuing them). However... Here is what I'm trying to do to kinda automate it a little more, short of manually going in and enabling the trigger.

Code:
#variable arescuewho {bob|phil|mark|johnny}
#TRIGGER "bob_trigger" {~[ * ~] attacks on *bobl*} {rescue bob;#T- bob_trigger}
#TRIGGER "phil_trigger" {~[ * ~] attacks on *phil*} {rescue phil;#T- philtrigger}
#TRIGGER "mark_trigger" {~[ * ~] attacks on *mark*} {rescue mark;#T- makr_trigger}
#TRIGGER "johnny_trigger" {~[ * ~] attacks on *johnny*} {rescue johnny;#T- johnnytrigger}


Now my question is... Would this work?

Code:
#alias resetvar {#loop (%countitem @arescuewho),1 {#T+ %item(@arescue, %i)_trigger}}
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Tue Aug 22, 2006 9:54 am   
 
#TRIGGER "bob_trigger" {~[ * ~] attacks on *bob*} {rescue bob;#T- bob_trigger;#ADDITEM Rescued {bob}}
#TRIGGER "phil_trigger" {~[ * ~] attacks on *phil*} {rescue phil;#T- philtrigger;#ADDITEM Rescued {phill}}

#ALIAS ResetRescue {#FORALL @Rescued {#T+ %concat(%i,"_trigger");#DELITEM Rescued {%i}}}

Only turning back on those you have actually turned off will be faster, and that variable will likely remain quite small.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Tue Aug 22, 2006 12:22 pm   
 
Or if you have a standard prompt and a battle prompt set it so that it turns off with standard and on with battle.
_________________
http://www.Aardwolf.com
Reply with quote
shaun.murray
Magician


Joined: 23 Jul 2005
Posts: 334
Location: Chicago

PostPosted: Tue Aug 22, 2006 2:31 pm   
 
kk, now i need to get someone to group with me, and find an aggro area! anyone wanna be a guinea pig? LoL! as far as the prompt... there is, but... if i'm in battle, and a mob comes into the room, and attacks one of my party members, i will automatically try and rescue them, whether or not my lag will let me right then and there, depends on how i initiated the combat with the first mob, and... if i initiated it with a special attack, that will lag me for 6 seconds for example, thats 6 seconds of combat my party member is fighting that aggro mob, and 6 seconds that my autorescue trigger is spamming me with rescues, so that when i DO get out of lag, i'm now lagging with the mud playing catchup with all my commands! hence the shutdown the rescue after one fires off deal, but... if i move to another room, or combat is over, i want to streamline turning back on my group members autorescue trigger, just in case some s**t comes down, ya know? =D

thanks again for all your help!! =D
Reply with quote
Qiz
Novice


Joined: 14 Aug 2006
Posts: 34
Location: Sweden

PostPosted: Tue Aug 22, 2006 2:50 pm   
 
You could do something like
#INPUT {specialattack %d} {#T- autorescue; #ALARM +6 {#T+ autorescue}}
This will disable autorescue if you do that 6 second special attack, and turn it back on once you can actually use rescue again.

Also, I assume there's some kind of death message yuo could trigger on to turn triggers back on like
#TR {* hits the ground... dead} {#T+ autorescue}

Or go for
#INPUT {[eswnud]} {#T+ autorescue}
This will check any input command containing only one or more of those chars. Perhaps not good enough as it would trigger on "see". Else use
#INPUT {e|s|w|n|u|d|nw|sw|ne|se}

Or create a macro for some easily accessable key that does #T+ autorescue
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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