then UseItemByName("Phirius Elixir - Type A"); end |
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
-- Begin Auto Potion macros
function AutoPot(pottype)
local selpotname = "None"
if pottype == "HP" then
if PctHP("player") < 80 and GetCountInBagByName("Phirius Potion - Type A") > 0 then
selpotname = "Phirius Potion - Type A"
end
if PctHP("player") < 70 and GetCountInBagByName("Phirius Potion - Type B") > 0 then
selpotname = "Phirius Potion - Type B"
end
if PctHP("player") < 60 and GetCountInBagByName("Phirius Potion - Type C") > 0 then
selpotname = "Phirius Potion - Type C"
end
if PctHP("player") < 50 and GetCountInBagByName("Phirius Potion - Type D") > 0 then
selpotname = "Phirius Potion - Type D"
end
if PctHP("player") < 40 and GetCountInBagByName("Phirius Potion - Type E") > 0 then
selpotname = "Phirius Potion - Type E"
end
end
if pottype == "MP" then
if PctMP("player") < 80 and GetCountInBagByName("Phirius Elixir - Type A") > 0 then
selpotname = "Phirius Elixir - Type A"
end
if PctMP("player") < 70 and GetCountInBagByName("Phirius Elixir - Type B") > 0 then
selpotname = "Phirius Elixir - Type B"
end
if PctMP("player") < 60 and GetCountInBagByName("Phirius Elixir - Type C") > 0 then
selpotname = "Phirius Elixir - Type C"
end
if PctMP("player") < 50 and GetCountInBagByName("Phirius Elixir - Type D") > 0 then
selpotname = "Phirius Elixir - Type D"
end
if PctMP("player") < 40 and GetCountInBagByName("Phirius Elixir - Type E") > 0 then
selpotname = "Phirius Elixir - Type E"
end
end
if pottype == "Both" then
if ((PctHP("player") < 80) or (PctMP("player") < 80)) and GetCountInBagByName("Phirius Special Water - Type A") > 0 then
selpotname = "Phirius Special Water - Type A"
end
if ((PctHP("player") < 70) or (PctMP("player") < 70)) and GetCountInBagByName("Phirius Special Water - Type B") > 0 then
selpotname = "Phirius Special Water - Type B"
end
if ((PctHP("player") < 60) or (PctMP("player") < 60)) and GetCountInBagByName("Phirius Special Water - Type C") > 0 then
selpotname = "Phirius Special Water - Type C"
end
if ((PctHP("player") < 50) or (PctMP("player") < 50)) and GetCountInBagByName("Phirius Special Water - Type D") > 0 then
selpotname = "Phirius Special Water - Type D"
end
if ((PctHP("player") < 40) or (PctMP("player") < 40)) and GetCountInBagByName("Phirius Special Water - Type E") > 0 then
selpotname = "Phirius Special Water - Type E"
end
end
UseItemByName(selpotname)
end
function PctHP(tgt)
return math.floor((UnitHealth(tgt)/UnitMaxHealth(tgt))*100) or -1
end
function PctMP(tgt)
return math.floor((UnitMana(tgt)/UnitMaxMana(tgt))*100) or -1
end
function PctSkill(tgt)
return math.floor((UnitSkill(tgt)/UnitMaxSkill(tgt))*100) or -1
end
|
Quoted from "frogman650;566879"
I am making macros so that when i click the button it uses one of 2 phirius pots depending on what % my hp/mp is at. I had no problems with the hp macro, but the mana one is giving me troubles. It does not seem to check my mana % before using a pot, so even if its at 100% it will still use the first pot listed in the macro. If anyone could please give me some assistance on the problem with my macro, or if this feature has been disabled it would be greatly appreciated. Thanks
This is the macro I have made, and described effects of above -
/script if (UnitMana("player")/UnitMaxMana("player")<=.7) then UseItemByName("Phirius Elixir - Type B"); elseif (UnitMana("player")/UnitMaxMana("player")<=.then UseItemByName("Phirius Elixir - Type A"); end


then UseItemByName("Phirius Potion - Type A"); end
then UseItemByName("Phirius Elixir - Type A"); end
then UseItemByName("Phirius Elikir - Type A"); end
Quoted from "RoMage;567062"
Another thing you can do with ntbuff is to set up to switch gear if under designated %.
ntBuff is very helpful to keep my buffs running all the time, for example to use Cursed Fangs I have to have Fang Ritual running all the time (15 min buff) and ntBuff does much better job then I.
Same for housekeeper pots, on all the time.
I am having issue with ntBuff not giving me numbers of action bars since last update. I might have to reinstall it.
Quoted from "frogman650;567065"
Ok I managed to figure out the problem, I play a K/W and it's 72/72, so i like to play on the w/k for more dps, the macro works fine for me on k/w, but on w/k, under my portrait the mana comes under the rage bar, and it seems that it looks to see what percent my rage is at instead of my mana. I continued further to test more macro parts I found on romwiki, and I came up with UnitSkill, and UnitMaxSkill. From what I understand the "Mana" is the first bar under your health, and the "Skill" is the second bar, even if the second bar is the mana O.o
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
function PctMana()
if CheckClass("Priest",1) or CheckClass("Mage",1) or CheckClass("Druid",1) or CheckClass("Warden",1) or CheckClass("Knight",1) then
return math.floor((UnitMana("player")/UnitMaxMana("player"))*100) or -1
elseif CheckClass("Priest",2) or CheckClass("Mage",2) or CheckClass("Druid",2) or CheckClass("Warden",2) or CheckClass("Knight",2) then
return math.floor((UnitSkill("player")/UnitMaxSkill("player"))*100) or -1
end
end
function PctRage()
if CheckClass("Warrior",1) or CheckClass("Champion",1) then
return math.floor((UnitMana("player")/UnitMaxMana("player"))*100) or -1
elseif CheckClass("Warrior",2) or CheckClass("Champion",2) then
return math.floor((UnitSkill("player")/UnitMaxSkill("player"))*100) or -1
end
end
function PctFocus()
if CheckClass("Scout",1) or CheckClass("Warlock",1) then
return math.floor((UnitMana("player")/UnitMaxMana("player"))*100) or -1
elseif CheckClass("Scout",2) or CheckClass("Warlock",2) then
return math.floor((UnitSkill("player")/UnitMaxSkill("player"))*100) or -1
end
end
function PctEnergy()
if CheckClass("Rogue",1) then
return math.floor((UnitMana("player")/UnitMaxMana("player"))*100) or -1
elseif CheckClass("Rogue",2) then
return math.floor((UnitSkill("player")/UnitMaxSkill("player"))*100) or -1
end
end
function CheckClass(str, num)
local mainClass, subClass = UnitClass("player")
if (str == mainClass) and (num == 1) then
return true
elseif (str == subClass) and (num == 2) then
return true
else
return false
end
end
|