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
mackerel
Newbie


Joined: 04 Feb 2003
Posts: 2
Location: USA

PostPosted: Tue Feb 04, 2003 2:25 am   

Help with first trigger, please
 
This is my first complex trigger, I apologize if it's a common question.

The command I'm working with is "teleport to mob". Replace "mob" with whichever mob I'm trying to get to, naturally. The problem is, sometimes it fails, with messages "You failed." or "You lost your concentration.", in which cases I'd like it to try to teleport to the same mob again. Those messages are quite common for other spells, so I don't think I can use a simple trigger on them. In the case of success, I get "You teleport to mob."

I'm pretty sure this needs to start as an alias for "teleport", which would activate triggers for the failure and success messages, and the success trigger would deactivate the others, but I'm not clear on how to start. Help would be appreciated. Bonus points if it stops teleporting and gives an error message after ten tries. Thank you to everyone who helps. :)
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Tue Feb 04, 2003 2:39 am   
 
#tr "tele" {teleport to (*)} {#t+ teleretry;#t- tele;#var count 1;#var mob "%1"}
#class teleretry
#tr {You failed.} {#if (@count < 10) {teleport to @mob;#add count 1} {#show Teleport failed!;#t- teleretry;#t+ tele}}
#tr {You lost your concentration.} {#if (@count < 10) {teleport to @mob;#add count 1} {#show Teleport failed!;#t- teleretry;#t+ tele}}
#tr {You teleport to} {#t+ tele;#t- teleretry;#unvar count;#unvar mob}
#class 0

--untested--
--edit--
whoops, i forgot to say, this doesn't take into account any sort of delaying device. If its ok to stack commands up on your mud, then don't worry about it; if your mud will take your command and send you "too soon message" like "you haven't recovered" or something, the script needs tweaking.
--------

moon.icebound.net:9000
Reply with quote
mackerel
Newbie


Joined: 04 Feb 2003
Posts: 2
Location: USA

PostPosted: Tue Feb 04, 2003 3:18 am   
 
Works like a charm, thank you very much! :)
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