Auto-Sipper Difficulties

My trigger:

Match line - *h, *m, *e, *w *

Send to Script:

SetVariable("healthc",%1)
healthc = %1

if healthc <  healthm / 2 then
SetVariable("potbalance","false")
potbalance = "false"
Send("sip vitality")
end--if

SetVariable("manac",%2)
manac = %2

if manac <  manam / 2 then
SetVariable("potbalance","false")
potbalance = "false"
Send("sip mana")
end--if


The error message I keep getting:

[string "Trigger: "]:4: attempt to perform arithmetic on global 'healthm' (a nil value)
stack traceback:
    [string "Trigger: "]:4: in main chunk

How can I set my values to be numeric instead of string variables so I can perform math operations on them? (to determine when I'm at less than half health/mana to know when to auto-sip so I don't waste potion)

Additional question. Is there a way to check if my potion balance is up in the same line as checking health/mana values? e.g. something like:

if manac <  manam / 2 and potbalance == "true" then

EDIT - Using MUSHclient if that's important.

Comments

  • CURING ON will provide you with all the curing you could ever need.
    CURING STATUS to see all the other various things.

  • edited October 2014
    EDIT - Can't even get forum commenting right anymore. D:
  • edited October 2014
    Ugh.
  • Yeah, there's virtually no point to coding sip-related stuff, except maybe to sip through recklessness (I know SVO does it but I don't think serverside does). 
  • Serverside won't, it'll only sip during blackout (at least I think this is the case, usually I have recklessness cured while I'm off sip balance)

Sign In or Register to comment.