|
Kyote Novice
Joined: 13 Jan 2002 Posts: 36 Location: USA
|
Posted: Tue Feb 25, 2003 3:11 am
creating #temp triggers? |
I want to make a temp trigger using the contents of a variable. This trigger will be created using another characters name when they give me something. This doesn't work
#temp {@playername bows to you.} {say hello}
This isn't the actual code but what I want is for the @playername to be expanded to the contents of the variable and make it be like this
Telemon bows to you.
so that the trigger fires on the above.
Can this be done and if so how?
One more thing. Can triggers be created in a particular class(folder) using #temp? If so how?
Kyote |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Tue Feb 25, 2003 5:11 am |
quote:
I want to make a temp trigger using the contents of a variable. This trigger will be created using another characters name when they give me something. This doesn't work
#temp {@playername bows to you.} {say hello}
This isn't the actual code but what I want is for the @playername to be expanded to the contents of the variable and make it be like this
Telemon bows to you.
so that the trigger fires on the above.
Can this be done and if so how?
One more thing. Can triggers be created in a particular class(folder) using #temp? If so how?
Kyote
This might be related to the expansion/parsing bug for variables, but otherwise you might want to check out commands like #EXEC or #EXPAND and related functions.
li'l shmoe of Dragon's Gate MUD |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Feb 25, 2003 5:30 am |
quote: This isn't the actual code
Why not? It's almost always easier to solve the real problem than a made-up one. What deep, dark secret are you afraid of giving away by telling us the real patterns you want to match and the real actions you want to take?
#TR {(%w) gives you} {#TEMP {%1 bows to you} {say hello}}
LightBulb
Advanced Member |
|
|
|
Kyote Novice
Joined: 13 Jan 2002 Posts: 36 Location: USA
|
Posted: Tue Feb 25, 2003 8:49 pm |
quote:
quote: This isn't the actual code
Why not? It's almost always easier to solve the real problem than a made-up one. What deep, dark secret are you afraid of giving away by telling us the real patterns you want to match and the real actions you want to take?
No deep dark secrets Mate. LOL!! It's just that I have alot of things interacting with each other and didn't want to take the time to hunt all the pertinent info down. I just needed help with expanding this variable so that the temp trigger I was creating was specific to the situation.
Here's the idea explained a little better, I hope.
worth
You currently have 100 gold and 5400 silver.
#TR {You currently have (%d) gold and (%d) silver.} {#VA tempgold %1;#IF (@totalgold <> 0) {#VA totalgold @tempgold}}
Telemon says 'I want to play the Lottery'
#TR {(%w) says 'I want to play the Lottery'} {#VA playername %1;worth;#TEMP {@playername gives you 1 gold.} {worth;#WA;#IF (@tempgold == (@totalgold + 1)) {say Thank you for playing the Lottery. Your name will be added to the drawing. Good Luck!!;#VA totalgold 0} {say Sorry, but you didn't actually pay the fee so your name will not be added to the drawing.;#VA totalgold 0}}}
Okay. I'm doing this from memory right now as I'm at school and don't have my actual files on hand. Also, could someone answer the second half of my question? Which was can I create the temp trigger in a class folder? And if so how?
Thanks for all the help. And thank you MattLofton. I will look up those commands you suggested. I appreciate the information.
Kyote |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Feb 26, 2003 6:05 am |
Missed that second question, but it's easy so I'll answer it first. Yes, triggers can be created in a particular class with #TEMP in precisely the same way they can be with #TR.
#TEMP [id] {pattern} {commands} {class} {options}
For your actual application, it would be better to make the temp trigger with %1. You probably need some other changes too. If I followed the logic correctly, your current script will only work when you actually have exactly 0 gold before someone pays.
#TR {You currently have (%d) gold and (%d) silver.} {#MATH goldchange (%1 - @totalgold);#VAR totalgold %1}
#TR {(%w) says 'I want to play the Lottery'} {#VA playername %1;worth;#TEMP {%1 gives you 1 gold.} {worth;#ALA +1 {#IF (@goldchange = 1) {say Thank you for playing the Lottery. Your name will be added to the drawing. Good Luck!!} {say Sorry, but you didn't actually pay the fee so your name will not be added to the drawing.}}}}
LightBulb
Advanced Member |
|
|
|
Kyote Novice
Joined: 13 Jan 2002 Posts: 36 Location: USA
|
Posted: Wed Feb 26, 2003 6:35 am |
Thanks for the feedback on creating temp triggers in specific classes Mate. I appreciate the help. As to the other, I'll look it over. Thanks for all your help.
------------
Kyote |
|
|
|
|
|