Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Make sure this is an accurate number
- local enderChest = peripheral.wrap( "right" )
- local localChest = peripheral.wrap( "bottom" )
- local rsLocation = "top"
- -- Check for items in our "Ender Controller"
- -- If items are found, the system is active
- function checkState()
- enderChest.condenseItems()
- if enderChest.getStackInSlot(1) ~= NIL then
- return true
- else
- return false
- end
- end
- -- Check the status of the chest under us, is it full, empty, what?
- function checkDig()
- local itemFound = false
- -- Loop over every inventory slot
- for i = 1, localChest.getInventorySize() do
- -- If an item is found in a slot, it won't be NIL (empty/NULL)
- -- As that is the case, set item found to be true
- if localChest.getStackInSlot(i) ~= NIL then
- itemFound = true
- end
- end
- return itemFound
- end
- -- Move chunk loaders and primary rig unit
- function moveSingle()
- rs.setBundledOutput( rsLocation, colors.white )
- sleep( 1 )
- rs.setBundledOutput( rsLocation, 0 )
- end
- -- Move Everythign except primary rig unit and backup chunk loaders
- function moveAll()
- rs.setBundledOutput( rsLocation, colors.orange )
- sleep( 1 )
- rs.setBundledOutput( rsLocation, 0 )
- end
- -- Check if we're enabled or not, if not wait 5 seconds then try again
- while not checkState() do
- sleep( 5 )
- end
- print( 'Moving controller and single chunk loader' )
- moveSingle()
- -- Wait a little bit so everything moves into place
- sleep( 15 )
- while checkDig() do
- sleep( 5 )
- end
- -- Turtles done, move the rig!
- print( 'Moving the entire rig' )
- moveAll()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement