Advertisement
Guest User

wheat.lua

a guest
Nov 24th, 2017
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.86 KB | None | 0 0
  1. print("edit 2")
  2. f=1
  3. turn=0
  4. local farm=function(begin)
  5.   print(begin)
  6.   local geolyzer=require("component").geolyzer
  7.   local robot=require("robot")
  8.   local data=geolyzer.analyze(3)
  9.   local datad=geolyzer.analyze(0)
  10.   local success=robot.detect()
  11.   if success==true then
  12.     check=data.name
  13.     check2=datad.name
  14.     wheat="minecraft:wheat"
  15.     cobl="minecraft:cobblestone"
  16.     dirt="minecraft:dirt"
  17.     stone="minecraft:stonebrick"
  18.     planks="minecraft:planks"
  19.     sand="minecraft:sand"
  20.     water="minecraft:water"
  21.     air="minecraft:air"
  22.  
  23.     if check == wheat then
  24.       robot.swing()
  25.       robot.select(2)
  26.       robot.forward()
  27.       robot.turnAround()
  28. --    robot.turnLeft()
  29.       robot.use()
  30.       robot.place()
  31.       robot.turnAround()
  32. --    robot.turnLeft()
  33.      
  34.     elseif check == cobl then
  35.      
  36.       robot.turnRight()
  37.       robot.swing()
  38.       robot.forward()
  39.       robot.turnLeft()
  40.       robot.turnLeft()
  41.       robot.use()
  42.       robot.place()
  43.       robot.turnLeft()
  44.  
  45.     elseif check == stone then
  46.      
  47.       robot.turnLeft()
  48.       robot.swing()
  49.       robot.forward()
  50.       robot.turnLeft()
  51.       robot.turnLeft()
  52.       robot.use()
  53.       robot.place()
  54.       robot.turnRight()
  55.      
  56.     elseif datad.name == "minecraft:water" then
  57.       robot.forward()
  58.       print("WATERRR")
  59.    
  60.  
  61.     elseif check == planks then
  62.       robot.up()
  63. --    dofile("carry.lua")
  64. --    robot.forward()
  65.  
  66. --      repeat
  67. --        local succ, un=robot.detect()
  68. --        if succ==false then robot.forward()
  69. --        elseif (succ==true) then robot.turnLeft()
  70. --        end
  71. --      until un.name==sand
  72.  
  73.       f=702
  74.     end
  75.   else
  76.     print("elsing")
  77.     robot.forward()
  78.     robot.turnAround()
  79.     robot.use()
  80.     robot.place()
  81.     robot.turnAround()
  82. --  robot.turnLeft()
  83.   end
  84. end
  85. if f<701 then
  86.   repeat
  87.     farm("Farming!")
  88.     f=f+1
  89.     print(f)
  90.   until f >= 700
  91. end
  92. dofile("/home/runs/carry.lua")
  93. print("END")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement