Hello all, I'm very new to MUSH and MUDs in general, and I've never programmed, so I'm having a bit of trouble making this basic group of triggers and aliases working properly. Here goes
Trigger:
^(\d+)h, (\d+)m, \d+e, \d+w ([cexkdb@]*)-
Executes:
SetVariable("currenthealth", %1)
SetVariable("currentmana", %2)
Execute("HEAL")
Execute("LIMBS")
Trigger:
^Health:\s+\d{1,4}\s/\s(\d{4})\s{5}Mana:\s+\d{1,4}\s/\s(\d{4})$
Executes:
SetVariable("maxhealth", %1)
SetVariable("maxmana", %2)
SetVariable("siphealth", %1-750)
SetVariable("sipmana", %2-550)
SetVariable("mosshealth", %1-1100)
SetVariable("mossmana", %2-1600)
Alias:
HEAL
Executes:
local currenthealth = GetVariable("currenthealth")
local siphealth = GetVariable("siphealth")
local healbalance = GetVariable("healbalance")
local sipping = GetVariable("sipping")
if healbalance == "1" and sipping == "0" then
if currenthealth < siphealth then
Send("sip health")
SetVariable("sipping", 1)
end
end
Everything seems to work fine and dandy until my health becomes a 3-digit number, i.e. anything 999 and below. At that point it simply stops sipping. I've experimented and checked World Properties -> Variables when my health is below 999 and all the variables are still being set correctly, it's just not sipping. I can sit there and wait until my health, which regenerates slowly over time, goes up to a 1000 and as soon as the first prompt indicating it's a 4-digit number pops I start sipping again. Very odd, and looking at the scripting with my beginner eyes I can't see what's causing it. Any help is greatly appreciated. Thanks!
btw, here's what my prompt looks like with 4 and 3 digits of health respectively:
3877h, 2563m, 18285e, 11715w cexkdb-
865h, 2563m, 18285e, 11715w cexkdb- |