1. #1

    Looking for a custom WeakAura

    I'm looking for someone to make me a custom .LUA script for WeakAuras for my AMS ability. The primary function of the aura is this: It'll show me in text the remaining absorption amount of AMS according to my current max health, preferably updating every few milliseconds.

    Any help would be greatly appreciated.

  2. #2
    Still need help with this. Anyone?

  3. #3
    Not tested:
    Code:
    dmuBeaqEIkRNQknFGO2VYIeIlrvHgLq6ucQzjQUfjSlsv)ciYWeLJjuldK8mIstdkDnIITbQ(gjACa15ayDuvW7ar3ta2hvvCqbzHcOhsvv2iq4KGuReQ8sQk1nbLDcc)uG8ujtvexfi5RuvK5kqTxK)skdw1HPYdRQOEmjnzu5YsTzI8zanAr60u8AQkXSjCBOQDtPFJsdNuzxvvslNQ8Cu10HCDuSDO47aPgprvlMQQAkMsOYqf0wu7j5u7GHwL1YhCPRfcTk1XXcATqwKbMdOrTsBHGkEQI1JvVs9GPcpvCuXrjujXArLXVnbbuYqfNHxNWjxslpIQqWkFy3hvPsLHhXIpPLhrLeJvfzyT7rdVlyvDIDRdFNRLBuzT5A5A5A5A5A5A5A5A5A5A5A5yCcMoaqznOazKKIgrNWjx7fjFpsilYOaMdOrDVsBHisyi3hU9999HBFFF3iThfJtW0dKdWAeH3rPTD423333333nsrX4em9UF2baaaaaacVJsB7WTVVVVVVVVVVVJXjy69a2X7qP6LeSSErX4emnifNLLfwV(9iWImC77777777TLdYHBFFFFFFF3iffJtW07(zhaaaH3rPTDF4233333333333X4em9Ea74DOu9scwwVOyCcMgKIZYYcVRx)EeFjY(WTVVVVVVV3woi3hU99992Yb5WTVVV71igpBumobthgY9HRTCqsLxd0WAtKtxtfQLhrLkdpIfFslpcu64COMQgtBruz4OkeSIk5cssIVreiuagUsWGZIvcptwOILbBgjPalCQqEgGaBpkHkEDTqanhvWLjglyQy4BnEDTqanhfiv86AvJKrfuwdIk)L6Z(QFz8yOY6W38ucbrmvHSiJcyoGg19kTfccriQ4AEvQcbR2vSJXjyAQaTHdLsGaowLYcak4WJJbdfyLYcNKuGfovsSwevWKZZ4429hRLRT8n3Up1(Nkld(epdqGThpbrmvPTbykIaHYmzHdwzCma4YGndauGjjfybtL8bjjX3icekaNfltMsWaadakzXgReojPaRsQeSookHkpwrtjuHNrGmucHievm8TMklE)7quGuPkC88ucv8glqrtfSGGW3uHNrGmucvWcccFtbsicriQCCCgKH16eAipdqGThpLqicrLJsOkKfzuaZb0OUxPTqqf0wu7j5u7GHwL1YhCPRfcTk1XXcATqwKbMdOrTsBHGquHHGigBwgHica

  4. #4
    Quote Originally Posted by niai View Post
    Not tested:
    Code:
    dmuBeaqEIkRNQknFGO2VYIeIlrvHgLq6ucQzjQUfjSlsv)ciYWeLJjuldK8mIstdkDnIITbQ(gjACa15ayDuvW7ar3ta2hvvCqbzHcOhsvv2iq4KGuReQ8sQk1nbLDcc)uG8ujtvexfi5RuvK5kqTxK)skdw1HPYdRQOEmjnzu5YsTzI8zanAr60u8AQkXSjCBOQDtPFJsdNuzxvvslNQ8Cu10HCDuSDO47aPgprvlMQQAkMsOYqf0wu7j5u7GHwL1YhCPRfcTk1XXcATqwKbMdOrTsBHGkEQI1JvVs9GPcpvCuXrjujXArLXVnbbuYqfNHxNWjxslpIQqWkFy3hvPsLHhXIpPLhrLeJvfzyT7rdVlyvDIDRdFNRLBuzT5A5A5A5A5A5A5A5A5A5A5A5yCcMoaqznOazKKIgrNWjx7fjFpsilYOaMdOrDVsBHisyi3hU9999HBFFF3iThfJtW0dKdWAeH3rPTD423333333nsrX4em9UF2baaaaaacVJsB7WTVVVVVVVVVVVJXjy69a2X7qP6LeSSErX4emnifNLLfwV(9iWImC77777777TLdYHBFFFFFFF3iffJtW07(zhaaaH3rPTDF4233333333333X4em9Ea74DOu9scwwVOyCcMgKIZYYcVRx)EeFjY(WTVVVVVVV3woi3hU99992Yb5WTVVV71igpBumobthgY9HRTCqsLxd0WAtKtxtfQLhrLkdpIfFslpcu64COMQgtBruz4OkeSIk5cssIVreiuagUsWGZIvcptwOILbBgjPalCQqEgGaBpkHkEDTqanhvWLjglyQy4BnEDTqanhfiv86AvJKrfuwdIk)L6Z(QFz8yOY6W38ucbrmvHSiJcyoGg19kTfccriQ4AEvQcbR2vSJXjyAQaTHdLsGaowLYcak4WJJbdfyLYcNKuGfovsSwevWKZZ4429hRLRT8n3Up1(Nkld(epdqGThpbrmvPTbykIaHYmzHdwzCma4YGndauGjjfybtL8bjjX3icekaNfltMsWaadakzXgReojPaRsQeSookHkpwrtjuHNrGmucHievm8TMklE)7quGuPkC88ucv8glqrtfSGGW3uHNrGmucvWcccFtbsicriQCCCgKH16eAipdqGThpLqicrLJsOkKfzuaZb0OUxPTqqf0wu7j5u7GHwL1YhCPRfcTk1XXcATqwKbMdOrTsBHGquHHGigBwgHica
    Works, got rid of the Ks and Ms because I'm OCD like that. Now how do I go about putting commas in there as separators?

    Display looks like this currently:
    Code:
    function () local name,_,icon,_,_,_,_,_,_,_,_,_,_,_,value=UnitBuff("player", "Anti-Magic Shell"); 
        return(value); 
    end;

  5. #5
    Try this for the custom function:
    Code:
    function () local name,_,icon,_,_,_,_,_,_,_,_,_,_,_,value=UnitBuff("player", "Anti-Magic Shell"); 
        return((math.floor(value/1000)).. "," ..(value%1000)); 
    end;

  6. #6
    Quote Originally Posted by niai View Post
    Try this for the custom function:
    Code:
    function () local name,_,icon,_,_,_,_,_,_,_,_,_,_,_,value=UnitBuff("player", "Anti-Magic Shell"); 
        return((math.floor(value/1000)).. "," ..(value%1000)); 
    end;
    Works exactly as I wanted it to, thanks a bunch!

  7. #7
    I just realized this would make weird things when the shell drops below 1000 or goes above 1M, you could use this instead which should fix those problems.

    Code:
    function () local name,_,icon,_,_,_,_,_,_,_,_,_,_,_,value=UnitBuff("player", "Anti-Magic Shell");
        if(value>999999)then
            value= ((math.floor(value/1000000)).. "," .. (math.floor(value/1000)%1000).. "," ..((value%1000)));
        end;
        
        if(value>999)then
            value=((math.floor(value/1000)).. "," ..(value%1000)); 
        end;
        return(value);
    end;

  8. #8
    Code:
    function () local name,_,icon,_,_,_,_,_,_,_,_,_,_,_,value=UnitBuff("player", "Anti-Magic Shell")
        if(value>999999)then
            value= ("%d,%d,%d"):format(math.floor(value/1000000),math.floor(value/1000)%1000,value%1000)
        end
        
        if(value>999)then
            value= ("%d,%d"):format(math.floor(value/1000),value%1000)
        end
        return(value)
    end
    Replaced the abundance of concat operators with string.format calls. Concatenation operators are inefficient for numbers if you only have a single operation, and inefficient for everything else if you have more than one (as they are processed one after another).
    UI & AddOns expert | Interface & Macros moderator - My work

  9. #9
    Thanks a lot. Last night I realized there is another issue I didn't fix. If the remaining value is for example 2070 it would of course only show 2,70 because 2070%1000 is 70. Is there a clean way to change that?

  10. #10
    Sure. I didn't think of that either, to be honest.
    Code:
    function () local name,_,icon,_,_,_,_,_,_,_,_,_,_,_,value=UnitBuff("player", "Anti-Magic Shell")
        if(value>999999)then
            value= ("%d,%03d,%03d"):format(math.floor(value/1000000),math.floor(value/1000)%1000,value%1000)
        end
        
        if(value>999)then
            value= ("%d,%03d"):format(math.floor(value/1000),value%1000)
        end
        return(value)
    end
    UI & AddOns expert | Interface & Macros moderator - My work

  11. #11

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •