Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function display()
- term.setCursorPos(1,2)
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.green)
- term.write(" Open ")
- term.setCursorPos(1,3)
- term.setBackgroundColor(colors.blue)
- term.write(" ")
- term.setCursorPos(1,4)
- term.setBackgroundColor(colors.red)
- term.write(" Close")
- term.setCursorPos(1,1)
- term.setBackgroundColor(colors.blue)
- term.write(" SoulDoor ")
- term.setCursorPos(1,5)
- end
- function open()
- rednet.broadcast("open","soulDoor")
- end
- function close()
- rednet.broadcast("close","soulDoor")
- end
- function eventHandler()
- local event,button,x,y = os.pullEvent("mouse_click")
- if x<=6 then
- if y==2 then
- open()
- elseif y==4 then
- close()
- end
- end
- end
- display()
- rednet.open("back")
- while true do
- eventHandler()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement