roflmuffin

Untitled

Dec 19th, 2014
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. charger = peripheral.wrap("front")
  2.  
  3. function retrieveQuartz()
  4. turtle.suck()
  5. end
  6.  
  7. function placeQuartz()
  8. turtle.select(16)
  9. turtle.drop(1)
  10. end
  11.  
  12. function isCharged()
  13. itemName = charger.getStackInSlot(1).raw_name
  14. if string.match(itemName, "charged") then
  15. return true
  16. else
  17. return false
  18. end
  19. end
  20.  
  21. function isEmpty()
  22. if (charger.getStackInSlot(1) == null) then
  23. return true
  24. else
  25. return false
  26. end
  27. end
  28.  
  29.  
  30. while true do
  31. if (isEmpty()) then
  32. placeQuartz()
  33. else if (isCharged()) then
  34. retrieveQuartz()
  35. end
  36. end
Add Comment
Please, Sign In to add comment