commit fc8c55e1ccf63bf6c24d766eb319a4c645fd39d5 Author: ovc Date: Mon Sep 9 18:01:10 2024 +0300 init diff --git a/OBWT.lua b/OBWT.lua new file mode 100644 index 0000000..a39af0d --- /dev/null +++ b/OBWT.lua @@ -0,0 +1,51 @@ +function OBWT_OnLoad() + this:RegisterEvent('PLAYER_ENTERING_WORLD') + this:RegisterEvent('ADDON_LOADED') + DEFAULT_CHAT_FRAME:AddMessage('One button warrior tanking. Type /obwt for usage.') + SlashCmdList['OBWT'] = function() + local msg = 'To use OBWT addon, create a macro and type /script obwt();' + DEFAULT_CHAT_FRAME:AddMessage(msg) + end; + SLASH_OBWT1 = '/obwt' +end + +function obwt() + local rage = UnitMana('player') + local bloodthirst = 'Ability_Warrior_Bloodthirst' + local revenge = 'Ability_Warrior_Revenge' + local sunderArmor = 'Ability_Warrior_SunderArmor' + local rend = 'Ability_Warrior_Rend' + local battleShout = 'Ability_Warrior_BattleShout' + local heroicStrike = 'Ability_Warrior_HeroicStrike' + + TargetNearestEnemy() + if UnitExists('target') and UnitCanAttack('player','target') then + AttackTarget() + if rage < 15 == nil and isUsable(bloodthirst) then + CastSpellByName('Bloodthirst') + elseif buffed('Battle Shout') == nil and isUsable(battleShout) then + CastSpellByName('Battle Shout') + elseif isUsable(revenge) then + CastSpellByName('Revange') + elseif isUsable(sunderArmor) then + CastSpellByName('Sunder Armor') + elseif rage > 50 and buffed('Rend', 'target') == nil and isUsable(rend) then + CastSpellByName('Rend') + elseif rage > 70 and isUsable(heroicStrike) then + CastSpellByName('Heroic Strike') + end + end + +local function isUsable(spellTexture) + return IsUsableAction(getSlot(spellTexture)) +end + +local function getSlot(spellTexture) + for i = 1, 120, 1 + do + if(GetActionTexture(i) ~= nil) then + if(strfind(GetActionTexture(i), spellTexture)) then return i end + end + end + return 0 +end; \ No newline at end of file diff --git a/OBWT.toc b/OBWT.toc new file mode 100644 index 0000000..2920f37 --- /dev/null +++ b/OBWT.toc @@ -0,0 +1,7 @@ +## Interface: 11200 +## Title: OBWT |cff808080by cvtk +## Author: cvtk +## Notes: One button warrior tanking. +## Version: GIT + +main.lua \ No newline at end of file diff --git a/OBWT.xml b/OBWT.xml new file mode 100644 index 0000000..4639eda --- /dev/null +++ b/OBWT.xml @@ -0,0 +1,8 @@ + +