Advertisement
thadudexx

Untitled

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