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


Joined: 24 Dec 2005
Posts: 4
Location: Northern Ireland

PostPosted: Sat Feb 11, 2006 12:17 am   

Trigger Abuse!
 
Hi there,

Ok I have a trigger, I'll simplify it to this so it's easier for me to explain...


#TRIGGER {^(*) looks at you.$} {flex;say hello %1}


Now, if someone wants to act the monkey and spam the "look" command at me, I've obviously run into a problem here. What I need, if someone could be so helpful Wink is something to make it so after the trigger fires, it will be unable to do so again until perhaps a tick or two has elapsed, thus preventing someone from abusing my obvious lack of talents with triggers Smile ... if that makes any sense you're a better person than me heehee!!


Thanks again!

P.S. If you could show me what the completed trigger would look like so I can enter it in the command prompt, I would be most greatful Very Happy
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Feb 11, 2006 12:49 am   
 
#variable AlreadyGreeted {} {} "leave blank to put it in the NONE folder or type the full folder name and path (ie, System|Automapper)"
#if (%ismember(%1,@AlreadyGreeted)) {} {flex;say hello %1;#additem AlreadyGreeted %1}

EDIT: the above will prevent you from flex-greeting the same person more than once per connected session.
_________________
EDIT: I didn't like my old signature
Reply with quote
xenapan
Wanderer


Joined: 26 May 2004
Posts: 68

PostPosted: Sat Feb 11, 2006 1:07 am   
 
or you could use
#t- (your greeting trigger class)
#wa and put in
#t+ (same as above)
that turns it off for however many seconds you choose after you greet anyone. minor thing is it prevents it from working whenever one person does it.
_________________
Player on Realms of Despair. realms.game.org port 4000. Join us today!
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Feb 11, 2006 5:29 am   
 
never use #WAIT in a trigger. All your triggers and maybe your aliases and everything else actually stop working, not just the one with the #WAIT in it.
_________________
EDIT: I didn't like my old signature
Reply with quote
Vorax
Apprentice


Joined: 29 Jun 2001
Posts: 198
Location: USA

PostPosted: Sat Feb 11, 2006 6:22 am   
 
You can also try this:
Code:
#TRIGGER "LookTrigger" {^(*) looks at you.$} {
flex
say hello %1
#T- LookTrigger
#ALARM "LookTriggerAlarm" +45 {#T+ LookTrigger}
}

What this does is disables the alarm after the action as been performed and creates an alarm that will enable the trigger again after 45 seconds. You can increase or decrease the amount of time as you desire by changing the"45" to however many seconds you want it to wait.
Reply with quote
xenapan
Wanderer


Joined: 26 May 2004
Posts: 68

PostPosted: Sat Feb 11, 2006 7:09 am   
 
MattLofton wrote:
never use #WAIT in a trigger. All your triggers and maybe your aliases and everything else actually stop working, not just the one with the #WAIT in it.


are you 100% sure? i just tried typing in my command line #wa 100000;grin *hit enter at this point*
nod, it sent and nodded. still no grin. i logged in another character and fired a trigger. nothing stopped working till the grin. a minute and a bit later, i get the grin... everything between hitting enter after the original worked in normal timing, then after it waited.. the grin came.

