Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap("top")
- mon2= peripheral.wrap("right")
- bulkheads = false
- bulkheads_id = 0
- function raw()
- bRead = true
- while(bRead) do
- local sEvent, param = os.pullEvent("key")
- if(sEvent == "key") then
- return param
- end
- end
- end
- function n()
- _,y=mon.getCursorPos()
- mon.setCursorPos(1, y+1)
- end
- function draw()
- mon.clear()
- mon.setCursorPos(1, 1)
- mon2.setCursorPos(1, 1)
- mon2.clear()
- mon.setTextColor(colors.black)
- mon.setBackgroundColor(colors.yellow)
- mon.write("LCARS_USS_CONSTELLATION ")
- mon.setTextColor(colors.white)
- mon.setBackgroundColor(colors.black)
- n()
- if bulkheads == true then
- mon.setBackgroundColor(colors.green)
- mon.write("BULKHEADS_ON")
- else
- mon.setBackgroundColor(colors.red)
- mon.write("BULKHEADS_OFF")
- end
- n()
- mon.setBackgroundColor(colors.black)
- mon.write(" ")
- term.clear()
- term.setCursorPos(1, 1)
- term.setTextColor(colors.white)
- term.write("(B)ulkheads")
- end
- function poll()
- if raw() == 48 then
- bulkheads = not bulkheads
- end
- end
- function redupdate()
- if bulkheads == true then
- rednet.send(bulkheads_id, "on")
- else
- rednet.send(bulkheads_id, "off")
- end
- end
- while true do
- draw()
- poll()
- redupdate()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement