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
Shadow-Cat
Newbie


Joined: 27 Feb 2006
Posts: 7

PostPosted: Mon Jun 19, 2006 2:27 pm   

Trigger help
 
I haven't a clue on triggers, but I need to make a trigger that takes what a person says, scans it for specific words (namely swear words) then executes a series of commands...
tell person Watch out, swearing isn't allowed here. If you aren't careful and imm will mute you.
who
holler it wasn't me.

get the idea?

Please let me know if someone can do this for me

Thanks
Reply with quote
shalimar
GURU


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

PostPosted: Mon Jun 19, 2006 6:42 pm   
 
#TR {(%w) {says|asks|exclaims}, "(*)"} {name=%1}
#COND {{@swearwords}} {tell @name Watch out, swearing isn't allowed here. If you aren't careful and imm will mute you.;who;holer it wasn't me} {reparse}

This should work, but im not at home to test.
_________________
Discord: Shalimarwildcat
Reply with quote
Shadow-Cat
Newbie


Joined: 27 Feb 2006
Posts: 7

PostPosted: Sat Jun 24, 2006 11:37 pm   umm
 
How do I tell zmud what the swear words are[/quote]
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Sun Jun 25, 2006 3:17 pm   
 
#var swearwords {SWEAR|WORDS|GO|HERE}
_________________
http://www.Aardwolf.com
Reply with quote
Shadow-Cat
Newbie


Joined: 27 Feb 2006
Posts: 7

PostPosted: Fri Jun 30, 2006 9:14 pm   
 
I tested it, and it didn't work, is there something I did wrong?

#TR {(%w) {says|asks|exclaims|hollers}, '(*)'} {name=%1}
#COND {{@swearwords}} {tell @name Watch out, swearing isn't allowed here. If you aren't careful and imm will mute you.;who;holer it wasn't me} {reparse}
#VAR swearwords {SWEAR|WORDS|ARE|HERE}

This is what I copy and pasted (except I added in about 10 swear words).

Did I mess something up?
Reply with quote
Reygar
Novice


Joined: 22 Aug 2004
Posts: 32

PostPosted: Sat Jul 01, 2006 2:13 am   
 
Can you paste some lines directly from the mud? The pattern might be off for the trigger.
Reply with quote
mr_kent
Enchanter


Joined: 10 Oct 2000
Posts: 698

PostPosted: Sat Jul 01, 2006 6:54 am   
 
Depending on how exact(how many words you want to list) you want your trigger to be, one of these should work.

This one will fire on every instance of the word even if it is embedded in or a valid portion of another word. ie. ASSassin. But, it will catch compound-word f-bombs for instance.

Code:
#TRIGGER "SwearCatcher" {(%w) {says|asks|thinks|exclaims|hollers}*{@swearwords}*} {tell %1 Watch out, swearing isn't allowed here. If you aren't careful an Imm will mute you.;who;holler It wasn't me!} "" {prompt|notrig}


This second one will only fire on exact matches of the words you have listed, so compound words would need to be added explicitly.

Code:
#TRIGGER "SwearCatcher" {(%w) {says|asks|thinks|exclaims|hollers}*%q{@swearwords}%q*} {tell %1 Watch out, swearing isn't allowed here. If you aren't careful an Imm will mute you.;who;holler It wasn't me!} "" {prompt|notrig}


Here is an alias to add new words to the swearwords variable. For some reason, adding words to the stringlist variable in the settings editor doesn't work for triggering immediately. Using #ADDITEM seems to work fine.

Code:
#ALIAS addnewswearword {#ADDITEM swearwords %1}


If you use the alias, the alias name should really be changed to something shorter but easy to remember. It's much too long to type everytime, but written as for clarification.

Edit: Added hollers to communication list. Fixed grammatical errors. Added note about alias name.


Last edited by mr_kent on Sun Jul 02, 2006 6:31 pm; edited 1 time in total
Reply with quote
Shadow-Cat
Newbie


Joined: 27 Feb 2006
Posts: 7

PostPosted: Sat Jul 01, 2006 9:37 pm   
 
Mordiara hollers, 'Interesting'
Mordiara hollers, 'testing'
Mordiara hollers, 'testing this is a test line'
Shar hollers, '-= yeah, but the xp is in direct relation to how much damage you do. =-' [IC-RP]


There's a couple of lines... any ideas?
Reply with quote
mr_kent
Enchanter


Joined: 10 Oct 2000
Posts: 698

PostPosted: Sun Jul 02, 2006 6:34 pm   
 
I edited my previous post to trigger on the examples given.
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