![](templates/Classic/images/spacer.gif) |
Jaiven Wanderer
Joined: 03 Oct 2007 Posts: 66
|
Posted: Wed Jun 27, 2012 1:53 am
Trigger problem for bags |
Hello, this trigger in zmud would check for crafting components and give the amount to the crafter. in cmud it is giving too little and not the correct amount
Trigger:
^ ? (%n) ? ? scraps ? a shred of (%w)
Value:
#add %2 %1
#if (@%2>=3) {#3 give %2"," stacy}
#var %2 0
line from game
[ 2 ] < scraps > a shred of charred scales |
|
|
![](templates/Classic/images/spacer.gif) |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Wed Jun 27, 2012 4:34 am |
1)Indirect variable reference MUST be enclosed in curly braces: @{%2}
2)you are using ? far too much. |
|
_________________ EDIT: I didn't like my old signature |
|
|
![](templates/Classic/images/spacer.gif) |
Jaiven Wanderer
Joined: 03 Oct 2007 Posts: 66
|
Posted: Wed Jun 27, 2012 10:50 am |
is there a better way to tell cmud to ignore [ ] < > from the mud?
|
|
|
![](templates/Classic/images/spacer.gif) |
hadar Apprentice
Joined: 30 Aug 2009 Posts: 198 Location: my apt, in california
|
Posted: Wed Jun 27, 2012 2:49 pm |
Here is way 1. only check for items currently got not how mant you have, the same way it is currently written
Code: |
<trigger priority="37930" id="3793">
<pattern>^~[ (%n) ] ~< scraps ~> a shred of (%w)</pattern>
<value>#if (%1>=3) {#loop %1 {#send "give "%2", stacy"}}</value>
</trigger>
|
Way 2 counts all "scraps" that way over time if you are only getting 1-2 once you hit 3+ it will fire
Code: |
<trigger priority="37930" id="3793">
<pattern>^~[ (%n) ] ~< scraps ~> a shred of (%w)</pattern>
<value>#add %2 %1
#if (@{%2}>=3) {#loop @{%2} {#send "give "%2", stacy"};#var %2 0}</value>
</trigger>
|
|
|
|
![](templates/Classic/images/spacer.gif) |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Wed Jun 27, 2012 6:55 pm |
You can use ~ to indicate that the next character is to be treated literally. <> are not special characters in the trigger parser, so you do not need to use ~ on them. By using ?, you are telling the trigger parser that it doesn't matter what character is there, which means you can get false-positives that mess up your script.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
![](templates/Classic/images/spacer.gif) |
Jaiven Wanderer
Joined: 03 Oct 2007 Posts: 66
|
Posted: Sat Jun 30, 2012 3:57 am |
thanks for the help guys got it working with your assistance!
|
|
|
![](templates/Classic/images/spacer.gif) |
|
|