Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("fuzzy")
- fuzzy.getmapy()
- print("starting up figuring out where I am")
- if tonumber(fuzzy.map[1]) < 0 then
- print("not at home position")
- if tonumber(fuzzy.map[4]) > 1 then
- while tonumber(fuzzy.map[4]) > 1 do
- fuzzy.turnRight()
- fuzzy.getmapy()
- end
- end
- end
- if tonumber(fuzzy.map[1]) < 0 then
- while tonumber(fuzzy.map[1]) < 0 do
- fuzzy.forward()
- fuzzy.getmapy()
- end
- end
- -- now to actually farm
- while true do
- print("let's go get some potatoes.")
- fuzzy.turnRight()
- fuzzy.turnRight()
- fuzzy.getmapy()
- while tonumber(fuzzy.map[1]) >= -6 do
- local sucsess, potato = turtle.inspectDown()
- local loopCounter = 1
- if sucsess then
- print("maybe")
- print("moving: ", loopCounter)
- print("x coord: ", fuzzy.map[1])
- loopCounter = loopCounter + 1
- if potato.name == "minecraft:potatoes" then
- print("potato")
- if potato.metadata == 7 then
- print("harvest")
- turtle.digDown()
- turtle.select(1)
- turtle.placeDown()
- end
- end
- local sucsess, potato = turtle.inspectDown()
- if sucsess then
- if potato.name == "minecraft:potatoes" then
- if potato.metadata == 7 then
- print("reharvest")
- turtle.digDown()
- turtle.select(1)
- turtle.placeDown()
- end
- end
- end
- end
- fuzzy.forward()
- fuzzy.getmapy()
- end
- --at end of track
- fuzzy.turnRight()
- fuzzy.turnRight()
- fuzzy.getmapy()
- while tonumber(fuzzy.map[1]) < 0 do
- fuzzy.forward()
- fuzzy.getmapy()
- end
- local sucsess, chest = turtle.inspect()
- if sucsess then
- if chest.name == "IronChest:BlockIronChest" then
- print("Dropping off items")
- for i = 2, 14, 1 do
- turtle.select(i)
- turtle.drop()
- end
- turtle.select(1)
- end
- fuzzy.getmapy()
- end
- fuzzy.getmapy()
- print("sleepy")
- os.sleep(120)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement