Sorry to bother you on a minor problem
I am getting a error on box destroyer line 119 says bad argument #1 to format (number expected, got nil)
line 119 looks like this
windower.add_to_chat(207, 'best guess: %d (%d%%)':format(box[id][math.ceil(#box[id] / 2)], 1 / remaining * 100))
please help me to fix this
thank you Thomas
P.S. here is the entire
-- display helper function
function display(id, chances)
if #box[id] == 90 then
windower.add_to_chat(207, 'possible combinations: 10~99')
else
windower.add_to_chat(207, 'possible combinations: ' .. table.concat(box[id], ' '))
end
local remaining = math.floor(#box[id] / math.pow(2, (chances - 1)))
if remaining == 0 then
remaining = 1
end
windower.add_to_chat(207, 'best guess: %d (%d%%)':format(box[id][math.ceil(#box[id] / 2)], 1 / remaining * 100))
end
thank you