Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- charger = peripheral.wrap("front")
- function retrieveQuartz()
- turtle.select(16)
- turtle.suck()
- end
- function pushQuartz()
- turtle.dropUp()
- end
- function placeQuartz()
- turtle.select(1)
- turtle.drop(1)
- end
- function isCharged()
- itemName = charger.getStackInSlot(1).raw_name
- if string.match(itemName, "charged") then
- return true
- else
- return false
- end
- end
- function isEmpty()
- if (charger.getStackInSlot(1) == null) then
- return true
- else
- return false
- end
- end
- function isFirstSlotEmpty()
- if (turtle.getItemCount(1) == 0) then
- return true
- else
- return false
- end
- end
- while true do
- if (isEmpty() and not isFirstSlotEmpty()) then
- placeQuartz()
- end
- if (not isEmpty() and isCharged()) then
- retrieveQuartz()
- end
- os.sleep(0.1)
- end
Add Comment
Please, Sign In to add comment