Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("right")
- term.clear()
- w, h = term.getSize()
- term.setCursorPos(1,2)
- print("ON")
- term.setCursorPos(1,3)
- print("OFF")
- while true do
- term.setCursorPos(1,1)
- term.setTextColor(colors.white)
- print("ForceField:")
- local event, buttom, w, h = os.pullEvent("mouse_click")
- -- ForceField
- if buttom == 1 and w == 1 and h == 2 then
- term.clear()
- term.setCursorPos(1,2)
- term.setTextColor(colors.orange)
- term.write(">>ON<<")
- term.setCursorPos(1,3)
- term.setTextColor(colors.white)
- term.write("OFF")
- rs.setOutput("right",true)
- rednet.broadcast("forcefield on")
- end
- if buttom == 1 and w == 1 and h == 3 then
- rednet.broadcast("forcefield off")
- term.clear()
- term.setCursorPos(1,2)
- term.setTextColor(colors.white)
- term.write("ON")
- term.setCursorPos(1,3)
- term.setTextColor(colors.orange)
- term.write(">>OFF<<")
- end
- -- Engines
- print("Engines:")
- if buttom == 1 and w == 1 and h == 5 then --// Engines ON
- term.clear()
- term.setCursorPos(1,2)
- term.setTextColor(colors.orange)
- term.write(">>ON<<")
- term.setCursorPos(1,3)
- term.setTextColor(colors.white)
- term.write("OFF")
- rs.setOutput("right",true)
- rednet.broadcast("engines on")
- end
- if buttom == 1 and w == 1 and h == 6 then
- rednet.broadcast("engines off")
- term.clear()
- term.setCursorPos(1,2)
- term.setTextColor(colors.white)
- term.write("ON")
- term.setCursorPos(1,3)
- term.setTextColor(colors.orange)
- term.write(">>OFF<<")
- end
- -- Machine
- term.setCursorPos(1,8)
- print("Machine:")
- if buttom == 1 and w == 1 and h == 9 then
- term.clear()
- term.setCursorPos(1,2)
- term.setTextColor(colors.orange)
- term.write(">>ON<<")
- term.setCursorPos(1,3)
- term.setTextColor(colors.white)
- term.write("OFF")
- rs.setOutput("right",true)
- rednet.broadcast("machine on")
- end
- if buttom == 1 and w == 1 and h == 10 then
- rednet.broadcast("machine off")
- term.clear()
- term.setCursorPos(1,2)
- term.setTextColor(colors.white)
- term.write("ON")
- term.setCursorPos(1,3)
- term.setTextColor(colors.orange)
- term.write(">>OFF<<")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement