Mantis Bug Squashing Help
Re: Mantis Bug Squashing Help
the index should not be 'pairs', no. look over the code, the Cure index: should be the name of an affliction. I bet if you display those tables, they'll not be what you think they are. That's how I found it in my system. You do want to use the pairs() function for iterating, but the table shouldn't be returning the string 'pairs' as the index.
Re: Mantis Bug Squashing Help
I made the changes that you suggested, declaring the list and the sub-lists accordingly outside of the section where I fill them... And it works! I'm thinking that the "Cure indes: pairs" thing was just a result of the phpTable() mixup, because it now returns the affliction that it's iterating through.
However, I received an error message when the script tried to reset the balance:
I don't want to have to change my resetting balance function to nil instead of false if I don't have to, but I will if that seems to be the only option.
However, I received an error message when the script tried to reset the balance:
Which is weird, since it shouldn't be nil, it should be false. And the function that resets the balance should be okay with that:Lua error:[string "mantis.healingBalances[balance] = true"]:1: table index is
nil
Code: Select all
function MantisResetBalance(balance)
if mantis.healingBalances[balance] == false then
tempTimer(2, [[mantis.healingBalances[balance] = true]])
end
end
Re: Mantis Bug Squashing Help
Jules wrote: However, I received an error message when the script tried to reset the balance:Which is weird, since it shouldn't be nil, it should be false. And the function that resets the balance should be okay with that:Lua error:[string "mantis.healingBalances[balance] = true"]:1: table index is
nilI don't want to have to change my resetting balance function to nil instead of false if I don't have to, but I will if that seems to be the only option.Code: Select all
function MantisResetBalance(balance) if mantis.healingBalances[balance] == false then tempTimer(2, [[mantis.healingBalances[balance] = true]]) end end
This is because the string is evaluated when the tempTimer goes off, not when it is set. Hence why the closures/anonymous functions for tempTimer were included, so you didn't have to do all that escaping. Otherwise, it looks for the global variable balance to fill mantis.healingBalances[balance].
Edit: because I forgot you need to use function() and not function
Re: Mantis Bug Squashing Help
Ahah! That does make sense... I think. Though I don't quite understand closures all that well, I'll figure it out eventually. Thank you, Demonnic! I'll make it mandatory then to have the latest version of Mudlet to use Mantis... Which isn't all that terrible.