not sure where you get that idea from (ive had #wa in at least a dozen or so triggers for at least 2 years now) never had anything of the sort happen to me.
_________________
Player on Realms of Despair. realms.game.org port 4000. Join us today!
Reply with quote
mr_kent
Enchanter


Joined: 10 Oct 2000
Posts: 698

PostPosted: Sat Feb 11, 2006 7:38 am   
 
xenapan wrote:
not sure where you get that idea from (ive had #wa in at least a dozen or so triggers for at least 2 years now) never had anything of the sort happen to me.


That is Zugg's directive as found near the bottom of this page.
Reply with quote
xenapan
Wanderer


Joined: 26 May 2004
Posts: 68

PostPosted: Sat Feb 11, 2006 5:05 pm   
 
wow. heh. i guess i dont keep up much cause im busy mudding! that said.. now im intrigued why mine works fine.
_________________
Player on Realms of Despair. realms.game.org port 4000. Join us today!
Reply with quote
Istroath
Novice


Joined: 11 Feb 2005
Posts: 39

PostPosted: Sat Feb 11, 2006 7:13 pm   
 
#TRIGGER {^(*) looks at you.$} {flex;say hello %1;look %1;#ALARM +60 {#T+ LookedatTrigger};#T- LookedatTrigger} LookedatTrigger


best to make the trigger turn itself off and create an alarm to turn it back on after about a min or so. as if someone wants to kill you they just have to 10look you 10look you 10look you and your client well start to work overtime as your trigger well be fireing all the time even though its not sending any commands as the if in the trigger matches but none the less you computer is working overtime makeing the decision wether not todo something or not. hense best to turn the trigger off and save your cpu for otherthings. these triggers are realy just for fun anyway so if it dosent fire for everyone no big deal right? but sometimes the people looking at you arnt so much fun to play with so lets not give them a tool to help them kill you imho anyway.
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Mon Feb 13, 2006 5:46 pm   
 
I would just use a simple two state trigger with a wait second for the second one. It's more reliable than alarms and easy enough to code.

Code:
#TRIGGER {^(*) looks at you.$} {flex;say hello %1}
#COND {} {} {wait|param=2000}


If you want to track which person greeted you and ignore only that one, then you'll need to use the earlier suggestions. I just thought I'd put this out there for future reference on other scripts.
Reply with quote
Alcaeus
Newbie


Joined: 24 Dec 2005
Posts: 4
Location: Northern Ireland

PostPosted: Tue Feb 14, 2006 5:12 pm   
 
Hello again and thanks very much for all the help ... but Embarassed

As I explained initially, I had problems with childish individuals spamming 'look' at me, thus firing off my trigger, which proved to be a nuisance. I thought that showing a simple trigger would help me explain better what I needed and it has to an extent. However, not realising that the #WAIT command creates problems of its own, I left that part out. My trigger basically looked like this when I first created it...

Code:
#TRIGGER {^(*) looks at you.$} {
emote gets a 'BIG' toy from a runed satchel.
#WAIT 1000
emote plays with a 'BIG' toy.
#WAIT 2000
emote puts a 'BIG' toy in a runed satchel.
#WAIT 1000
pmote looks up at %1 and winks.
}


I created it this way so it wouldn't fire off so quickly. I've pretty much worked around it but I've had to use 2 triggers...

Code:
#TRIGGER "LookTrigger" {^(*) looks at you.$} {
pmote looks up at %1 and winks.
#T- LookTrigger
#ALARM "LookTriggerAlarm" +30 {#T+ LookTrigger}
}


The command
Quote:
pmote looks up at %1 and winks.
would then create the following feedback, 'Lamant looks up at <whoever looked at my character> and winks.' So using this, I created another trigger to fire the rest of the trigger off...

Code:
#TRIGGER {^Lamant looks up at (*) and winks.$} {
#WAIT 1000
emote gets a 'BIG' toy from a runed satchel.
#WAIT 1000
emote plays with a 'BIG' toy.
#WAIT 2000
emote puts a 'BIG' toy in a runed satchel.
}


Sorry to be a nuisance myself, though I should have presented my original trigger in the first place, but is there anyway I could simplify this into one trigger the way it was initially or am I pretty much stuck with these two. They work fine, but with me I know there is always room for improvement Smile

Thank you all once more for the time and effort you put into helping me out here.
_________________
until next time,
Devoted roleplayer on Abysmal Realms...

realms.reichel.net port 4000

... come get your game on!
Reply with quote
JQuilici
Adept


Joined: 21 Sep 2005
Posts: 250
Location: Austin, TX

PostPosted: Tue Feb 14, 2006 5:41 pm   
 
It looks like you've switched the order of your emotes between examples (the wink comes LAST, right?). Regardless, something like the following should work for ANY series of time-delayed emotes. Just create a separate (temporary) alarm for each message, with staggered delays:

