|
trefen Beginner
Joined: 09 Nov 2006 Posts: 16
|
Posted: Fri Feb 06, 2009 2:02 pm
Trigger help? |
Hello folks, this post is from a novice if there ever was one, so bear with me please. I'm trying of course to write a trigger.
the trigger is designed to return gold back into my kitbag if a thief attempts to steal it.
I remove gold from kitbag and then copy and paste the result to the trigger package editor. then I read in the help files that you need to insert {%d} in place of the number of gold pieces. I have tried every combination I can think of, removing the braces, removing the %, double braces, etc. I cannot make it work. please note that I have an alias which works fine and yes, my trigger button is not off.
according to the help files, the trigger is supposed to look like this:
You get {%d} gold sovereigns from a sailor's kitbag. or you can gather from the help files: You get {d} gold sovereigns from a sailor's kitbag.
I think..... |
|
|
|
Dumas Enchanter
Joined: 11 Feb 2003 Posts: 511 Location: USA
|
Posted: Fri Feb 06, 2009 2:13 pm |
The curly braces are part of the command set. You probably want:
#TRIG {You get (%d) gold sovereigns from a sailor's kitbag.} {#EXEC {put %1 gold in kitbag}} |
|
|
|
trefen Beginner
Joined: 09 Nov 2006 Posts: 16
|
Posted: Fri Feb 06, 2009 3:07 pm |
what you've written here, can I assume I can just type this verbatim in the command line without using the Package Editor? Also, when using the Package Editor, after copying and pasting to the editor, I'm supposed to add both the curly braces and parentheses? without the #TRIG?
|
|
|
|
Dumas Enchanter
Joined: 11 Feb 2003 Posts: 511 Location: USA
|
|
|
|
trefen Beginner
Joined: 09 Nov 2006 Posts: 16
|
Posted: Fri Feb 06, 2009 3:29 pm |
Very Good Dumas....thank you sir..
However, while i was able to copy and paste to the command line, I still could not get it to work using the package editor. and I had tried the exact same commands in the package editor many times. Perhaps it has something to do with the package editor being turned off or disabled somehow? other than the pistol symbol on the bottom left of the screen?
again, thank you very much..... |
|
|
|
Dumas Enchanter
Joined: 11 Feb 2003 Posts: 511 Location: USA
|
Posted: Fri Feb 06, 2009 3:38 pm |
If you put the {} in the trigger pattern in the package editor, it won't work. Don't know if that is what you did or not.
|
|
|
|
trefen Beginner
Joined: 09 Nov 2006 Posts: 16
|
Posted: Fri Feb 06, 2009 6:01 pm |
Ok, I've also tried this:
You get %d gold sovereigns from a sailors Kitbag.
and as a response to the trigger:
Put gold in kitbag.
this doesn't work either. |
|
|
|
Dumas Enchanter
Joined: 11 Feb 2003 Posts: 511 Location: USA
|
Posted: Fri Feb 06, 2009 6:29 pm |
Can you quote the line of text you actually get from the MUD, and does the trigger try to do anything?
And you have to use #EXEC or something similiar. CMUD requires that all lines begin with a command. So for the action triggered it would be #EXEC {put gold in kitbag} with the braces |
|
|
|
Arde Enchanter
Joined: 09 Sep 2007 Posts: 605
|
Posted: Fri Feb 06, 2009 6:48 pm |
trefen wrote: |
Ok, I've also tried this:
You get %d gold sovereigns from a sailors Kitbag.
and as a response to the trigger:
Put gold in kitbag.
this doesn't work either. |
As Dumas said, open the Package editor and change the trigger pattern to:
You get (%d) gold sovereigns from a sailors Kitbag.
You need to use the parenthesizes () to store captured info. Without () CMUD will not keep %d value, that's why you get "Put gold in kitbag." out of "Put %1 gold in kitbag." - because %1 is empty. Use () around %d. |
|
Last edited by Arde on Fri Feb 06, 2009 6:51 pm; edited 1 time in total |
|
|
|
Arde Enchanter
Joined: 09 Sep 2007 Posts: 605
|
Posted: Fri Feb 06, 2009 6:50 pm |
Dumas wrote: |
#TRIG {You get (%d) gold sovereigns from a sailor's kitbag.} {#EXEC {put %1 gold in kitbag}} |
What for? You do not need to use #EXEC here. |
|
|
|
trefen Beginner
Joined: 09 Nov 2006 Posts: 16
|
Posted: Fri Feb 06, 2009 7:20 pm |
I need to clarify something....
When I copied and pasted this into the command line;
#TRIG {You get (%d) gold sovereigns from a sailor's kitbag.} {#EXEC {put %1 gold in kitbag}}
it worked! Thank you Dumas.
Now. When I copy and paste....
You get %d gold sovereigns from a sailors Kitbag.
and then ....put gold back in kitbag. into the Package Editor...it does not work.
Dumas' explanation works just fine on the command line. I just can't seem to make it work using the Package Editor. Also note, that in a previous reply to this, that Dumas told me not to use the curly braces or parentheses... |
|
|
|
Dumas Enchanter
Joined: 11 Feb 2003 Posts: 511 Location: USA
|
Posted: Fri Feb 06, 2009 7:25 pm |
Dumas wrote: |
If you put the {} in the trigger pattern in the package editor, it won't work. Don't know if that is what you did or not. |
Nope, only said the braces.
Arde, I've never been fully certain about what is acceptable or not. Why do I keep seeing solutions that reference having to begin lines with CMUD commands? I was going off this http://forums.zuggsoft.com/modules/mx_kb/kb.php?page=3&mode=doc&k=2992. |
|
|
|
Arde Enchanter
Joined: 09 Sep 2007 Posts: 605
|
Posted: Fri Feb 06, 2009 8:19 pm |
Dumas
That's because people try to start their commands with variable reference of function call - that fails in CMUD. And here the command begins with literal text to be sent to a MUD - it is OK. |
|
_________________ My personal bug|wish list:
-Wrong Priority when copy-paste setting
-1 prompt trigger for Mapper, Session and General Options, not 3 different!
-#SECTION can terminate threads
-Buttons can't start threads |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Fri Feb 06, 2009 9:45 pm |
Just to clarify, Trefen--you need to use parentheses (), not braces {}. The parentheses tell cmud that it should store whatever is captured within it into the temporary variable %1. Without the parentheses, %1 will be blank. When you first started, you were accidentally using braces instead of parentheses.
|
|
|
|
gamma_ray Magician
Joined: 17 Apr 2005 Posts: 496
|
Posted: Sat Feb 07, 2009 12:01 am |
The reason why it's not working is because you're consistently using the term "sailors kitbag" in your pattern. Dumas's trigger correctly uses "sailor's kitbag", note apostrophe.
|
|
|
|
|
|