Guest User

sm

a guest
Dec 1st, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.98 KB | None | 0 0
  1. local args={...}
  2.  
  3. --Gets the values provided as args at start of program and asignes them to lenght, rows and height
  4. local lenght = tonumber(args[1])
  5. local rows = tonumber(args[2])
  6. local height = tonumber(args[3])
  7.  
  8. --Sets maximun values for lenght, number of rows and height of tunnel
  9. local lenghtl=128
  10. local rowsl=16
  11. local heightl=15
  12.  
  13. --Checks that values have been provided
  14. if lenght==nil or rows==nil or height==nil then
  15.   print("Lenght, number and height must be provided")
  16.   print("Please use as:\nstripmine [lenght] [rows] [height]")
  17.  
  18. --Checks so that the provided values don't exceed the maximun limit
  19. elseif lenght>lenghtl and rows>rowsl and height>7 then
  20.   print("Value exceeding limit was detected. The limits are -\n")
  21.   print("Lenght: "..lenghtl.."\nRows: "..rowsl.."\nHeight: "..heightl)
  22. else
  23.   --Loop to put turtle at correct initial vertical position
  24.   for i=0, height do
  25.     if turtle.detectUp() then
  26.       turtle.digUp()
  27.     end
  28.     turtle.up()
  29.   end
  30.  
  31. end
Advertisement
Add Comment
Please, Sign In to add comment