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
albo
Apprentice


Joined: 27 Mar 2008
Posts: 106

PostPosted: Tue Sep 27, 2011 1:42 am   

trigger pattern containing a stringlist.
 
Code:
<trigger priority="10330" id="3911">
  <pattern>%1  is here, fighting (mighty white stallion|personal bodyguard of Al'collabo|child of the light)</pattern>
  <value>#class raisingskill 0
#class raisingwalk 0
#suspend rasing</value>
</trigger>



Okay so when I type the command 'look' sometimes a mobile is fighting one of my minions. I usually have 3 different minions with me at any given time. When I see this, I would like for this trigger to suspend the alarm and stop the alarm from performing its next predefined action.

Those are the three minions I keep with me. Is that the way the trigger should work, or is there a much cleaner more efficient way?

Thanks ahead of time.



P. S. Is anyone else having serious problems with the website? It wants me to log in every time I try to do something and is becoming seriously aggravating.
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Tue Sep 27, 2011 2:59 am   
 
You'll need braces around the list, not parentheses. As a side note, you shouldn't put %1, %2, etc. in the pattern, use one of the wildcards instead - there's a great guide on pattern matching here (it explains the string lists too Very Happy).
Reply with quote
albo
Apprentice


Joined: 27 Mar 2008
Posts: 106

PostPosted: Fri Sep 30, 2011 9:31 pm   
 
I need some more help with this trigger.

See when I am out and about fighting, other players are as well and I would like for my trigger there to be able to tell the difference between another player and myself and minions.

Any help with this?

Code:
<trigger priority="10330" enabled="false" id="3879">
  <pattern>~(Ogier|Aiel|Player|Trolloc~) %w  is here, fighting %w</pattern>
  <value>#exec %pop(cowmobnow)</value>
</trigger>


Okay, before the (Ogier|etc..) part of a player in the MUD world are (Buff) (Buff) (M or F) (even match) (Race, or Ogier|Aiel|etc..)

I'm stumped.

Edit:
This is what a player looks like in the MUD world.
Code:
(Steely Aura) (F) (even match) (Player) Solange  is here.


Some of them may look like this due to different buffs...

Code:
(Translucent) (Steely Aura) (F) (even match) (Player) Solange  is here.
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Sat Oct 01, 2011 12:38 am   
 
So you just need to match if (Player) is there or not? That's simple enough, just use a list with an empty value. Something like this: {~(Player~)|}.
Reply with quote
albo
Apprentice


Joined: 27 Mar 2008
Posts: 106

PostPosted: Sat Oct 01, 2011 12:45 am   
 
Code:
<trigger priority="10330" enabled="false" id="3879">
  <pattern>%1 {~(Ogier~)|~(Aiel~)|~(Player~)|~(Trolloc~)} %w  is here, fighting %w</pattern>
  <value>#exec %pop(cowmobnow)</value>
</trigger>


Like that?
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Sat Oct 01, 2011 2:10 am   
 
Looks fine to me. You still have %1 in the pattern though, I mentioned above that should be avoided.
Reply with quote
albo
Apprentice


Joined: 27 Mar 2008
Posts: 106

PostPosted: Sat Oct 01, 2011 2:30 am   
 
will %w pick up the:

Code:
(Translucent) (Steely Aura) (F) (eve match)



Does it even need to?
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Sat Oct 01, 2011 2:46 am   
 
No, %w matches a word, only letters. It won't match spaces or parentheses. You could use something like ~(%w~) to match any of those though.
Reply with quote
albo
Apprentice


Joined: 27 Mar 2008
Posts: 106

PostPosted: Sat Oct 01, 2011 2:47 am   
 
well, I think I may have gotten a trigger to work that is doing exactly like I wanted to.

Code:
<trigger name="experimenting" priority="10331" id="3976">
  <pattern>%w is here, fighting %w</pattern>
  <value>#if ({~(Ogier|Aiel|Player|Trolloc~)}=%1) {#exec %pop( cowmobnow)} {#T- cowrunkill
#T- cowrunwalk
#suspend cowrun}</value>
</trigger>


So far when I look at see my minions fighting, the trigger is making sure I stay put until all mobiles are dead. I havn't come across another player during my travels yet..I have a good feeling about it though.
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