Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function output(line,str)
- term.setCursorPos(1,line)
- term.clearLine()
- term.write(str)
- end
- local function feed()
- local wheat = turtle.getItemDetail(1)
- if not wheat or wheat.name~="minecraft:wheat" then
- error("Need wheat",0)
- return
- end
- output(2,"Feeding..")
- local count = 0
- local limit = 255
- local feed = true
- turtle.select(1)
- while limit>0 and feed do
- if not turtle.placeDown() then
- limit = limit-1
- else
- count = count+1
- limit = 255
- end
- output(3,count.." ("..limit..")")
- feed = turtle.getItemCount(1)>5
- sleep(.1)
- end
- output(3,"")
- end
- output(string.format(1,"#%d - %s",
- os.getComputerID(),
- os.getComputerLabel))
- sleep(1)
- while true do
- output(2,"Wait RS signal")
- os.pullEvent("redstone")
- feed()
- local countdown = 10
- while countdown>=0 do
- output(2,"Countdown: "..countdown)
- countdown = countdown-1
- sleep(1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment