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
prestojosh
Beginner


Joined: 21 Feb 2006
Posts: 19

PostPosted: Sun Sep 24, 2006 3:32 am   

Making a trigger from a trigger? Doable?
 
Okay heres the situation.. hosting a bot but wanna be able to make a trigger remotely instead of re-doing it firsthand.

So I tell it a codeword and the trigger and I want it to add it to that bot's file.

Example
Tell Bot doatrigger #TRIGGER {someone walks by} {emote jumps for joy!}

So when it sees 'someone walks by', the bot would obviously do an emote jumping for joy, etc.

Just wondering if this is doable or not.. couldn't find anything when I searched just a bunch of stuff asking about playing zmud on remote connection.
_________________
-Presto
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Sun Sep 24, 2006 7:38 pm   
 
Yes, it is doable, but if you start getting a little more advanced than your example here, you'll need to take special considerations. For example, if you want your created trigger to reference captured wildcard values, you'll have to use %%1 when you create it, which tells zMUD to create the trigger with %1 rather than substituting the value right away and creating the trigger with that value.
Reply with quote
prestojosh
Beginner


Joined: 21 Feb 2006
Posts: 19

PostPosted: Mon Sep 25, 2006 6:48 am   
 
Okay, so in my example how would you do the trigger? Because the one I have doesn't work.
_________________
-Presto
Reply with quote
edb6377
Magician


Joined: 29 Nov 2005
Posts: 482

PostPosted: Mon Sep 25, 2006 7:58 am   
 
also keep in mind that you will need to be especially careful of people abusing things like this if you arent careful.
_________________
Confucious say "Bugs in Programs need Hammer"
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Tue Sep 26, 2006 12:19 pm   
 
I think I misunderstood initially what you wanted to do. Having re-read your first post, I'm guessing that you want to execute a script in another session from your own session by sending the code to a bot in a tell? It can be done, and that's the real danger in using a %* wildcard. If you search the forums for the use of this wildcard, you'll learn why it can be a bad thing. However, if you have faith that no one else will abuse it (or you build in failsafes to make sure you're the one sending the code to the bot), then it might be done something like this:

Code:
#TRIGGER {%w tells you, "(%*)"} {#exec {%1}}
Reply with quote
prestojosh
Beginner


Joined: 21 Feb 2006
Posts: 19

PostPosted: Tue Sep 26, 2006 3:09 pm   
 
That didn't work either.

Character tells you 'makeatrigger #TRIGGER {^Character tells you 'haha'} {reply boooooo!}'

Would be what it triggers on, I need it to make the trigger of
{^Character tells you 'haha'} {reply boooooo!}'

Any ideas?
_________________
-Presto
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Tue Sep 26, 2006 6:47 pm   
 
Code:
#TRIGGER {%w tells you 'makeatrigger (%*)'$} {#exec {%1}} "" {notrig}


That worked when I tested it offline using
Code:
#SHOW "Bob tells you 'makeatrigger #TRIGGER {%w tells you 'haha'} {reply booooo!}'"
Reply with quote
prestojosh
Beginner


Joined: 21 Feb 2006
Posts: 19

PostPosted: Wed Sep 27, 2006 11:10 pm   
 
Indeed that does work thanks bundles!
_________________
-Presto
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