|
surefirewizard Newbie
Joined: 17 Jul 2008 Posts: 1
|
Posted: Thu Jul 17, 2008 3:37 am
This one should be easy for you coders - Trigger problem |
Using Zmud 7.21
Playing Avalon - The First Age
Trying to make a trigger for the following lines
Code: |
"lyre24239" a golden lyre.
"lyre9984" a divine lyre. |
Need a trigger that will capture the alphanumeric between the quotes. The spaces between the second quote and the text that follows varies and sometimes there is no space. (e.g. "chainmail12075"a suit of adamant chainmail.)
Just need to be able to distinguish between which lyre i am using by number, otherwise Avalon tends to rotate through each item of the same name but different number
{^"lyre(&%x) %s a divine lyre}
I have tried things such as above to no avail. How do I get what it captures into a variable such as @divine or @golden or am i going about this the wrong way.
Your help is greatly appreciated
surefirewizard |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu Jul 17, 2008 9:18 am |
#trig {^"lyre(%d)" a ({divine|golden}) lyre} {#var %concat(%2,"_lyre_number") %1}
|
|
|
|
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: Thu Jul 17, 2008 4:43 pm |
I think Fang missed the thing about the spaces and I've edited your post so they can now clearly be seen.
So an amendment to what Fang put is:
#trig {^"lyre(%d)"{%s|} a ({divine|golden}) lyre} {#var %concat(%2,"_lyre_number") %1}
You will need to make sure you change "Preferences\Script Parser\General Parsing\Wildcards in {} triggers" to ticked for it to work. |
|
_________________ Taz :) |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri Jul 18, 2008 10:02 am |
I actually think ^"lyre(%d)"%sa ({divine|golden}) lyre is a bit more readable, but eh.
|
|
|
|
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: Fri Jul 18, 2008 7:41 pm |
It doesn't rely on the preference setting either so it's better!
|
|
_________________ Taz :) |
|
|
|
|
|