Anyone know the lua code to get my mana bar changing color from blue to red, depending on the % left ?
Printable View
Anyone know the lua code to get my mana bar changing color from blue to red, depending on the % left ?
You can achieve that using conditions (e.g. the bar becomes red if mana < 40%):
Code:!WA:2!Dn1tRTXru8USqBzjP0iOMsiqbtWeknMytJtDBAkALLQuqXsmATZFQBvMDN3U7eVAMLzMvX2hx6HE2N6zDUN0H(bWFcgm9ypLpc(tqNzw1K2mGG3S697379737nE9AnRfPf532CHSelo(PuIk)ZUWfpknvcQN5joPjYtC6QGLywsoxmMtzQ4oD3pQl6sheexHvuoZR8g)V7pHtGW2henkKMWz51kbnldeYpzdXQW)muDAjeln5xjFJSkgMdm1KQ0u6jlN2P9KOPtIAJIQjvchLT2c5sbnM)AquxjHPvmQ6L1YsOOyarg8wwgladlOjJ7oCyOnP4Yc8PGaXWZazGOI5slexP4liqSPOrMMr0V7WX9oy45vSvnzq5nWjk6CiQ5Uvw)XhSWQPPj8cU4X(MZvgxbemCXHgfA60oNlHIuNzP)W6ySOttQEE(MQjnc2Oii))A6p3BHP5rqMbU8MRPV(sSjjd0PMFX5anlx9fHfCmzNqJEtwdnRQqrdqjfyPCn9xfekPNb2G34OnSayeB7UD792R8tnUvBYRQKkGaKNGpjh9A7G)xV27)xuw(cHRnCoYQU4CmJoZnf2bzMycvVlaSeMOealtL)r6RhY4m4Y)Dwn1oBfsW4tezTnvlB6DdNHPSE6VXaqVR(B1FN(H6DJtPmQm)9)SW68g3yh9dc0pki0KKk4CN1lPeaHg8J9J036LRtjgAz4LoD33zvFVqbNySzOoSGE2zyb5sZS2SbpQ0Xzq4zC(mpKds(cfpzEZO7JNF0kEOecWq739WUOytntPzbltfM9hJOXkS)vnpj6z)KvCXt6G62DFeUOmh7VDfLSCVNE4RQIUZ9vSdfuMTcqEZRUoVD3zjxqnRIoxBr)rObVy0(rThUW6CuxV(LBGsYHKJ7PVMF9CSGIJlGlm2BIbxP9TW68YwpcnhxubR)13tKKJzzG8MBOp6XE9)H)(wUJVFDPGBGPovF7n0p3sNf4d1Vq)t6Jma1)SdIVbZV)5UJV(x03UznnQXplVZa7UEkoboQdwQOSSqS4OdgC33D7UtSaUkgNCCMGxXinQ1ZZBS)928(TKIT3CRhS5wB3A(F9S)5p
Is there a code that i could put in custom function to make it change color? My weakauras doesn't have conditions since it's a wotlk version.
for old WA version, use this one:
Or you can just go to: Animation > Main > Custom > Color > Custom FunctionCode:!WA:2!DrvWUTTrq0siGMcI6IybuFOxQGrDQnqIJKrJBUKciQifRcflHv0ojfgqEj3HIBd1sIDxQi5Jc9qoRpbDoN0H(bKVacJ(fKpb)f0zxk70gciXDMzNHV3SVzD6uDsvwv27pCLkJkF7R4mD83)r76(rrkq)ANRP564uz)mnpvOCLZld4SMkcr)ds5cDqR2N63MCTnrsQMA2Rt22)p7xMYaVMN53)MaA4BhltZfSwPjPYF3XXzqL6h(KfAjF8yqQ(Uhi3S8V90ZZGafwICLmxatbH2dHu6cwU0w3QniwVKbPVdKebDcOCxOYGKKUmL7Nu5b24dZJI4ZwpQvZH(Jg63K47Ll46GSe6CqUixbJm2xExcdKaMaz4G296TIbby((iyKN0U3GoN1BzUydiDZ2MgQ5tb)sBdt)WxTIhMkgfAzyf85gSrbsbn5CKHiUBTKk4tSu4ycsqPUtXwEIub8rGQGHAjigRJV313s0rMwHubyzzQfM9yGtXEEtOCX73oW(PivcuH0eywLsBVnVFrLITccZv60jfhuS3sdDTbUKqtYIPof)CX(vN7uDMZsRFBTFCXdUxPzNCry2hIW)nqz)dCRHpjP4NQgcQqSDv7z1od7F2tH93TSRU7bp(oFVKo7ZUTPZJUn3FR(H)snDmiS(np3Tqc6CPOw9hw)HnSoHef8LrBGrRxgvWCn)CDdKgHh4uY)MB6lZReeXfCvm2Sl2dPNH3MoYIaQSuowXXPcEERqjh24H4)78WBCwHYdcm2mm8d7uS1AkUjm1r4VGyGpow)JEjPu2XEOemChYK8en3LeMqvQDkA66P4xbMfFYwwVeeTgbZrnF(ZZUpES0K9N4XeWag2XIVPCmRJeL1MJKGHTiTBF6xUtUiEL0IkReDdO8msWn43hMH8bY2VRrggrdHlArvAUyShvEXzDF0NTE0qtclT6xfNbes3xCIVC2MjFITEXRTVoXs5Nj1LLFHxc)QROsw5fkTUt97DvA6eNI7F5kDA40YjGVz6f7YzlMqf0rPjSJY5S1YztF1tg4D(thhToYqACoGQPviVZC30F9TfnmcAreFSRKlmfcUfjCgdeKtBFEBY6ujhLv2XMvN0N09p6FQFZERmJo8nxKrTkz1Xf)KRhQi0Ufp1DPcsISxPv81vvYJoSXVEyJJQo9FE9)(d
Btw, there is an updated WA version (same as retail, backported for Wotlk)Code:function()
local percent = UnitPower("player")/UnitPowerMax("player")
if percent > 0.4 then
return 0, 0, 1
else
return 1, 0, 0
end
end
https://github.com/Bunny67/WeakAuras-WotLK
The code doesn't works when i try to import it.
I tried the custom function code and it didn't show anything when i went below 40% mana.
Maybe because we are using different WA versions.
You can download the new WA, and import the code containing the custom function
or you can do it manually:
Trigger > Status > Power > Player
then copy/paste the Custom Function linked above to the tab "Animation".
Nice, it worked, do you know how can i put the % on it?
Go to the Display Tab > Display Text > %c% or %c % (which will result in: 100% or 100 %, respectively)
Then go to the window Custom Function:
In the 3rd line of the custom function, you can switch the number .0 to .1 or .2 to show more decimals (i.e. 99.9%, 99.99%)Code:function()
local percent = 100*UnitPower("player")/UnitPowerMax("player")
return ("%.0f"):format(percent)
end
On the Update Custom Text On ...:
- Every Frame will show the percent changes instantly
- Trigger Update will show the percent changes every 0.5 - 1%