This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Tin's profile picture

Melee turtle program

Started by Tin, 08 June 2013 - 10:16 AM
Tin #1
Posted 08 June 2013 - 12:16 PM
I'm looking for a program for a melee turtle to make it attack for a limited time(for about 3 seconds)
and not forever.
Lyqyd #2
Posted 08 June 2013 - 03:19 PM
Split into new topic.
Bomb Bloke #3
Posted 08 June 2013 - 08:35 PM
The simple way:

for i=1,<somenumber> do
  turtle.attack()
  sleep(0.5)
end

The higher the number you put in place of "<somenumber>", the more times the loop will repeat and hence the longer the turtle will attack.