-- Does the next prompt need gagging? If so, make it so!
if gagPrompt == 1 then
gagPrompt = 0
deleteLine()
end
-- Do we have our prompt timer variable set? We do? Then show the time!
prTimer = os.clock()
echo(" [" .. prTimer .. "]\n")
-- Do we have health/mana tracking enabled? If so, display changes
if tracking == 1 then
healthDifference = tonumber(matches[2]) - currentHealth
manaDifference = tonumber(matches[3]) - currentMana
moveCursorEnd("main")
if (healthDifference<0 and manaDifference<0) then
insertText(string.format(" (%d Health, %d Mana)", healthDifference, manaDifference))
elseif healthDifference>0 and manaDifference<0 then
insertText(string.format("(+%d Health, %d Mana)", healthDifference, manaDifference))
elseif healthDifference<0 and manaDifference>0 then
insertText(string.format("(%d Health, +%d Mana)", healthDifference, manaDifference))
elseif healthDifference>0 and manaDifference>0 then
insertText(string.format("(+%d Health, +%d Mana)", healthDifference, manaDifference))
elseif healthDifference>0 then
insertText(string.format("(+%d Health)", healthDifference))
elseif manaDifference>0 then
insertText(string.format("(+%d Mana)", manaDifference))
elseif healthDifference<0 then
insertText(string.format("(%d Health)", healthDifference))
elseif manaDifference<0 then
insertText(string.format("(%d Mana)", manaDifference))
end
end -- End of health and mana tracking echoes
-- Let us populate our variables as per our current prompt
currentHealth = tonumber(matches[2])
currentMana = tonumber(matches[3])
currentEndurance = tonumber(matches[4])
currentWillpower = tonumber(matches[5])
currentBlood = tonumber(matches[6])
currentExperience = tonumber(matches[7])
currentStance = tostring(matches[9])
promptStats = tostring(matches[10])
promptEqBal = tostring(matches[11])
promptLRBal = tostring(matches[12])
if string.find(promptStats, "c") then cloak = 1 else cloak = 0 end
if string.find(promptStats, "s") then sileris = 1 else sileris = 0 end
if string.find(promptStats, "d") then deaf = 1 else deaf = 0 end
if string.find(promptStats, "b") then blind = 1 else blind = 0 end
if string.find(promptStats, "a") then airborne = 1 else airborne = 0 end
if string.find(promptStats, "p") then prone = 1 else prone = 0 end
if string.find(promptEqBal, "e") then equilibrium = 1 else equilibrium = 0 end
if string.find(promptEqBal, "b") then balance = 1 else balance = 0 end
if string.find(promptLRBal, "l") then leftArmBalance = 1 else leftArmBalance = 0 end
if string.find(promptLRBal, "r") then rightArmBalance = 1 else rightArmBalance = 0 end
if string.find(currentStance, "SCS") or string.find(currentStance, "DRS") then stanced = 1 else stanced = 0 end
if equilibrium == 1 and balance == 1 and leftArmBalance == 1 and rightArmBalance == 1 then sync = 1 else sync = 0 end
--Debugging
-- if stanced == 1 then echo("Stanced!") end
-- Actions to be executed on balance regain
--if sync == 1 then
-- if needTransmute == 1 then tmuteHealth(500)
-- end
--end
-- Auto Sipping/Mossing and Transmute Section
if paused == 0 then
if healBalance == 1 and sipFailsafe == 0 and priority == 1 then
if currentHealth < sipHealth then
send ("sip health")
healBalance = 0.5
tempTimer(1.5, [[ sipBalance = 1 ]])
elseif currentMana < sipMana then
send("sip mana")
healBalance = 0.5
tempTimer(1.5, [[ sipBalance = 1 ]])
end
elseif healBalance == 1 and sipFailsafe == 0 then
if currentMana < sipMana then
send ("sip mana")
healBalance = 0.5
tempTimer(1.5, [[ sipBalance = 1 ]])
elseif currentHealth < sipHealth then
send ("sip health")
healBalance = 0.5
tempTimer(1.5, [[ sipBalance = 1 ]])
end
end
-- if transmuteBalance == 1 then
-- if currentHealth < tmuteHealth then
-- needTransmute = 1
-- end
-- end
if mossBalance == 1 and mossFailsafe == 0 and (currentHealth < mossHealth or currentMana < mossMana) then
send ("outc moss")
send ("eat moss")
mossBalance = 0.5
tempTimer(1.5, [[ mossBalance = 1 ]])
end -- End of Auto sipping/mossing and transmute cection
end -- End section
-- Here we now deal with 'proneness'
--if prone == 1 then send("stand") end