abouttabs

lamps

Aug 11th, 2013
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.39 KB | None | 0 0
  1. function next()
  2.     z = k+1
  3.     for i= 1,z do
  4.         turtle.forward()
  5.     end
  6. end
  7.  
  8. function put()
  9.     if w==1 then
  10.     turtle.digDown()
  11.     turtle.down()
  12.     turtle.digDown()
  13.     turtle.select(1)
  14.     turtle.placeDown()
  15.     turtle.up()
  16.     turtle.select(2)
  17.     turtle.placeDown()
  18.     elseif w==2 then
  19.     turtle.digUp()
  20.     turtle.Up()
  21.     turtle.digUp()
  22.     turtle.select(1)
  23.     turtle.placeUp()
  24.     turtle.down()
  25.     turtle.select(2)
  26.     turtle.placeUp()
  27.     else
  28.     print("Dude I told ya 1 or 2 didn't I?")
  29.     os.sleep(10)
  30.     os.reboot()
  31.     end
  32. end
  33.  
  34. function clear()
  35.     term.clear()
  36.     term.setCursorPos(1,1)
  37.     end
  38. function nextRow()
  39.     x = l+1
  40.     if r%2 == 1 then
  41.         turtle.turnLeft()
  42.         for p= 1,x do
  43.         turtle.forward()
  44.         end
  45.         turtle.turnLeft()
  46.         r = r+1
  47.     else
  48.         turtle.turnRight()
  49.         for p= 1,x do
  50.         turtle.forward()
  51.         end
  52.         turtle.turnRight()
  53.         r = r+1
  54. end
  55. end
  56.  
  57. function questions()
  58. clear()
  59. print("How many blocks apart?")
  60.         k = tonumber(read())
  61. clear()
  62. print("How many blocks between rows?")
  63.         l = tonumber(read())
  64. clear()
  65. print("How many in a row?")
  66.         m = tonumber(read())
  67. clear()
  68. print("how many rows?")
  69.         n = tonumber(read())
  70. clear()
  71. print("where to turn first? Type in 1 for left 2 for right.")
  72.         r = tonumber(read())
  73. clear()
  74. print("floor or ceeling? (1 for floor 2 for ceeling.")
  75.         w = tonumber(read())
  76. clear()
  77. end
  78.  
  79. questions()
  80. print("working")
  81. for j= 1,n do
  82. put()
  83. for o= 1,m-1 do
  84. next()
  85. put()
  86. end
  87. nextRow()
  88. end
Advertisement
Add Comment
Please, Sign In to add comment