GrimmSpector
March 3rd, 2016, 20:02
Debugging this code, as soon as I open the ruleset I get the console error below, and if I remove the brackets around the compound if statement, I instead get the same error but it says it expected 'then' near '<eof>'...I don't see any errors, hopefully someone can tell me what silly mistake I've made, the code may look complex but the individual blocks when taken apart from their ifs and loops work.
Error:
Runtime Notice: Reloading ruleset
Script Error: [string "charsheet_main:standard"]:1: ')' expected near '<eof>'
Database Notice: Campaign saved.
Script:
[CODE]
function updatePips()
local curstd = window.standard_current.getValue();
local maxstd = window.standard.getValue();
for i=1,maxstd do
window["standard" .. tostring(i)].setHealth("pip_filled");
end
if curstd ~= maxstd then
if (curstd < maxstd and curstd > 0) then
for i=(curstd + 1),maxstd do
window["standard" .. tostring(i)].setHealth("pip_empty");
end
end
if curstd == 0 then
for i=1,maxstd do
window["standard" .. tostring(i)].setHealth("pip_empty");
end
end
end
end
[CODE]
Error:
Runtime Notice: Reloading ruleset
Script Error: [string "charsheet_main:standard"]:1: ')' expected near '<eof>'
Database Notice: Campaign saved.
Script:
[CODE]
function updatePips()
local curstd = window.standard_current.getValue();
local maxstd = window.standard.getValue();
for i=1,maxstd do
window["standard" .. tostring(i)].setHealth("pip_filled");
end
if curstd ~= maxstd then
if (curstd < maxstd and curstd > 0) then
for i=(curstd + 1),maxstd do
window["standard" .. tostring(i)].setHealth("pip_empty");
end
end
if curstd == 0 then
for i=1,maxstd do
window["standard" .. tostring(i)].setHealth("pip_empty");
end
end
end
end
[CODE]