Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("c")
- rednet.open("back")
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.orange)
- c.centerText("Wireless Power Control")
- term.setCursorPos(1,2)
- term.setTextColor(colors.white)
- print("AE Control: -")
- print("On / Off")
- term.setCursorPos(15,2)
- print("Plaz Power:")
- term.setCursorPos(15,3)
- print("On / Off")
- term.setCursorPos(1,5)
- print("Sus Power:")
- print("On / Off")
- term.setCursorPos(13,5)
- print("- Kezza power:")
- term.setCursorPos(15,6)
- print("On / Off")
- term.setCursorPos(22,19)
- term.setTextColor(colors.orange)
- print("Exit")
- term.setTextColor(colors.white)
- term.setCursorPos(1,13)
- term.setBackgroundColor(colors.blue)
- c.centerText("UPDATE")
- term.setBackgroundColor(colors.black)
- term.setCursorPos(1,14)
- print("Plaz status : ")
- term.setCursorPos(1,15)
- print("AE Status : ")
- term.setCursorPos(1,16)
- print("Sus status : ")
- term.setCursorPos(1,17)
- print("Kezza status:")
- while true do
- event, side, x, y = os.pullEvent("mouse_click")
- if x >= 22 and x < 26 and y == 19 then
- term.clear()
- break
- end
- if x >= 1 and x < 10 and y == 14 then
- rednet.send(71, "status")
- id, msg = rednet.receive()
- if id == 71 then
- term.setCursorPos(14,14)
- if msg == "true" then
- term.setCursorPos(14,14)
- term.setBackgroundColor(colors.black)
- print(" ")
- term.setBackgroundColor(colors.lime)
- term.setCursorPos(15,14)
- else
- term.setBackgroundColor(colors.red)
- term.setCursorPos(14,14)
- end
- print(msg)
- end
- term.setBackgroundColor(colors.black)
- end
- if x >= 1 and x < 10 and y == 15 then
- rednet.send(69, "status")
- id, msg = rednet.receive()
- if id == 69 then
- term.setCursorPos(15,15)
- if msg == "true" then
- term.setCursorPos(14,15)
- term.setBackgroundColor(colors.black)
- print(" ")
- term.setBackgroundColor(colors.lime)
- term.setCursorPos(15,15)
- else
- term.setBackgroundColor(colors.red)
- term.setCursorPos(14,15)
- end
- print(msg)
- end
- end
- if x >= 1 and x < 10 and y == 16 then
- rednet.send(72, "status")
- id, msg = rednet.receive()
- if id == 72 then
- if msg == "true" then
- term.setCursorPos(14,16)
- term.setBackgroundColor(colors.black)
- print(" ")
- term.setBackgroundColor(colors.lime)
- term.setCursorPos(15,16)
- else
- term.setBackgroundColor(colors.red)
- term.setCursorPos(14,16)
- end
- print(msg)
- end
- end
- if x >= 1 and x < 10 and y == 17 then
- rednet.send(73, "status")
- id, msg = rednet.receive()
- if id == 73 then
- if msg == "true" then
- term.setCursorPos(14,17)
- term.setBackgroundColor(colors.black)
- print(" ")
- term.setBackgroundColor(colors.lime)
- term.setCursorPos(15,17)
- else
- term.setBackgroundColor(colors.red)
- term.setCursorPos(14,17)
- end
- print(msg)
- end
- end
- if x >= 1 and x < 3 and y == 3 then
- term.setCursorPos(1,3)
- term.setBackgroundColor(colors.lime)
- print("On")
- term.setCursorPos(6,3)
- term.setBackgroundColor(colors.black)
- print("Off")
- rednet.send(69, "on")
- end
- if x > 4 and x < 9 and y == 3 then
- rednet.send(69, "off")
- term.setCursorPos(1,3)
- term.setBackgroundColor(colors.black)
- print("On ")
- term.setCursorPos(6,3)
- term.setBackgroundColor(colors.red)
- print("Off")
- end
- if x > 15 and x <17 and y == 3 then
- rednet.send(71, "on")
- term.setCursorPos(15,3)
- term.setBackgroundColor(colors.lime)
- print("On")
- term.setCursorPos(20,3)
- term.setBackgroundColor(colors.black)
- print("Off")
- end
- if x > 20 and x < 27 and y == 3 then
- rednet.send(71, "off")
- term.setCursorPos(15,3)
- term.setBackgroundColor(colors.black)
- print("On")
- term.setCursorPos(20,3)
- term.setBackgroundColor(colors.red)
- print("Off")
- end
- if x >= 1 and x < 3 and y == 6 then
- rednet.send(72, "on")
- term.setCursorPos(1,6)
- term.setBackgroundColor(colors.lime)
- print("On")
- term.setCursorPos(6,6)
- term.setBackgroundColor(colors.black)
- print("Off")
- end
- if x >= 6 and x < 9 and y == 6 then
- rednet.send(72, "off")
- term.setCursorPos(1,6)
- term.setBackgroundColor(colors.black)
- print("On")
- term.setCursorPos(6,6)
- term.setBackgroundColor(colors.red)
- print("Off")
- end
- if x >= 15 and x < 16 and y == 6 then
- rednet.send(73, "on")
- term.setCursorPos(15,6)
- term.setBackgroundColor(colors.lime)
- print("On")
- term.setCursorPos(20,6)
- term.setBackgroundColor(colors.black)
- print("Off")
- end
- if x >= 20 and x < 24 and y == 6 then
- rednet.send(73, "off")
- term.setCursorPos(15,6)
- term.setBackgroundColor(colors.black)
- print("On")
- term.setCursorPos(20,6)
- term.setBackgroundColor(colors.red)
- print("Off")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement