Advertisement
Guest User

wall

a guest
May 22nd, 2015
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.84 KB | None | 0 0
  1. turtle.select(1)
  2. term.clear()
  3. term.write ("Please Specify Height: ")
  4. userInput = read()
  5. term.clear()
  6. term.write ("Please Specify Width: ")
  7. userInputTwo = read()
  8. userInput = userInput - 1
  9. userInputTwo = userInputTwo - 1
  10.  
  11. function pillar()
  12.   if turtle.getItemCount(1) ~= 0 then
  13.     for i = 1, userInput do
  14.       turtle.place()
  15.       turtle.up()
  16.       turtle.place()
  17.     end
  18.     for h = 1, userInput do
  19.       turtle.down()
  20.     end
  21.   else
  22.     term.write ("Unable to build a pillar.(NotEnoRes)")
  23.   end
  24. end
  25.  
  26. function sideways()
  27.   turtle.turnRight()
  28.   turtle.forward()
  29.   turtle.turnLeft()
  30. end
  31.  
  32. function wall()
  33.   for j = 1, userInputTwo do
  34.     pillar()
  35.     sideways()
  36.   end
  37. end
  38.  
  39. function rturn()
  40.   turtle.turnLeft()
  41.   for l = 1, userInputTwo do
  42.     turtle.forward()
  43.   end
  44.   turtle.turnRight()
  45. end
  46.  
  47. wall()
  48. pillar()
  49. rturn()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement