Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- wait till redstone... and then cool down 3000 hits
- function detect()
- while not redstone.getInput(side) do
- os.sleep(30)
- end
- while redstone.getInput(side) do
- attack()
- end
- counter = 60
- while counter > 0 do
- attack()
- counter = counter - 1
- end
- end
- -- kill whatever is in front
- function attack()
- turtle.attack()
- if turtle.getItemCount(4) > 0 then
- for x=1, 16 do
- turtle.select(x)
- turtle.dropDown()
- end
- turtle.select(1)
- end
- sleep(0.5)
- end
- -- ---------- Running programm ----------
- -- Set params
- side = "back"
- -- repeat loop and never stop
- repeat
- result, err = pcall(detect)
- if not result then
- print("Horrible nasty stuff happened...")
- print(err)
- print("Whatever happend... The killing needs to resume!")
- end
- os.sleep(60)
- until false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement