Advertisement
giny8i8

kvariit

Apr 4th, 2013
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.06 KB | None | 0 0
  1.  -- KVARIIT - quary builder robot
  2.  -- by giny8i8
  3.  --
  4.  -- __History__
  5.  -- 2013-04-01 -- v1p01 -- initial release
  6.  
  7.  -- __Variables__
  8.  
  9. local FoSize = 0
  10. local RiSize = 0
  11.  
  12. -- __Functions__
  13.  
  14. function goFor(GoBlocks)
  15.     print("Advancing "..GoBlocks.." blocks")
  16.     for i=1,GoBlocks do        
  17.        turtle.dig()
  18.        turtle.forward()            
  19.     end
  20. end
  21.  
  22. function placeMark()
  23.     turtle.digDown()
  24.     turtle.select(2)
  25.     turtle.placeDown()
  26.     turtle.turnRight()
  27.     turtle.dig()
  28.     turtle.forward()
  29.     turtle.turnRight()
  30.     turtle.turnRight()
  31.     turtle.select(1)
  32.     turtle.place()
  33.     turtle.turnRight()
  34.     turtle.turnRight()
  35.     print("LandMark placed.")
  36. end
  37.  
  38. -- __Execution__
  39.  
  40. print()
  41. print("--== KVARIIT ==--")
  42. print("[i] Put LandMarks in slot-1")
  43. print("[i] Put solid blocks in slot-2")
  44. print()
  45. print("-- Inputs --")                       -- inupts
  46. print("Quary size Forward - Specify!")
  47. write ("[^]:")
  48. local FoSize = tostring( read() )
  49. print("Quary size Right - Specify! ")
  50. write ("[>]:")
  51. local RiSize = tostring( read() )
  52. print()
  53. print("Quary size is: "..FoSize.." x "..RiSize)
  54. print("Let's go...")
  55. print()
  56.  
  57.  
  58. print ("Preparing to start")                -- Preparations
  59.     for i=1,16 do          
  60.         turtle.select(i)
  61.         turtle.refuel()        
  62.     end
  63. FuelQuant = turtle.getFuelLevel()  
  64. print ("Fuel level: "..FuelQuant)
  65. turtle.select(1)
  66.  
  67. print("Starting to build Quary")            -- Start of Cycle
  68.  
  69. print("Advancing -- Side-AB")                               -- Side-AB ----------------------------
  70. goFor(FoSize)
  71. print("Placing LandMark -- Point-B")
  72. placeMark()
  73.  
  74. print("Advancing -- Side-BC")                               -- Side-BC ----------------------------
  75. SideBC = RiSize-2
  76. goFor(SideBC)
  77. print("Placing LandMark -- Point-C")                           
  78. placeMark()
  79.  
  80. print("Advancing -- Side-CD")                               -- Side-CD ----------------------------
  81. SideCD = FoSize-2
  82. goFor(SideCD)
  83. print("Placing LandMark -- Point-D")                           
  84. placeMark()
  85.  
  86. print("Advancing -- Side-DA")                               -- Side-DA ----------------------------
  87. goFor(SideBC) -- equals to Side-DA
  88. print("Placing LandMark -- Point-A")                           
  89. placeMark()
  90.  
  91. print("All LandMarks placed")                          
  92. print("Bye bye")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement