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
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Mar 27, 2002 11:00 pm   

Translation via triggers
 
A start for you...

#VAR SpellWordList {dkescstral|dfgdfke|qwerty}
#VAR SpellNames {given example|made up example1|made up example2}
#TR {%w says '(%w)'$} {#IF (%ismember("%1",@SpellWordList)) {#SUB {%concat(%left(%trigger,%pos(%trigger,"'")),%ansi(ColorNameHere),%item(SpellNames(%ismember("%1"@SpellWordList),%ansi(NormalColorHere),"'")}}

Alright more then a start, check for tyops on my part. Then you have to fill in the color names, and populate the 2 spell lists. You can test the whole thing with the commands...
#SHOW Vijilante says 'dkescstrl'
#SHOW Vijilante says 'dfgdfke'
#SHOW Vijilante says 'qwerty'
Reply with quote
Rowene
Beginner


Joined: 11 Jan 2002
Posts: 27
Location: United Kingdom

PostPosted: Wed Apr 24, 2002 4:58 pm   
 
Can anyone finish this trigger off?

I have tried for several hours to fix the code submitted, but it appears beyond my abilities

The main problem appears to be a mismatch in the number of brackets used - there being far more open than closed.

The best i managed was to get it to print '#if' - that was before I crashed ZMud with what apppeared to be an inifinite loop.
Reply with quote
Sildaren
Wanderer


Joined: 19 Jul 2001
Posts: 59
Location: Germany

PostPosted: Wed Apr 24, 2002 6:46 pm   
 
#CLASS SpellReplace
#VAR SpellWordList {dkescstral|dfgdfke|qwerty}
#VAR SpellNames {given example|made up example1|made up example2}
#TR { says '(%w)'$} {#VAR SpNum %ismember( "%1", @SpellWordList) {} {SpellReplace};#IF (@SpNum>0) {#SUB {%concat(" says '", %ansi( bold, blue), %item( @SpellNames, @SpNum), %ansi(green), "'")}}}
#CLASS 0
seems to work with
#SHOW Vijilante says 'dkescstral'
#SHOW Vijilante says 'dfgdfke'
#SHOW Vijilante says 'qwerty'

(tested offline with v6.26a)
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Apr 24, 2002 10:10 pm   
 
Yep, looks like Sildaren found all my typos, and made it a little prettier.
Reply with quote
Carabas
GURU


Joined: 28 Sep 2000
Posts: 434
Location: USA

PostPosted: Thu Apr 25, 2002 4:45 am   
 
Sildaren! You seem to be active again. Go tap Zugg or Darker on the back and get you Guru logo back!


Carabas
------
I like work; it fascinates me. I can sit and look at it for hours.
- Jerome K. Jerome
Reply with quote
Rowene
Beginner


Joined: 11 Jan 2002
Posts: 27
Location: United Kingdom

PostPosted: Thu Apr 25, 2002 10:04 am   
 
Many thanks for the help.

I have mod'fied the code to meet my own, and the muds requirements, but as per usual have run into another problem, several of the spells have two words (an example is given in the script below) with healing/harm spells being particularly nasty in the sense that the first word is always the same, ie judicandus = cure, the second word being light, serious, critical etc...

so can anyone mod the script below to take this into account?

#CLASS {SpellReplace}
#VAR SpellWordList {sraojz|abrazak|noselacri|yazfuz yucandus}
#VAR SpellNames {Plague|Armor|Blindness|Faerie Fire}
#VAR SpNum {} {}
#TRIGGER {^(&spellcaster) utters '(&spellgibberish)'.$} {#cw 79;#If (@spellgibberish %ismember( "%1", @SpellWordList)) {} {SpellReplace};#IF (@SpNum>0) {#SUB {@spellcaster %concat("utters '", %item( @SpellNames, @SpNum), "'")}}} "" {disable}
#CLASS 0

Thanks in advance....
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Apr 25, 2002 11:34 am   
 
First you should read the help more carefully. Many oth the changes you made simply disable the whole thing.

#CLASS {SpellReplace}
#VAR SpellWordList {sraojz|abrazak|noselacri|yazfuz yucandus}
#VAR SpellNames {Plague|Armor|Blindness|Faerie Fire}
#VAR SpNum {} {}
#TRIGGER {^&{spellcaster} utters '&{spellgibberish}'.$} {#cw 79;SpNum=%ismember( @spellgibberish, @SpellWordList);#IF (@SPNum) {#SUB {%concat(@spellcaster, " utters '", %item( @SpellNames, @SpNum), "'")}}} "" {disable}
#CLASS 0

Now the COLORWORD probably will not work, but I don't feel like testing it. Feel free to put the %ansi back in to get the proper coloring.
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