Skip to content

Commit

Permalink
Start auto attacks if TARGET is one of the targets
Browse files Browse the repository at this point in the history
  • Loading branch information
Snakybo committed Oct 22, 2020
1 parent 89ea801 commit 7c4151c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
20 changes: 18 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
# Changelog

## [0.9,2] - 2020-10-22
## [0.9.3] - 2020-10-22

### Changed

- [0.9.2] Only try starting auto attacks on the current target if it's enemy and exists, will prevent "you cannot attack this target" messages and automatic target switching as melee

### Removed

- [0.9.2] Removed manual option to start auto attacks

### Fixed

- [0.9.3] Start auto attacks if any of the configured target units are the current target

## [0.9.2] - 2020-10-22 [YANKED]

### Changed

Expand Down Expand Up @@ -241,7 +255,9 @@

- Initial public release

[Unreleased]: https://github.com/Snakybo/Clicked/compare/0.9.1...master
[Unreleased]: https://github.com/Snakybo/Clicked/compare/0.9.3...master
[0.9.3]: https://github.com/Snakybo/Clicked/releases/tag/0.9.3
[0.9.2]: https://github.com/Snakybo/Clicked/releases/tag/0.9.2
[0.9.1]: https://github.com/Snakybo/Clicked/releases/tag/0.9.1
[0.9.0]: https://github.com/Snakybo/Clicked/releases/tag/0.9.0
[0.8.3]: https://github.com/Snakybo/Clicked/releases/tag/0.8.3
Expand Down
2 changes: 1 addition & 1 deletion Clicked.toc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#@end-non-retail@
## Title: Clicked
## Author: Snakybo
## Version: 0.9.2
## Version: 0.9.3
## Notes: Keybindings made easy.
## SavedVariables: ClickedDB
## OptionalDeps: Ace3
Expand Down
20 changes: 17 additions & 3 deletions Core/BindingProcessor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,23 @@ local function GetMacroForBindings(bindings)
table.insert(extra, "/stopcasting")
end

if not startAutoAttack and binding.primaryTarget.unit == Clicked.TargetUnits.TARGET then
startAutoAttack = true
table.insert(extra, "/startattack [@target,harm,exists]")
if not startAutoAttack then
local valid = false

if binding.primaryTarget.unit == Clicked.TargetUnits.TARGET then
valid = true
else
for _, target in ipairs(binding.secondaryTargets) do
if target.unit == Clicked.TargetUnits.TARGET then
valid = true
end
end
end

if valid then
startAutoAttack = true
table.insert(extra, "/startattack [@target,harm,exists]")
end
end

for i = #extra, 1, - 1 do
Expand Down

0 comments on commit 7c4151c

Please sign in to comment.