Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Turtle Melon Farmer -- -- AdventurousMR --
- function limeWool()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- end
- function redWool()
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- end
- function lightBlueWool()
- turtle.turnRight()
- turtle.turnRight()
- for i=1,16 do
- turtle.select(i)
- local item = turtle.getItemDetail()
- if item ~= nil and item.name == "minecraft:melon_slice" then
- turtle.dropDown()
- end
- end
- station()
- end
- function orangeWool()
- turtle.turnRight()
- while true do
- local I_success, I_data = turtle.inspect()
- if I_success and I_data.name == "minecraft:orange_wool" then
- orangeWool()
- elseif I_success and I_data.name == "minecraft:light_blue_wool" then
- lightBlueWool()
- break
- else
- turtle.forward()
- end
- end
- end
- function run()
- local ID_success, ID_data = turtle.inspectDown()
- local I_success, I_data = turtle.inspect()
- if ID_success and ID_data.name == "minecraft:melon" then
- turtle.digDown()
- run()
- elseif I_success and I_data.name == "minecraft:red_wool" then
- redWool()
- run()
- elseif I_success and I_data.name == "minecraft:lime_wool" then
- limeWool()
- run()
- elseif I_success and I_data.name == "minecraft:light_blue_wool" then
- lightBlueWool()
- elseif I_success and I_data.name == "minecraft:orange_wool" then
- orangeWool()
- elseif ID_success == false or ID_success and ID_data.name ~= "minecraft:melon" then
- turtle.forward()
- run()
- end
- end
- function station()
- local bin = peripheral.wrap("Bottom")
- while true do
- if bin.getStored().count < 50 then
- if turtle.getFuelLevel() > 150 then
- run()
- break
- else
- for i=1,16 do
- turtle.select(i)
- local item = turtle.getItemDetail()
- if item ~= nil and item.name == "minecraft:coal" then
- turtle.refuel()
- end
- if item ~= nil and item.name ~= "minecraft:coal" and i == 16 then
- print("ERROR:NO COAL")
- end
- end
- end
- end
- end
- end
- term.clear()
- run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement