Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- config
- local KillCount = 0
- local WaitStage = 0
- local Unloaded = 0
- -- functions
- function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- local function waiting()
- if WaitStage == 0 then
- print("Waiting")
- WaitStage = WaitStage+1
- elseif WaitStage == 1 then
- print("Waiting.")
- WaitStage = WaitStage+1
- elseif WaitStage == 2 then
- print("Waiting..")
- WaitStage = WaitStage+1
- elseif WaitStage == 3 then
- print("Waiting...")
- WaitStage = 0
- end
- end
- local function readout()
- clear()
- print("Swings Taken: " .. KillCount )
- print("Unloaded Items: " .. Unloaded )
- end
- local function unload()
- for n=1,4 do
- Unloaded = Unloaded + turtle.getItemCount(n)
- turtle.select(n)
- turtle.dropUp()
- readout()
- end
- turtle.select(1)
- end
- -- run code
- clear()
- while true do
- if turtle.attack() == true then
- KillCount = KillCount+1
- unload()
- else
- readout()
- waiting()
- os.sleep(.25)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement