DrFair

darkiron

Jan 23rd, 2013
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. Args = {...}
  2.  
  3. function printusage()
  4. print("Usage:")
  5. print("Place iron blocks in first slot.")
  6. print("Type darkiron <amount>")
  7. end
  8.  
  9. function darkiron(num)
  10. turtle.select(1)
  11. for i=1,num do
  12. if turtle.getItemCount(1) == 0 then
  13. print("Cannot find any iron blocks.")
  14. printusage()
  15. return
  16. end
  17. turtle.place()
  18. if turtle.getItemCount(1) == 0 then
  19. os.sleep(3)
  20. else
  21. while turtle.compare() do
  22. os.sleep(0.5)
  23. end
  24. end
  25. turtle.dig()
  26. os.sleep(0.5)
  27. end
  28. end
  29.  
  30. if #Args ~= 1 or tonumber(Args[1]) == 0 then
  31. printusage()
  32. else
  33. darkiron(tonumber(Args[1]))
  34. end
Advertisement
Add Comment
Please, Sign In to add comment