Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function clear()
- term.clear()
- term.setCursorPos (1,1)
- end
- function check()
- if turtle.getItemCount(16)>0 then
- deposit()
- end
- end
- function deposit()
- clear()
- print("My inventory is full!")
- print("Depositing in chest...")
- turtle.turnRight()
- turtle.turnRight()
- for i1=1, 16, 1 do
- clear()
- print("My inventory is full!")
- print("Depositing in chest...")
- print("Current slot: "..i1)
- turtle.select(i1)
- turtle.drop()
- end
- turtle.select(1)
- print("Done!")
- print("Getting back to work!")
- sleep(1)
- turtle.turnLeft()
- turtle.turnLeft()
- timer=os.startTimer(1)
- end
- i=0
- timer=os.startTimer(1)
- clear()
- while true do
- local event, arg = os.pullEvent()
- if event == "timer" then
- if arg == timer then
- timer=os.startTimer(1)
- end
- else
- if event == "key" then
- if arg == 28 then
- print("Shutting down...")
- sleep(0.5)
- break
- end
- end
- end
- check()
- clear()
- print("Killed mobs: "..i)
- print("Hit [ENTER] to stop the program!")
- if turtle.attack() then
- i=i+1
- end
- end
- clear()
- print("Program stopped.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement