Advertisement
tobinator2003

farmboy

Nov 23rd, 2020 (edited)
1,867
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.66 KB | None | 0 0
  1. x = 8
  2. y = 8
  3. r = 1
  4. a = true
  5. function start()
  6.     print("Kohle in Slot 16 plazieren. 64 Seeds in Slot 1")
  7.     turtle.select(16)
  8.     turtle.refuel()
  9.     turtle.select(1)
  10.     print("Bitte Enter druecken")
  11.     while a do
  12.         local event, key, isHeld  = os.pullEvent("key")
  13.         if keys.getName(key) == "enter" then
  14.             if turtle.getItemCount(1) == 0 then
  15.                 print("Bitte Samen einfuellen!")
  16.                 else
  17.                 term.clear()
  18.                 inspectFeld()
  19.                 a = false
  20.             end
  21.            
  22.         end
  23.     end
  24.  
  25. end
  26. function inspectFeld()
  27.     for i = 1,8,1 do
  28.         for j = 1,8,1 do
  29.             success, data = turtle.inspectDown()
  30.             if success then
  31.                 if data.name ~= "minecraft:wheat" then
  32.                
  33.                     turtle.digDown()
  34.                     turtle.placeDown()
  35.                    
  36.                 end
  37.             else
  38.                 turtle.digDown()
  39.                 turtle.placeDown()
  40.             end
  41.             turtle.forward()
  42.         end
  43.         turn(r)
  44.         r = r ==1 and 0 or 1
  45.        
  46.     end
  47.     turtle.turnRight()
  48.         turtle.forward()
  49.         turtle.forward()
  50.         turtle.forward()
  51.         turtle.forward()
  52.         turtle.forward()
  53.         turtle.forward()
  54.         turtle.forward()
  55.         turtle.turnRight()
  56.  
  57. end
  58. function turn(richtung)
  59.     if richtung == 1 then
  60.         turtle.turnRight()
  61.         turtle.forward()
  62.         turtle.turnRight()
  63.         else
  64.         turtle.turnLeft()
  65.         turtle.forward()
  66.         turtle.turnLeft()
  67.     end
  68. end
  69.  
  70. while true do
  71.     start()
  72.     print("fertig")
  73.    
  74. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement