vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | -- Auto-attack support |
2 | |||
3 | -- Thanks to FeralSkills for the idea on how to do this |
||
4 | function lazyr.IsAutoAttacking() |
||
5 | if (not lazyr.attackSlot) then |
||
6 | for i = 1, 120 do |
||
7 | if (IsAttackAction(i)) then |
||
8 | lazyr.attackSlot = i |
||
9 | break |
||
10 | end |
||
11 | end |
||
12 | end |
||
13 | if (not lazyr.attackSlot) then |
||
14 | lazyr.p("Couldn't find Attack action on your action bar, PLEASE ADD IT.") |
||
15 | return false |
||
16 | end |
||
17 | return (IsCurrentAction(lazyr.attackSlot) == 1) |
||
18 | end |
||
19 | |||
20 | function lazyr.StartAutoAttack() |
||
21 | if (not lazyr.IsAutoAttacking()) then |
||
22 | AttackTarget() |
||
23 | end |
||
24 | end |
||
25 | |||
26 | function lazyr.StopAutoAttack() |
||
27 | if (lazyr.IsAutoAttacking()) then |
||
28 | AttackTarget() |
||
29 | end |
||
30 | end |
||
31 | |||
32 |