Hello!
Can't get a simple if-script to work and I can't work out where I am doing it wrong.
First, two aliases to set a variable on/off which seems to work as intented.
First one:
world.setVariable( "Healing", "true" );
Second one:
world.setVariable( "Healing", "false" );
No problems there.
My script:
I tried to use the example from the documentation and simply switching 'MyName' as the example was and use Healing (as that is the variable I use)
I've tested this and no matter if the variable is true or false, I only get the world.note to fire and never the execute.
'hon' is the alias to set the Healing variable to true
TRACE: Matched alias "hon"
paralysed.
TRACE: Matched trigger "^paralysed."
Healing is disabled
What am I doing wrong here?
Can't get a simple if-script to work and I can't work out where I am doing it wrong.
First, two aliases to set a variable on/off which seems to work as intented.
First one:
world.setVariable( "Healing", "true" );
Second one:
world.setVariable( "Healing", "false" );
No problems there.
My script:
<triggers>
<trigger
enabled="y"
match="^paralysed."
regexp="y"
send_to="12"
sequence="100"
>
<send>var Healing;
Healing = world.GetVariable("Healing");
if (Healing == true)
world.Execute("heal me paralysis");
else
world.note("Healing is disabled");</send>
</trigger>
</triggers>I tried to use the example from the documentation and simply switching 'MyName' as the example was and use Healing (as that is the variable I use)
I've tested this and no matter if the variable is true or false, I only get the world.note to fire and never the execute.
'hon' is the alias to set the Healing variable to true
TRACE: Matched alias "hon"
paralysed.
TRACE: Matched trigger "^paralysed."
Healing is disabled
What am I doing wrong here?