Posted 01 January 2013 - 05:29 AM
local event, button, xPos, yPos = os.pullEvent("mouse_click")
if button == 1 then
if xPos => 8 and xPos <= 17 and yPos => 10 and yPos <= 12 then
os.reboot()
elseif (xPos => 35 and xPos <= 46 and yPos => 10 and yPos <= 12) then
os.shutdown()
elseif (xPos => 22 and xPos <= 30 and yPos => 10 and yPos <= 12) then
term.setCursorPos(23,8)
end
end
On startup it states that in line 4 ,there is a "then" expected. I don't understand why.
If I comment out line 3 it returns the same with a "then" expected on line 5, as does commenting out line 5, it returns expected "then" on line 7.
There is much more to the code than this. The program is over 700 lines but this is the only confict as I test it all thoroughly before adding more.
if button == 1 then
if xPos => 8 and xPos <= 17 and yPos => 10 and yPos <= 12 then
os.reboot()
elseif (xPos => 35 and xPos <= 46 and yPos => 10 and yPos <= 12) then
os.shutdown()
elseif (xPos => 22 and xPos <= 30 and yPos => 10 and yPos <= 12) then
term.setCursorPos(23,8)
end
end
On startup it states that in line 4 ,there is a "then" expected. I don't understand why.
If I comment out line 3 it returns the same with a "then" expected on line 5, as does commenting out line 5, it returns expected "then" on line 7.
There is much more to the code than this. The program is over 700 lines but this is the only confict as I test it all thoroughly before adding more.