Advertisement
Clorith

Untitled

Mar 16th, 2014
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.78 KB | None | 0 0
  1. -- Make sure this is an accurate number
  2. local turtleCount = 26
  3. local rsLocation  = "back"
  4.  
  5. -- Move Everythign except primary rig unit and backup chunk loaders
  6. function moveAll()
  7.     rs.setBundledOutput( rsLocation, colors.orange )
  8.     sleep( 1 )
  9.     rs.setBundledOutput( rsLocation, 0 )
  10. end
  11.  
  12. print( "Starting mine operation" )
  13. sleep( 2 )
  14.  
  15. -- Start by opening the rednet controller
  16. rednet.open( "left" )
  17.  
  18. -- Send the dig command to all systems
  19. rednet.broadcast( "cycle" )
  20.  
  21. -- Don't do anything while we wait for all the turtles to finish
  22. while turtleCount > 0 do
  23.     senderID, message, distance = rednet.receive()
  24.     if message == 'cycleDone' then
  25.         turtleCount = turtleCount - 1
  26.         print( "Unit completed, " .. turtleCount .. " to go!" )
  27.     end
  28. end
  29.  
  30. -- Turtles done, move the rig!
  31. moveAll()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement