Posted 22 November 2013 - 09:49 AM
Hello guys,
first I have to say sorry for my bad english, because I'am german.
I'm a beginner with Coputercraft and tested arround a few programs and tried to write a very simple program to turn on lights for example, but
I doesnt work.
term.clear()
term.setCursorPos(1,1)
print("X")
while true do
event,side,x,y = os.pullEvent()
if event == "monitor_touch" then
if X == 1 and y == 1 then
term.setCursorPos(1,3)
print("Licht an")
rs.setOutput("back", true)
end
end
end
I saved this as 'startup' and connected the computer with a monitor, then I get the 'x' in the top left corner (Pos1,1) but when I click on it with the right mouse button, nothing happens.
Please help me.
first I have to say sorry for my bad english, because I'am german.
I'm a beginner with Coputercraft and tested arround a few programs and tried to write a very simple program to turn on lights for example, but
I doesnt work.
term.clear()
term.setCursorPos(1,1)
print("X")
while true do
event,side,x,y = os.pullEvent()
if event == "monitor_touch" then
if X == 1 and y == 1 then
term.setCursorPos(1,3)
print("Licht an")
rs.setOutput("back", true)
end
end
end
I saved this as 'startup' and connected the computer with a monitor, then I get the 'x' in the top left corner (Pos1,1) but when I click on it with the right mouse button, nothing happens.
Please help me.