Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("right")
- gateOpt = true
- term.clear()
- local function gate()
- term.setCursorPos(1,1)
- if gateOpt == true then
- term.setBackgroundColor(colors.red)
- elseif gateOpt == false then
- term.setBackgroundColor(colors.green)
- end
- print(" ")
- print(" Gate ")
- print(" ")
- end
- gate()
- while true do
- local event,button,X,Y = os.pullEvent()
- if event == "mouse_click" then
- if X >= 1 and X <= 6 and Y >= 1 and Y <= 3 then
- gateOpt = false
- gate()
- rednet.send(1609,"open")
- sleep(2)
- gateOpt = true
- gate()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement