Skip to content
This repository was archived by the owner on Jan 17, 2022. It is now read-only.

Commit

Permalink
��Added stunCheck so we don't shift out when stunned.
Browse files Browse the repository at this point in the history
  • Loading branch information
HxxxxxS committed Jul 16, 2021
1 parent 1947ae2 commit 8438dba
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
20 changes: 14 additions & 6 deletions PsiloShift.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,48 @@ do
end

PSprint("available commands:")

do
local name = "stunCheck"
local b = _G[name] or CreateFrame('Button', name, nil, 'SecureActionButtonTemplate,SecureHandlerBaseTemplate');
b:SetAttribute('type', 'macro');
b:SetAttribute('macrotext', '/run if C_LossOfControl.GetActiveLossOfControlDataCount()>1 then SetCVar("autoUnshift",0) end');
PSprint("'/click "..name.."' |cff00ff00- disable autoUnshift if stunned (inherited in |cff00ffffshiftStart |rand |cff00ffffformStart|r)")
end
do
local name = "shiftStart"
local b = _G[name] or CreateFrame('Button', name, nil, 'SecureActionButtonTemplate,SecureHandlerBaseTemplate');
b:SetAttribute('type', 'macro');
b:SetAttribute('macrotext', '/run if GetSpellCooldown(768)>0 or UnitPower("player",0)<GetSpellPowerCost(768)[1].cost then SetCVar("autoUnshift",0) end');
PSprint("'/click "..name.."' |cff00ff00- enable autoUnshift if cast ready (start of macro)")
b:SetAttribute('macrotext', '/click stunCheck\n/run if GetSpellCooldown(768)>0 or UnitPower("player",0)<GetSpellPowerCost(768)[1].cost then SetCVar("autoUnshift",0) end');
PSprint("'/click "..name.."' |cff00ff00- disable autoUnshift if on GCD (start of macro)")
end
do
local name = "shiftEnd"
local b = _G[name] or CreateFrame('Button', name, nil, 'SecureActionButtonTemplate,SecureHandlerBaseTemplate');
b:SetAttribute('type', 'macro');
b:SetAttribute('macrotext', '/run SetCVar("autoUnshift",1)');
PSprint("'/click "..name.."' |cff00ff00- disable autoUnshift (end of macro)")
PSprint("'/click "..name.."' |cff00ff00- enable autoUnshift (end of macro)")
end
do
local name = "shiftPot"
local b = _G[name] or CreateFrame('Button', name, nil, 'SecureActionButtonTemplate,SecureHandlerBaseTemplate');
b:SetAttribute('type', 'macro');
b:SetAttribute('macrotext', '/click formStart\n/run if GetItemCooldown(13446)>0 then SetCVar("autoUnshift",0) end');
PSprint("'/click "..name.."' |cff00ff00- enable autoUnshift if pot cooldown is ready (start of macro), inherits from |cff00ffffshiftStart")
PSprint("'/click "..name.."' |cff00ff00- disable autoUnshift if potions are on CD (start of macro), also inherits from |cff00ffffshiftStart")
end
do
local name = "shiftHS"
local b = _G[name] or CreateFrame('Button', name, nil, 'SecureActionButtonTemplate,SecureHandlerBaseTemplate');
b:SetAttribute('type', 'macro');
b:SetAttribute('macrotext', '/click formStart\n/run if GetItemCooldown(20520)>0 then SetCVar("autoUnshift",0) end');
PSprint("'/click "..name.."' |cff00ff00- enable autoUnshift if health stone cooldown is ready (start of macro), inherits from |cff00ffffshiftStart")
PSprint("'/click "..name.."' |cff00ff00- disable autoUnshift if healthstone is on CD (start of macro), inherits from |cff00ffffshiftStart")
end
do
local name = "shiftSap"
local b = _G[name] or CreateFrame('Button', name, nil, 'SecureActionButtonTemplate,SecureHandlerBaseTemplate');
b:SetAttribute('type', 'macro');
b:SetAttribute('macrotext', '/click formStart\n/run if GetItemCooldown(10646)>0 then SetCVar("autoUnshift",0) end');
PSprint("'/click "..name.."' |cff00ff00- enable autoUnshift if sapper cooldown is ready (start of macro), inherits from |cff00ffffshiftStart")
PSprint("'/click "..name.."' |cff00ff00- disable autoUnshift if sapper is on CD (start of macro), inherits from |cff00ffffshiftStart")
end
do
local name = "formStart"
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ The formStart function will set your actionbar to a number from 1-6 using the fo
`/changeactionbar [noform] 1; [form:1] 2; [form:3] 3; [form:4] 4; [form:5] 5 ; 6;`

## Available commands and what they are shortening
* `/click stunCheck` - `/run if C_LossOfControl.GetActiveLossOfControlDataCount() then SetCVar("autoUnshift",0) end`

Disables autoUnshift if we are stunned. Inherited by shiftStart and formStart.
* `/click shiftStart` - `/run if GetSpellCooldown(768)>0 or UnitPower("player",0)<GetSpellPowerCost(768)[1].cost then SetCVar("autoUnshift",0) end`

Only checks cooldown and spell cost of shapeshifting, disables autoUnshift if necessary.
Expand All @@ -64,7 +67,7 @@ The formStart function will set your actionbar to a number from 1-6 using the fo
* `/click shiftSap` - same thing as above, but for Sappers instead of pots
* `/click shiftEnd` - `/run SetCVar("autoUnshift",1)`

Disabled enables autoUnshift again at end of macro.
Enables autoUnshift again at end of macro.
* `/click formStart` - `/changeactionbar [noform]1;[form:1]2;[form:3]3;[form:4]4;[form:5]5;6;`

Changes your actionbar number based on current form. We can then use actionbar number as a variable to get back into the same form later.
Expand Down

0 comments on commit 8438dba

Please sign in to comment.