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.
Mouse Clicks
Started by SuicidalSTDz, Jan 01 2013 05:29 AM
3 replies to this topic
#1
Posted 01 January 2013 - 05:29 AM
#2
Posted 01 January 2013 - 05:48 AM
if xPos => 8 and xPos <= 17 and yPos => 10 and yPos <= 12 then
It's because of the =>. It should be >= (greater than or equal to, not equal to or greater than). You'll need to change all of them.
It's because of the =>. It should be >= (greater than or equal to, not equal to or greater than). You'll need to change all of them.
#3
Posted 01 January 2013 - 05:51 AM
GravityScore, on 01 January 2013 - 05:48 AM, said:
if xPos => 8 and xPos <= 17 and yPos => 10 and yPos <= 12 then
It's because of the =>. It should be >= (greater than or equal to, not equal to or greater than). You'll need to change all of them.
It's because of the =>. It should be >= (greater than or equal to, not equal to or greater than). You'll need to change all of them.
#4
Posted 01 January 2013 - 05:59 AM
SuicidalSTDz, on 01 January 2013 - 05:51 AM, said:
GravityScore, on 01 January 2013 - 05:48 AM, said:
if xPos => 8 and xPos <= 17 and yPos => 10 and yPos <= 12 then
It's because of the =>. It should be >= (greater than or equal to, not equal to or greater than). You'll need to change all of them.
It's because of the =>. It should be >= (greater than or equal to, not equal to or greater than). You'll need to change all of them.
Thanks! Glad I could help
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users











