Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local input="bottom"
- local attackInterval=1
- function doAttack()
- print("Switching to Attack Mode")
- while(rs.getInput(input)) do
- turtle.attack(attackInterval)
- sleep(attackInterval)
- end
- print("Switching to Passive Mode")
- end
- while(true) do
- if(rs.getInput(input)) then
- doAttack()
- end
- os.pullEvent("redstone")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement