trynothingy

Test Menu

Oct 14th, 2012
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.91 KB | None | 0 0
  1. side = "back" --Replace back with the side your monitor is on
  2. open = "text" -- Replace text with what you want the monitor to say when it your shop is open
  3. close = "text" -- Replace text with what you want the monitor to say when it your shop is closed
  4. mon = peripheral.wrap(side)
  5.  
  6. term.clear()
  7. term.setCursorPos(1,1)
  8.  
  9. function yN()
  10. local n=1
  11. while true do
  12. local x, y=term.getCursorPos()
  13. term.clearLine()
  14. if n==1 then write(">Open<   Close") else write (" Open   >Close<") end
  15. term.setCursorPos(x, y)
  16. a, b=os.pullEvent()
  17. while a~="key" do a, b=os.pullEvent() end
  18. if b==203 and n==2 then n=1 end
  19. if b==205 and n==1 then n=2 end
  20. if b==28 then print("") break end
  21. end
  22. if n==1 then
  23. mon.clear()
  24. mon.setCursorPos(1,1)
  25. mon.write(open)
  26. term.clear()
  27. term.setCursorPos(1,1)
  28. yN()
  29. end
  30.  
  31. if n==2 then
  32. mon.setCursorPos(1,1)
  33. mon.write(close)
  34. term.clear()
  35. term.setCursorPos(1,1)
  36. yN()
  37. end
  38.  
  39. return false
  40. end
  41.  
  42. yN()
Advertisement
Add Comment
Please, Sign In to add comment