Code:
#TRIGGER "LookTrigger" {^(*) looks at you.$} {
#ALARM +1 {emote gets a 'BIG' toy from a runed satchel.}
#ALARM +2 {emote plays with a 'BIG' toy.}
#ALARM +3 {emote puts a 'BIG' toy in a runed satchel. }
#ALARM +4 {pmote looks up at %1 and winks.}
#ALARM "LookTriggerAlarm" +30 {#T+ LookTrigger}
#T- LookTrigger
}

Tested this code offline and, yes, it sends each message 1 sec apart, and disables the trigger for 30 secs.
Reply with quote
Alcaeus
Newbie


Joined: 24 Dec 2005
Posts: 4
Location: Northern Ireland

PostPosted: Tue Feb 14, 2006 6:31 pm   
 
jquilici wrote:
It looks like you've switched the order of your emotes between examples (the wink comes LAST, right?).


Yeah, I had to put the pmote first the way I finalized that trigger otherwise it wouldn't fire properly and show who I was winking at.

I've fixed the trigger to the way you've presented it and it works just sweet. Very Happy I'm well impressed!!

Thanks again to everyone for your time and patience in helping out here. I've learned something new today Very Happy
_________________
until next time,
Devoted roleplayer on Abysmal Realms...

realms.reichel.net port 4000

... come get your game on!
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Tue Feb 14, 2006 8:07 pm   
 
Follow Larkins example of a multistate trigger. Its clean, simple, and won't be fired repeatedly

#TRIGGER {^(*) looks at you.$} {flex;say hello %1}
#COND {} {emote does something} {wait|param=2000}
#COND {} {emote does something else} {wait|param=2000}
#COND {} {emote another something} {wait|param=2000}
#COND {} {emote crys.} {wait|param=2000}
#COND {} {#NOOP 30 minute wait} {wait|param=1800000}
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Alcaeus
Newbie


Joined: 24 Dec 2005
Posts: 4
Location: Northern Ireland

PostPosted: Tue Feb 14, 2006 10:56 pm   
 
Heya guys 'n gals,

I got my trigger sorted and it looks like this...

Code:
#TRIGGER "LookTrigger" {^(*) looks at you.$} {
#ALARM +1 {emote gets a 'BIG' toy from runed satchel.}
#ALARM +2 {emote plays with a 'BIG' toy.}
#ALARM +3 {emote puts a 'BIG' toy in runed satchel.}
#ALARM +4 {pmote looks up at %1 and winks.}
#ALARM "LookTriggerAlarm" +30 {#T+ LookTrigger}
#T- LookTrigger
}


I tried it with the #COND command and it doesn't work properly as in when I pmote, it comes back with 'Lamant looks up at and winks.' instead of 'Lamant looks up at <character who looked at him> and winks.' Though this is what my trigger looked like when I used the #COND command.

Code:
#TRIGGER {^(*) looks at you.$} {}
#COND {} {emote gets a 'BIG' toy from runed satchel.} {wait|param=1000}
#COND {} {emote plays with a 'BIG' toy.} {wait|param=1000}
#COND {} {emote puts a 'BIG' toy in runed satchel.} {wait|param=2000}
#COND {} {pmote looks up at %1 and winks.} {wait|param=1000}
#COND {} {#NOOP 5 minute wait} {wait|param=300000}


Perhaps I did something wrong Embarassed so I'm posting it just to see if that's the case. I did read in the zMUD help files under 'Trigger States' something about multi-state triggers not being able to handle wild cards in the pattern. I couldn't make head nor tail of it though Laughing (Sorry Zugg, I'm getting there slowly but surely heehee) It works a treat with the #ALARM command in it and doesn't actually fire repeatedly, just the once within the time period I have alotted it. Thanks once more for all your help everyone Smile
_________________
until next time,
Devoted roleplayer on Abysmal Realms...

realms.reichel.net port 4000

... come get your game on!
Reply with quote
JQuilici
Adept


Joined: 21 Sep 2005
Posts: 250
Location: Austin, TX

PostPosted: Tue Feb 14, 2006 11:32 pm   
 
Haven't tested this, but try your CONDs using %t1 in place of %1, and it should work. The %t<n> variables let you refer to the <n>th pattern matching variable captured by ANY state of a multi-state trigger.
_________________
Come visit Mozart Mud...and tell an imm that Aerith sent you!
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