Advertisement
Guest User

startup

a guest
Dec 6th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.80 KB | None | 0 0
  1. local count = 0
  2. while true do
  3.   print("Checking Sapling")
  4.   local success, data = turtle.inspect()
  5.   if success then
  6.     print("Block Found, ", data.name)
  7.     if data.name == "Natura:florasapling" then
  8.       count = 0
  9.       print("Found Sapling. Fertilizing")
  10.       while turtle.inspect() do
  11.         turtle.place()
  12.       end
  13.       print("Fertilized. Waiting 20s")
  14.       print()
  15.       os.sleep(20)
  16.       rs.setOutput("left", true)
  17.       os.sleep(1)
  18.       rs.setOutput("left", false)
  19.     else
  20.       print("Block Not Sapling. Waiting 10s")
  21.       os.sleep(10)
  22.     end
  23.   else
  24.     print("No Block. Waiting 10s")
  25.     count = count + 1
  26.     os.sleep(10)
  27.     if count == 3 then
  28.       rs.setOutput("left", true)
  29.       os.sleep(1)
  30.       rs.setOutput("left", false)
  31.       count = 0
  32.     end
  33.   end
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement