daily pastebin goal
50%
SHARE
TWEET

Untitled

a guest Dec 18th, 2013 161 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Really simple quarry program
  2. --Written by Civilwargeeky
  3.  
  4.  
  5. function dig()
  6.   while not robot.forward() do
  7.     robot.swing()
  8.   end
  9. end
  10. function down()
  11.   while not robot.down() do
  12.     robot.swingDown()
  13.   end
  14. end
  15.  
  16. io.write("Length? ")
  17. x = tonumber(io.read()) or 3
  18. io.write("\nWidth? ")
  19. z = tonumber(io.read()) or 3
  20. io.write("\nHeight? ")
  21. y = tonumber(io.read()) or 3
  22.  
  23. turnRight = true
  24. facing = 0
  25.  
  26. for i=1, y do
  27.   for i=1, z do
  28.     for i=1, x do
  29.       dig()
  30.     end
  31.     if turnRight then
  32.       func = robot.turnRight
  33.     else
  34.       func = robot.turnLeft
  35.     end
  36.     turnRight = not turnRight
  37.     func()
  38.     dig()
  39.     func()
  40.   end
  41.   down()
  42.   func()
  43.   func()
  44.   if z%2 == 0 then rowCheck = left end
  45. end
  46. for i=1, y do robot.up() end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top