2 posts
Posted 15 April 2014 - 03:30 PM
Hey i have make a computer program to turn light on and off, on rs. signel. but i want to add more lines to the monitor so i can turn on/off more things. put i cant find out how to get the other lines to work….
my pastebin
1281 posts
Posted 15 April 2014 - 03:40 PM
Same as you're already doing obviously
if mouseWidth>18 and mouseWidth<23 and mouseHeight==2 then
rs.setOutput("left", true)
m.setBackgroundColor((colors.red))
m.setCursorPos(18,2)
m.write(" On ")
m.setBackgroundColor((colors.lime))
m.setCursorPos(24,2)
m.write(" Off ")
m.setBackgroundColor((colors.black))
end
if mouseWidth>24 and mouseWidth<29 and mouseHeight==2 then
rs.setOutput("left", false)
m.setBackgroundColor((colors.lime))
m.setCursorPos(18,2)
m.write(" On ")
m.setBackgroundColor((colors.red))
m.setCursorPos(24,2)
m.write(" Off ")
m.setBackgroundColor((colors.black))
end
just edit the if condition to wherever the button is.
Edited on 15 April 2014 - 01:40 PM
2 posts
Posted 15 April 2014 - 06:41 PM
i have try that, but it didnt work
8543 posts
Posted 15 April 2014 - 07:39 PM
Show us the code you tried, then. Also post any errors you got, a description of what you did, how the code responded, and what makes you think it "didn't work". Just saying it didn't work doesn't tell us anything useful.