Alright the pastebin.com blocks aswell my code, so I will give it to you here
Code:
-- [Auto Mana Gem]
local start, duration, enable = GetContainerItemCooldown(0, 2)
local id = GetContainerItemID(0, 2)
if id == 33312
and duration ~= 120
and 100 * UnitPower("player") / UnitPowerMax ("player") < 75
and (UnitCastingInfo("player") == nil
and UnitChannelInfo("player") == nil)
then
RunMacro("Gem")
elseif id ~= 33312
and 100 * UnitPower("player") / UnitPowerMax ("player") > 10
then
print("Mana Gem Missing!")
end
1) Mana gem should be placed in Backpack, slot 2 [local id = GetContainerItemID(0, 2)], 0 is backpack, 2 is slot, you can change it (i have heartstone on slot 1)
2) When u are less then 75% mana, and in slot 2 ther is a Mana Gem, AND you are not casting/channeling (evocation for example), it will run macro named "Gem". This is important because if you dont add the "cast check" it stops evocation/polymorph/any cast to eat the gem ><, not good
. The "Gem" macro is simply "/cast Mana Sapphire"
3) It checks if slot 2 of backpack is Mana Sapphire by itemID. I don't know how to script it best, like "check if there is a mana gem somewhere in backpack, i simply write "check if mana gem is on slot 2, backpack), so be sure that slot is only for gem or the script won't understand.
4) If slot 2 is empty (like u already used all 3 gems),
or there is another item on that slot, AND you have enough mana to conjure gems (10%), it prints on chat "Mana Gem Missing!".
5) I didn't add the Conjure Mana Gem auto cast, since i'm writing a PvP profile, so it just says you don't have the mana gem, and they u can craft them manually when its best time for you, in arena/bg.
Have fun