Advertisement
Guest User

startup

a guest
May 31st, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.54 KB | None | 0 0
  1. sg = peripheral.find("stargate")
  2. while true do
  3.   print("Press Key for desired program")
  4.   print("[D] Dial")
  5.   print("[S] Disconnect")
  6.   print("Note: Gate must be disconnected before redialling")
  7.   local event, character = os.pullEvent("char")
  8.   if character == "d" then
  9.     --Dial
  10.     term.clear()
  11.     term.setCursorPos(1,1)
  12.     print("Enter Gate Address")
  13.     address = read()
  14.     sg.dial(address)
  15.   elseif character == "s" then
  16.     sg.disconnect()
  17.     print("Gate Disconnected")
  18.   end
  19.   term.clear()
  20.   term.setCursorPos(1,1)
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement