Advertisement
Guest User

tpServ

a guest
Aug 9th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. os.loadAPI("/apis/tpSys")
  2.  
  3. rednet.open("right")
  4. rednet.host("TP", "TPSERV")
  5.  
  6. while(true) do
  7.   print("Waiting...")
  8.   id, message = rednet.receive("TP")
  9.   print("Received")
  10.   if message == "GET" then
  11.     print(id .. " wants destinations")
  12.     rednet.send(id, "Auth", "TP")
  13.     id, user = rednet.receive("TP", 10)
  14.     id, pass = rednet.receive("TP", 10)
  15.     print(id .. " is " .. user)
  16.     tpSys.sendDests(id, user, pass)
  17.   elseif message == "GOTO" then
  18.     print(id .. " wants to teleport")
  19.     rednet.send(id, "Auth", "TP")
  20.     id, user = rednet.receive("TP", 1)
  21.     id, pass = rednet.receive("TP", 1)
  22.     print(id.. " is " .. user)
  23.     id, dest = rednet.receive("TP", 1)
  24.     tpSys.teleport(id, user, pass, dest)
  25.   end
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement