Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. --[[ StartFarm ]]--
  2. KillBots = {21,22,23,24,25,26}
  3.  
  4. term.clear()
  5. term.setCursorPos(1,1)
  6. print ("Welcome to Zombie Mob Farm")
  7. print ("sending start command")
  8. print ("waiting for response...")
  9.  
  10. local function startfarm(bot)
  11. rednet.open("right")
  12. rednet.send(bot, "startfarm") -- sends the "startfarm" message to the turtle
  13. id, message = rednet.receive(20) -- waits 20 seconds for a response
  14. if message == "started" then
  15. print ("farm started!")
  16. rednet.close("right")
  17. elseif message == "running" then
  18. print ("farm is already running!")
  19. rednet.close("right")
  20. else
  21. print ("could not get response from turtle after 10 seconds")
  22. print ("you should probably check on them")
  23. rednet.close("right")
  24. end
  25. end
  26.  
  27. print ("SpawnController")
  28. stopfarm(18)
  29. for i, bot in ipairs(KillBots) do
  30. print ("KillBot" + i)
  31. stopfarm(bot)
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement