Advertisement
myLord

Untitled

Aug 22nd, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.89 KB | None | 0 0
  1. local r = require("robot")
  2. local cmp = require("component")
  3. local computer = require("computer")
  4. local term = require('term')
  5. local event = require('event')
  6. local gz = cmp.geolyzer
  7.  
  8.  
  9.  
  10. function forward()
  11. cmp.tractor_beam.suck()
  12. r.select(1)
  13.     while r.detect() do
  14.         r.swing()
  15.     end
  16.     if not r.forward() then
  17.         forward()
  18.     end
  19. end
  20. function up()
  21.   while r.detectUp() do
  22.     r.swingUp()
  23.   end
  24.   if not r.up() then
  25.     up()
  26.   end
  27. end
  28. function down()
  29.   while r.detectDown() do
  30.     r.swingDown()
  31.   end
  32.   if not r.down() then
  33.     down()
  34.   end
  35. end
  36.  
  37.  
  38. --высадка
  39. for i=1,8 do
  40. forward()
  41. end
  42.  
  43. --if block == 'minecraft:air' then
  44. for i=1,2 do
  45. r.select(1)
  46. for i=1,5 do
  47. r.place()
  48. r.turnLeft()
  49. forward()
  50. forward()
  51. r.turnRight()
  52. end
  53.  
  54. r.turnAround()
  55. forward()
  56. forward()
  57. r.turnAround()
  58.  
  59. for i=1,5 do
  60. r.place()
  61. r.turnRight()
  62. forward()
  63. forward()
  64. r.turnLeft()
  65. end
  66.  
  67. r.turnAround()
  68. forward()
  69. forward()
  70. r.turnAround()
  71. end
  72. --высадка
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79. while true do
  80. print(cmp.experience.level())
  81.  if cmp.inventory_controller.getStackInInternalSlot(1) == nil then
  82.  print('в моем анусе зияет пустота')
  83. --print ('мацалаца, ми не трогай мои саплинги')
  84. --end
  85. elseif cmp.inventory_controller.getStackInInternalSlot(1).name == 'minecraft:sapling' then
  86. print ('мацалаца, ми не трогай мои саплинги')
  87.  
  88. else
  89. print('саженец засунь мудила')
  90.  
  91. end
  92.  
  93.  
  94. --проверка поля
  95. for i=1,4 do
  96. forward()
  97. end
  98. r.select(1)
  99. r.turnLeft()
  100. for i=1,2 do
  101. for i=1,5 do
  102. local block = gz.analyze(4).name
  103. if block=='minecraft:log' then
  104.  
  105. r.turnRight()
  106. r.swing()
  107.  
  108. r.select(2)
  109. os.sleep(1)
  110.  
  111. for i=1,11 do
  112. cmp.inventory_controller.equip()
  113. up()
  114. cmp.inventory_controller.equip()
  115. r.swing()
  116. end
  117.  for i=1,11 do
  118. down()
  119. cmp.tractor_beam.suck()
  120. end
  121. r.select(2)
  122.  
  123. r.select(1)
  124. r.place()
  125. r.turnLeft()
  126. end
  127.  
  128. local block = gz.analyze(5).name
  129. if block=='minecraft:log' then
  130. r.turnLeft()
  131.  r.swing()
  132. r.select(2)
  133. os.sleep(1)
  134.  
  135. for i=1,11 do
  136. cmp.inventory_controller.equip()
  137. up()
  138. cmp.inventory_controller.equip()
  139. r.swing()
  140. end
  141.  for i=1,11 do
  142. down()
  143. cmp.tractor_beam.suck()
  144. end
  145. r.select(2)
  146.  
  147. r.select(1)
  148. r.place()
  149. r.turnRight()
  150. end
  151.  
  152. forward()
  153. forward()
  154. end
  155.  
  156. r.turnRight()
  157. for i=1,4 do
  158. forward()
  159. end
  160. r.turnRight()
  161.  
  162. end
  163.  
  164. r.turnLeft()
  165. for i=1,3 do
  166. forward()
  167. end
  168. r.turnAround()
  169. r.back()
  170. r.turnRight()
  171. for c = 3, 16 do
  172.     r.select(c)
  173.         if r.count() > 0 then
  174.         r.drop()
  175.         else
  176.         r.select(1)
  177.         break
  178.     end
  179. end
  180. r.turnLeft()
  181.  
  182.  
  183. local r = require("robot")
  184. local cmp = require("component")
  185. local computer = require("computer")
  186. local term = require('term')
  187. local event = require('event')
  188. local gz = cmp.geolyzer
  189.  
  190. r.turnLeft()
  191. r.select(3)
  192. cmp.inventory_controller.equip()
  193. r.drop()
  194.  
  195.  
  196.  
  197. os.sleep(60)
  198.  
  199. r.suck()
  200. cmp.inventory_controller.equip()
  201. r.turnRight()
  202. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement