I tried to read the manual on the subject but I still have no idea on about it and I can't seem to find about temp timers with Lua so I'm guessing it's unique to Mudlet?
Anyway my problem is I'm making a autosipper (and herb eater, salve applier etc). I got everything working perfectly except a few times where I get stunned and messes me up. Here's part of the code I have now, which isn't working.
Code: Select all
if (CurrentHealth < SipHealth)
and (CurrentHealth > 0)
and GotElixirBal==1 then
send("sip health")
GotElixirBal = 0.5
tempTimer( 0.6, [
if GotElixirBal = 0.5 then GotElixirBal = 1]] )
The temptimer goes for 6 seconds which Elixir balance is only 5 seconds but just incase of lag. If something goes wrong and after that 6 seconds it will change it back to me having Elixir balance so I can start sipping health again.
So my question is, how do set it up so that when send the command to sip but nothing happens (possibly due to a illusion?) that it can reset. Also will it reset after I get balance back? So if I sipped and everything worked as planned and I sipped again right on 5 seconds which gives me 1 second left and I sip again, will it reset my sipping balance to true? Even though I regained it and used it again?
I hope that makes sense.