I'm trying to get the below script to repeat an N number of times. Specifically I want to throw a martial hook 5 times, strip the skeleton, and grab the coins. I need the delay in there for the time it takes to recover from an action. Any assistance would be much appreciated.
sub fight
world.addtimer "my_timer", 0, 0, 5, "martial hook at skeleton", 1025, "On_Timer_Fired"
world.setvariable "attack_count", 0
world.send "strip skel"
world.send "get coi"
end sub
sub On_Timer_Fired (strTimerName)
dim count
' count attacks
count = world.getvariable ("attack_count") + 1
if count >= 5 then
world.deletetimer "my_timer"
else
world.setvariable "attack_count", count
end if
end sub
sub fight
world.addtimer "my_timer", 0, 0, 5, "martial hook at skeleton", 1025, "On_Timer_Fired"
world.setvariable "attack_count", 0
world.send "strip skel"
world.send "get coi"
end sub
sub On_Timer_Fired (strTimerName)
dim count
' count attacks
count = world.getvariable ("attack_count") + 1
if count >= 5 then
world.deletetimer "my_timer"
else
world.setvariable "attack_count", count
end if
end sub