Advertisement
k_goos

TurtleQuarry

Apr 24th, 2013
61
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. os.loadAPI("RednetAPI")
  2.  
  3. local server = 30
  4. local par1 = ""
  5. local par2 = ""
  6.  
  7. function SendMessage(message)
  8. rednet.send(server,message)
  9. end
  10. function ServerSendResponse()
  11. while true do
  12. rednet.send(server, par1)
  13. end
  14. end
  15. function ServerReceive()
  16. while true do
  17. id, mess = rednet.receive()
  18. if id == server then
  19. par2 = mess
  20. return
  21. end
  22. end
  23. end
  24.  
  25. function Main()
  26. print("Register...")
  27.  
  28. RednetAPI.CheckServer("register", server, "registerdone")
  29. while true do
  30. id,message = rednet.receive()
  31.  
  32. if id == server then
  33. print("Servercommand: "..message)
  34. shell.run("TurtleActions", message)
  35. end
  36. end
  37. end
  38.  
  39. rednet.open("right")
  40. Main()
  41. rednet.close("right")
Advertisement
RAW Paste Data Copied
Advertisement