Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- XP Turtle program by DeliciousJaffa
- local amountCut = 0
- local waittext = " - Wait"
- local tstop
- local running = true
- local ix, xy
- function updatestats()
- term.setCursorPos(1,ty)
- term.clearLine()
- term.setCursorPos(1,ty)
- write("Cobble harvested since reboot: " .. amountCut)
- end
- function keywait ()
- while not tstop do
- local event,key = os.pullEvent()
- if (event == "char") and (key == "q") then
- tstop = true
- end
- end
- end
- function stats ()
- tx,ty = term.getCursorPos()
- while not tstop do
- updatestats()
- sleep(5)
- end
- write(waittext)
- end
- --print(m.getLevels())
- --enchantBook()
- function main ()
- turtle.select(1)
- while not tstop do
- if turtle.detect() then
- if turtle.dig() then amountCut = amountCut + 1 end
- end
- if turtle.getItemCount(1) > 0 then
- turtle.dropDown()
- end
- sleep(0.25)
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- turtle.select(1)
- print("Press Q to quit")
- parallel.waitForAll(stats,keywait,main)
- local mx,my = term.getCursorPos()
- term.setCursorPos((mx - string.len(waittext)),my)
- updatestats()
- print(" \\e/")
Advertisement
Add Comment
Please, Sign In to add comment