 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Fri Apr 09, 2010 10:57 pm
Database Variable Issue |
So, the trigger captures "affects" for an "affects window" that I am making for CMUD. The pattern works, the trigger has no errors, and yet, there's an issue.
Here's the trigger:
| Code: |
<trigger name="Capture-Spells" priority="7090" regex="true" id="709">
<pattern>^Spell:\s([\w '-]+)\s+:\smodifies [\w '-]+ by \d+ for (\d+) cycles</pattern>
<value>$_spell=%trim( %1)
$_time=%2
#IF (%ismember( $_spell, @_accept_spell)) {
#IF (%iskey( @_spell_list, $_spell)) {
#VAR _spell_list.$_spell $_time
#EXEC {show_aff}
} {
#ADDKEY @_spell_list {$_spell=$_time}
#EXEC {show_aff}
}}</value>
</trigger>
|
Here's the pattern it's trying to match:
| Code: |
Spell: sanctuary : modifies none by 0 for 9 cycles, (4 1/2 hours) (6mins)
|
I used #say "Breakpoint" and found that the trigger is indeed going to the proper part, the else section of the last #IF statement, as sanctuary is in the stringlist variable it needs to be in. However, even though it goes into that else sequence, no key or value is added to the database variable, and I'm not sure why. It's all setup correctly...
EDIT:
Nevermind, apparently the @ is an improper reference to the variable. I read the helpfile and the #showdb command threw me off, I thought I had seen @db after the #ADDKEY |
|
|
|
 |
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Mon Apr 12, 2010 5:56 pm |
You should not use @ in front of _spell_list in #ADDKEY.
If you still have a problem, you could try using the following form:
| Code: |
| #ADDKEY _spell_list {$_spell} {$_time} |
|
|
|
|
 |
|
|
|
|
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
|
|