Necro'ing this thread to post up a new problem that I'm having.
With extensive help from Oneymus, I've been squishing some bugs that I've been having with the latest iteration of Mantis Beta Release 5.0. Currently, for debugging purposes, I have all of my actions echo'd back to me so I know exactly what's going on at any given time when I have an affliction in the queue. I'll post up all of the scripts that I have here, in the order that they would be fired.
Firstly, an incoming affliction is added to a list called "mantisAfflictedWith", which I shall from now on refer to as the "affliction queue".
Code: Select all
function MantisAddAffliction(affliction)
if not mantisAfflictedWith[affliction] then
table.insert(mantisAfflictedWith, affliction)
end
end
Next, prompted on each incoming prompt, the curing script is run. Please note, the script here has all of the echo's put in, to better understand what's firing correctly, and what isn't.
Code: Select all
function MantisCureAfflictions()
for _,affliction in ipairs(mantisAfflictedWith) do
echo( "Affliction: " .. affliction .. "\n" )
for _,balance in ipairs(mantisBalancePriorities) do
echo( "Balance Type: " .. balance .. "\n" )
if mantis.healingBalances[balance] then
echo( "Checking balance step." .. "\n" )
for index,cure in pairs(mantisAfflictionPriorities[balance]) do
echo( "Cure index: " .. index .. "\n" )
if index == affliction then
echo( "Affliction found." .. "\n" )
send(cure)
mantis.healingBalances[balance] = false
MantisResetBalance(balance)
break
end
end
end
end
end
end
Firstly, the code processes the affliction queue, processing all of the afflictions listed there, and remembering the actual afflictions as the variable "affliction". Next the same is done with the curing balances within the balance priorities list:
Code: Select all
mantisBalancePriorities = {"herb", "purgative", "salve", "balance", "focus",}
If the curing balance is up, iterate through that specific curing balance's cure list in mantisAfflictionPriorities (will be listed down at the very bottom). Next, send the cure, reset the balance, and finish up the cure. When the affliction is cured, the curing message is Triggered, and the affliction is removed from the queue with this script:
Code: Select all
function MantisRemoveAffliction(affliction)
for k,v in ipairs(mantisAfflictedWith) do
if v == affliction then
table.remove(mantisAfflictedWith, k)
end
end
end
Here is the link to the affliction priorities and cure list.
Now, for my error. According to the echo's displayed back to me, the script will iterate through all of the balance lists in mantisAfflictionPriorities, but won't actually find the affliction and cure it. This is what I get:
Code: Select all
Affliction: prone
Balance Type: herb
Checking balance step.
Cure index: pairs
Balance Type: purgative
Checking balance step.
Cure index: pairs
Balance Type: salve
Checking balance step.
Cure index: pairs
Balance Type: balance
Checking balance step.
Cure index: pairs
Balance Type: focus
Checking balance step.
Cure index: pairs
Can anyone help me with this? To test out this script, I have been simply trying to cure me being "prone", by manually sitting, and then having it (hopefully) stand automatically. Thank you for all of the help!