Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local i
- local function crop()
- for i=1,8 do
- if i<=4 then turtle.dig() end
- turtle.suck()
- turtle.suckUp()
- if i<8 then turtle.turnLeft() end
- end
- end
- local function dump()
- for i=1,16 do
- if turtle.getItemCount(i)>0 then
- turtle.select(i)
- turtle.dropDown(64)
- end
- end
- end
- local _f = math.floor
- local function strTime(sec)
- local str,d,h,m,s = "",_f(sec/86400),_f(sec/3600)%24,_f(sec/60)%60,_f(sec%60)
- if d>0 then str = d>1 and d.." days " or "1 day " end
- if h>0 then str = str..h.."h" end
- if m>0 then str = str..(m>9 and m or "0"..m) end
- if h==0 then str = m>0 and str..":"..(s>9 and s or "0"..s) or s.."s" end
- return str
- end
- local w,h = term.getSize()
- local function computer()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.setCursorPos(1,1) term.clearLine()
- term.write("#"..os.getComputerID().." - "..os.getComputerLabel())
- term.setCursorPos(1,2) term.clearLine()
- term.write("Running: "..strTime(os.clock()))
- term.setBackgroundColor(colors.black)
- term.setTextColour(colors.gray)
- term.setCursorPos(1,3) term.clearLine()
- term.write(string.rep(string.char(131),w))
- term.setTextColor(colors.white)
- end
- term.clear()
- computer()
- local batch,tick,e,p = os.startTimer(.1),os.startTimer(1)
- while true do
- e,p = os.pullEvent("timer")
- if p==batch then
- os.cancelTimer(tick)
- rs.setOutput("bottom",true)
- crop()
- dump()
- rs.setOutput("bottom",false)
- batch = os.startTimer(18*60) --18 min variable
- tick = os.startTimer(1)
- elseif p==tick then
- computer()
- tick = os.startTimer(1)
- end
- end
Add Comment
Please, Sign In to add comment