|
chadvdb Newbie
Joined: 06 Aug 2017 Posts: 9
|
Posted: Fri Jan 31, 2020 8:11 pm
#cond |
Greetings,
I am using a VAR and setting it to 0 or 1 and using it in an IF statement in a trigger to insert a battery into my flashlight.
My flashlight has a charge remaining which shows as | Ch:&charge% |. The if will go off when @charge is less than 2
and @recharge is 1. It will then send "insert battery" and set recharge to 0. This is in case lag occurs and I have multiple
instances of @charge being less than 1 before "insert battery" so I'm not having "insert battery" sent multiple times. I
have another trigger "You insert a new battery into your flashlight." that will reset recharge back to 1 allowing other trigger's
if statement to work again when @charge gets down to below 2 again. This works, but I keep seeing posts about multistate
triggers and #cond. I've tried selecting my triggers and adding a new multistate, removing the @recharge var from first
trigger's if statement. The new multistate I put in is the other trigger I used showing I had inserted a new battery. From
what I've read in the help files and on the forums, the first trigger won't go off again until the second trigger goes off.
Problem I'm finding is the first trigger isn't going off at all. The @charge variable isn't updating so the if statement will
never go off. The @charge variable works until I add the second state to that trigger. Any advice will be appreciated.
Thank you. |
|
|
|
chadvdb Newbie
Joined: 06 Aug 2017 Posts: 9
|
Posted: Sat Feb 01, 2020 1:09 am |
Think I see my issue, as soon as the trigger to gather the charge var fires it is no longer functioning, but looking for the next trigger to fire. So using the trigger to update that variable and do the if statement won't work as I'd like.
If anyone sees a more efficient way to do this feel free to comment. Won't hurt my feelings. :)
Thanks. |
|
|
|
chadvdb Newbie
Joined: 06 Aug 2017 Posts: 9
|
Posted: Sat Feb 01, 2020 1:45 am |
Figured it out. I needed #state 0 in the if statement if it failed. Works great so far.
|
|
|
|
|
|