Advertisement
Guest User

tpServ

a guest
Aug 9th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 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.   id, message = rednet.receive("TP")
  8.   print("Received")
  9.   if message == "GET" then
  10.     print(id .. " wants destinations")
  11.     rednet.send(id, "Auth", "TP")
  12.     user = rednet.receive("TP", 1)
  13.     pass = rednet.receive("TP", 1)
  14.     tpSys.sendDests(id, user, pass)
  15.   elseif message == "GOTO" then
  16.     print(id .. " wants to teleport")
  17.     rednet.send(id, "Auth", "TP")
  18.     user = rednet.receive("TP", 1)
  19.     pass = rednet.receive("TP", 1)
  20.     dest = rednet.receive("TP", 1)
  21.     tpSys.teleport(id, user, pass, dest)
  22.   end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement