Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- side = "back" --Replace back with the side your monitor is on
- open = "text" -- Replace text with what you want the monitor to say when it your shop is open
- close = "text" -- Replace text with what you want the monitor to say when it your shop is closed
- mon = peripheral.wrap(side)
- term.clear()
- term.setCursorPos(1,1)
- function yN()
- local n=1
- while true do
- local x, y=term.getCursorPos()
- term.clearLine()
- if n==1 then write(">Open< Close") else write (" Open >Close<") end
- term.setCursorPos(x, y)
- a, b=os.pullEvent()
- while a~="key" do a, b=os.pullEvent() end
- if b==203 and n==2 then n=1 end
- if b==205 and n==1 then n=2 end
- if b==28 then print("") break end
- end
- if n==1 then
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write(open)
- term.clear()
- term.setCursorPos(1,1)
- yN()
- end
- if n==2 then
- mon.setCursorPos(1,1)
- mon.write(close)
- term.clear()
- term.setCursorPos(1,1)
- yN()
- end
- return false
- end
- yN()
Advertisement
Add Comment
Please, Sign In to add comment