computercam

Computercraft_CDT

May 11th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. print("Starting CDT service...")
  2. n = peripheral.wrap("top")
  3. rednet.open("top")
  4. serverID = 0
  5. os.loadAPI("APIs/server")
  6. local function clear()
  7. m.clear()
  8. m.setCursorPos(1, 1)
  9. end
  10. --server.TestConnection("true")
  11. server.connect("cdtserver", "cdtauthorization")
  12. senderID, message, distance = rednet.receive()
  13. if message == "login" then
  14. print("Connection done!")
  15. senderID, message, distance = rednet.receive()
  16. connected = true
  17. else
  18. print("Fail")
  19. end
  20. while connected do
  21. senderID, message, distance = rednet.receive()
  22. if message == "cdt-start" then
  23. print(senderID, " Wants to start a connection. Allowing...")
  24. rednet.send(senderID, "start")
  25. senderID, message, distance = rednet.receive()
  26. print(senderID, ": Selection: 1")
  27. recovery = fs.open("/cdtservice/startup", "r")
  28. lent = 0
  29. for i in recovery.readLine() do
  30. lent = lent + 1
  31. end
  32. print("lent")
  33. end
Advertisement
Add Comment
Please, Sign In to add comment