iconmaster

quarry-client

Apr 27th, 2013
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. function dump()
  2. turtle.select(1)
  3. turtle.placeUp()
  4. for i = 2 , 16 do
  5. turtle.select(i)
  6. turtle.dropUp()
  7. end
  8. turtle.select(1)
  9. turtle.digUp()
  10. end
  11.  
  12. while true do
  13. print("Waiting for signal...")
  14. repeat
  15. sleep(.1)
  16. until colors.test(redstone.getBundledInput("back"),colors.magenta)
  17. print("Digging!")
  18.  
  19. turtle.forward()
  20.  
  21. n = 0
  22.  
  23. repeat
  24. turtle.digDown()
  25. n = n + 1
  26. if turtle.attackDown() then
  27. repeat
  28. succ = turtle.attackDown()
  29. sleep(.5)
  30. until not succ
  31. end
  32. if turtle.getItemCount(16) ~= 0 then
  33. dump()
  34. end
  35. until not turtle.down()
  36.  
  37. for i=1,n-1 do
  38. if turtle.attackUp() then
  39. repeat
  40. succ = turtle.attackUp()
  41. sleep(.5)
  42. until not succ
  43. end
  44. if turtle.detectUp() then turtle.digUp() end
  45. repeat
  46. until turtle.up()
  47. end
  48.  
  49. dump()
  50. turtle.back()
  51.  
  52. print("Ckecking for pre-existing white...")
  53. repeat
  54. sleep(math.random()*2)
  55. until redstone.getBundledInput("back") == 0
  56. print("None found! Emitting white...")
  57. redstone.setBundledOutput("back",colors.white)
  58. repeat
  59. sleep(math.random()*2)
  60. until colors.test(redstone.getBundledInput("back"),colors.orange)
  61. redstone.setBundledOutput("back",0)
  62. print("recieved orange!")
  63. end
Advertisement
Add Comment
Please, Sign In to add comment