Advertisement
Guest User

Teleport

a guest
Aug 1st, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.83 KB | None | 0 0
  1. local tArgs = { ... }
  2. local destination = tArgs[1]
  3. local currentLocation = tArgs[2]
  4. rednet.send(18, destination)
  5. os.sleep(1)
  6. rednet.send(18, currentLocation)
  7. term.setTextColor(2)
  8. print("Please wait while the Teleporter is prepared...")
  9. while true do
  10. local event, senderId, message, distance = os.pullEvent("rednet_message")
  11. if senderId==18 and message==true then
  12.   print("The Teleporter is ready")
  13.   print("Would you like to log out?")
  14.   term.setTextColor(1)
  15.   print("1)Yes")
  16.   print("2)No")
  17.   local event, key = os.pullEvent("key")
  18.   if key==2 then
  19.     shell.run("logout")
  20.   elseif key==3 then
  21.     term.setTextColor(2)
  22.     print("Goodbye...")
  23.     os.sleep(1)
  24.     os.shutdown()
  25.   end
  26. elseif senderId==18 and message==false then
  27.   print("There was a system error. Please try again later")
  28.   os.sleep(3)
  29.   os.shutdown()
  30. end
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement