Advertisement
Guest User

startup

a guest
Nov 27th, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. modem = peripheral.wrap("bottom")
  2. while 1 do
  3.   term.clear()
  4.   term.setCursorPos(1,1)
  5.   print("Welcome to VirtualDXS's Mars Base!")
  6.   print("This is a door terminal. Would you like to:")
  7.   print("  O)pen the main door")
  8.   print("  C)lose the main door")
  9.   print("  ")
  10.   while 1 do
  11.     local event, keystroke = os.pullEvent("char")
  12.     if keystroke == "o" then
  13.       modem.transmit(1337,1337,"open")
  14.       print("Opened main door!")
  15.       sleep(3)
  16.       break
  17.     elseif keystroke == "c" then
  18.       modem.transmit("Closed main door!")
  19.       sleep(3)
  20.       break
  21.     end
  22.   end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement