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


Joined: 19 Aug 2011
Posts: 7

PostPosted: Wed Oct 12, 2011 7:59 pm   

Help with Multi-Line Triggers
 
So, this is my current dilemma. I'm trying to set a trigger that will automatically execute a game command (ENEMY) on any item found within a string list that I have, when detected on WHO.

So for example, I've added Rhiarinn and Zeph to my string list

So #SHOW @enemylist
produces
Rhiarinn|Zeph

Now, I want to trigger it so when I type for example, QWHO
which provides me this :

Arica, Kando, Ithilcelu, Erwing, Ged, Mallaidh, Shlean, Thaeae, Zylo, Bryana, Medeia, Elaisa, Nuradla, Tora, Grin, Rhiarinn, Dracus, Ainsley, Sutao, Zeph, Akaxi, Gaadgoro, Haya, Renatta, Braem, Vanko, Irbe, Orsyn, Yudi.
...plus 12 more that are unseen.

It will execute ENEMY on any name found matching in my enemylist string list.

Half the problem is I don't know how to set up a multi line trigger, so that it only fires the ENEMY trigger when the condition of "...plus %d more that are unseen" is met. I obviously can't have the ENEMY trigger firing off anytime anything happens, as the only way to capture that first part of the QWHO would be (%*)

Other problem is I'm not sure how to write the script itself to enemy.

Would I #forall @enemylist {#if %pos(%i, %1) {ENEMY %i}} ?

Or am I far off the mark.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4701
Location: Pensacola, FL, USA

PostPosted: Thu Oct 13, 2011 1:16 am   
 
what you would do is something like...

#ONINPUT {qwho} {#T+ whoEnemy}
#TR "whoEnemy" {({@enemyList})} {ENEMY %1}
#TR {...plus %d more that are unseen} {#T- whoEnemy}
_________________
Discord: Shalimarwildcat
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