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


Joined: 18 Jul 2007
Posts: 3

PostPosted: Sat Aug 04, 2007 1:09 am   

dynamically generated triggers or triggers to match a string list
 
Heres the data:

You still have to kill * a dog (Northstar)
You still have to kill * earthworm (Island of Lost Time)
You still have to kill * a maid (Diamond Soul Revelation)
You still have to kill * a female prisoner (Dark Elf Stronghold)
You still have to kill * The Announcer (The Tournament of Illoria)
You still have to kill * a drunk (Wedded Bliss)

i want to dynamically create triggers to color the names of all the mobs listed (dog, earthworm...etc)

I have tried something like this

each line would set off a trigger that creates a new trigger and stores the mob name in %1

#TRIGGER {%1} {#CW purple}

obviously this wont work because the %1 doesnt get expanded in for the trigger.

What i was wondering if there was an easier way to maybe have a trigger match a string list....like:

#TRIGGER {@mobs} {#CW purple}

and @mobs would be a string list of all those mentioned above.

any one have any ideas? i can't figure out a way to implement this.

thanks.
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Sat Aug 04, 2007 1:19 am   
 
Hmm, I think you could try something like this.

Code:


#trigger {You still have to kill ~* (%w)} {mobs=%additem(%1,@mobs)}



and

Code:


#trigger {@mobs} {#CW purple} {exp}



Its late and I can well be way off course but. The first trigger lets you capture the mob name into a string list called mobs provided that its always one word (=%w), if its sometimes more than one word some other wildcard would be in order, then. The second trigger is an expression trigger which searches for @mobs as "trigger incident". Once it has found it, it will color them purple.

I do guess that the purpose you're trying to make is to capture all this into a child-window and in that case I think it should be able just to capture whole line and then #cw %w=%1 of it.

I hope this helps.


Prog
Reply with quote
kuliksco
Newbie


Joined: 18 Jul 2007
Posts: 3

PostPosted: Sat Aug 04, 2007 2:05 am   
 
thanks for the quick response. hmm yea thats definitely what im trying to do. i didnt even realize there were different types of triggers. For some reason though the trigger is still not firing. I have made sure it is an expression trigger.

I was using a simple example to test it out.

a trigger called @mobs that was an expression that would #SAY testing
and @mobs was just a variable with one entry with a type of autotype (i have tried different types and string lists)

for some reason it would never fire....any ideas?
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Sat Aug 04, 2007 2:09 am   
 
Oops, Its a CMud Thread.

I don't know if it makes any difference or not but I read the question as Zmud one and replied as such. As I already mentioned, its late and I guess I didn't read the subject line as correctly as I should have been :/

Sorry.


Prog
_________________
The Proud new owner of CMud.

--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
--------------------------------
Reply with quote
Caled
Sorcerer


Joined: 21 Oct 2000
Posts: 821
Location: Australia

PostPosted: Sat Aug 04, 2007 2:27 am   
 
It shouldn't be an expression trig type. A normal trig type will work in that instance, but the pattern is also wrong.

#TR {{@mobs}} {#CW purple}

Also, in the initial trigger, use #ADDITEM, not %additem, as you do not want duplicates in the stringlist.

#TR {You still have to kill ~* (%w)} {#additem mobs %1}


To get around the "a" that is sometimes there, and sometimes not, change it to:

#TR {You still have to kill ~* (%w) (%w)} {#IF (%1 = "a") {#additem mobs %2} {#additem mobs %1}}
_________________
Athlon 64 3200+
Win XP Pro x64
Reply with quote
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Sat Aug 04, 2007 2:28 am   
 
#tr {You still have to kill ~* (%w) (} {mobs=%additem(%1,@mobs)}
#tr {{@mobs}} {#CW Purple}

You may want to use #additem alternatively, as %additem will allow duplicate entries. Also you needed {} around the variable to expand it.
Reply with quote
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Sat Aug 04, 2007 2:31 am   
 
Beat me by a minute, but you might want to change that if statement to %1 = @articlelist, articlelist being a list of articles you do not want highlighted, such as The, A, An, ect. So #var articlelist {A|An|a|an|The|the} ect
Reply with quote
kuliksco
Newbie


Joined: 18 Jul 2007
Posts: 3

PostPosted: Sat Aug 04, 2007 2:39 am   
 
you guys are flippin sweet. yea i just need the extra brackets around the variable to expand it. I still have some messin around with the additem to get it how i want it but i hopefully this should be all the info i need!
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