Nested if and waiting, w/ a few variables.

Posted by Shadowspirate on Mon 24 Mar 2008 02:00 AM — 2 posts, 13,405 views.

#0
Hello, this is a new thing to me, and just need to get a little bit of help with an example so I can then work on the rest.

text to be fired upon.
Quote:
high even tone


the stuff to be done
Quote:
if flute=1 AND #if flute1=0 THEN (cover opening 1, make var flute1=1)

else
{uncover opening 1, make var flute1 0}


And then after the if/else, this will happen.
wait 4 seconds and then play flute.
Australia Forum Administrator #1
This does what you said, with Lua variables, I am not sure how "flute" gets set, but you can work on that.


<triggers>
  <trigger
   enabled="y"
   match="high even tone"
   send_to="12"
   sequence="100"
  >
  <send>
if flute == 1 and flute1 == 0 then
  Send ("cover opening 1")
  flute1 = 1
else
  Send ("uncover opening 1")
  flute1 = 0
end -- if

DoAfter (4, "play flute")
</send>
  </trigger>
</triggers>


See http://www.mushclient.com/pasting for how to paste that into the client.