1. #1

    {Weakauras} How to make an icon change color when out of range and out of resource?

    Hey everyone so as the title says I'm looking for help with how to make some spell icons change change color to two different colors. One color when I am not in range and another color when I do not have enough resource. Help is very much appreciated.

  2. #2
    It'd be easier if you said which spell.

    But, create two triggers. First checks for the resources, then second uses a custom code to check range, trigger:

    Code:
    function()
      if(IsSpellInRange("Spellname", "target") == 1) then
        return false
      else
        return true
      end
    end
    untrigger:
    Code:
    function()
      if(IsSpellInRange("Spellname", "target") == 1) then
        return false
      else
        return true
      end
    end
    Reverse those triggers, depending on how you want it to show.Then use the Conditions tab to alter the colour based on the triggers.
    Last edited by Matchu; 2017-05-17 at 11:07 PM.

  3. #3
    Here's my solution:

    In your aura go to the Animations tab. Under Main, choose Custom. Check Color, choose Custom Function

    In the text box, put this:

    Code:
    function()
        spell = "Regrowth"
        inRange = IsSpellInRange(spell, "target")
        isUsable, notEnoughMana = IsUsableSpell(spell)
        if inRange == 1 and notEnoughMana == false then
            return 1, 1, 1, 1
        elseif inRange == 0 then
            return 1, 0.2, 0.2, 1
        else 
            return 0.5, 0.5, 0.5, 1
        end
    end
    Replace SPELL NAME with the name of the spell. It will make the icon red when out of range, dimmed when out of resource. Change the numbers after the return statements if you want different colors, they are RGBA values.

    Here's an example that you can import, this is for Regrowth:

    Code:
    dOtOeaGAIQ0UusTniOzRYVr1nHaNwu3McptvQ2jH2R0UHA)GrPK4VeKXbH68uKHIcvdgz4KYbHqoLsshdLoNQewib1svfwSsOwUipujWtPAzevEoLEmrMQQAYq00vCrLGUkrvDzHRRuBKOkMMsiBwv02rbFefkZcf9zs13jkhMKHbjJgsnEuiNuvk3svIUMsK7rrTscSiLO(PQKUS9xpxr23rikeVuDBD5wVO1S1nQJSoY(RRKMmdXpL11Jec4iJk(swu1Nuwxps9xFmPf1TJA226BCWqGN6Q9WRVTHqw0CzVIRW1dgc8uFbC(HKlddeJN46PWAbAfxlUB16BBi0gNNkC9uOoxlUtuze1Fe6jUSbD9TneYQf3jQmIkCDlAUSxX1TO5Yq0jtzYw3Qf3jQmIkI4x8oc7u)4kK9xFuxGh56VUX(MC)D6uFuxGN(RBSVj3FNo1rMF(mlTVXu)1n23K7VtN6jLu0FDJ9n5(70PUgdAJ6c80FDJ9n5(70PEIFr)1n23K7VtN6pvstMJ7VUX(MC)D60P(gpPSUEK6VUfnx2R46w0Czi6KPmzRB1I7evgrfr8lEhHDQJmBL3nwAYme1v3vpf6zo(BslQNL4464TXpL11JKTIS1Z48iKe3q7Ijqwr26zK1xa)4jGcgPm0UOUcNnutMJ7VUHkJ7V(yslQlTTd3OUvsDbJQiBDj(XtFtArDPTD4g1TsQlmvr26QtdTQIOQZOkIQUPkIQUe)4jevr26s8JNySkYwxIF80JkYwxIF8K8SXs1tXStyGEUXstMJxzvqaqabeqwT4oGmd0Ypc9ex2GEzqaqabeqz8dfwpaYmqVzDT4U3Wpuy9yfRwChtGwEuj9ywEvqaqabeqzR8TQfFbtGW8zHy(whncuyfqMb6nR8TQfFHRf3TIvlUBvqaqabeq5NaLXpuy9aiZMbIfifgjqy(SqmFRJgbkSciZMb6P6Sbqd6adcaciGaciGacOum7egiwMaXYeiwMaXccaciGakoBKFcug)qH1dGmBgiuanOdmiaiGaciGaciGsXStyGyzceQ1YXeiuRLJjqSGaGaciGIZgabcaciGaciGacOum7egiuRxIjqOwVetGqTEjMaXccaciGakWibbbgz9eFuturu1L4hpjCfzRVTHqs8JNQWD60PodvKDrYX2Pf

  4. #4
    Quote Originally Posted by Tiyr View Post
    Here's my solution:

    In your aura go to the Animations tab. Under Main, choose Custom. Check Color, choose Custom Function

    In the text box, put this:

    Code:
    function()
        spell = "Regrowth"
        inRange = IsSpellInRange(spell, "target")
        isUsable, notEnoughMana = IsUsableSpell(spell)
        if inRange == 1 and notEnoughMana == false then
            return 1, 1, 1, 1
        elseif inRange == 0 then
            return 1, 0.2, 0.2, 1
        else 
            return 0.5, 0.5, 0.5, 1
        end
    end
    Replace SPELL NAME with the name of the spell. It will make the icon red when out of range, dimmed when out of resource. Change the numbers after the return statements if you want different colors, they are RGBA values.

    Here's an example that you can import, this is for Regrowth:

    Code:
    dOtOeaGAIQ0UusTniOzRYVr1nHaNwu3McptvQ2jH2R0UHA)GrPK4VeKXbH68uKHIcvdgz4KYbHqoLsshdLoNQewib1svfwSsOwUipujWtPAzevEoLEmrMQQAYq00vCrLGUkrvDzHRRuBKOkMMsiBwv02rbFefkZcf9zs13jkhMKHbjJgsnEuiNuvk3svIUMsK7rrTscSiLO(PQKUS9xpxr23rikeVuDBD5wVO1S1nQJSoY(RRKMmdXpL11Jec4iJk(swu1Nuwxps9xFmPf1TJA226BCWqGN6Q9WRVTHqw0CzVIRW1dgc8uFbC(HKlddeJN46PWAbAfxlUB16BBi0gNNkC9uOoxlUtuze1Fe6jUSbD9TneYQf3jQmIkCDlAUSxX1TO5Yq0jtzYw3Qf3jQmIkI4x8oc7u)4kK9xFuxGh56VUX(MC)D6uFuxGN(RBSVj3FNo1rMF(mlTVXu)1n23K7VtN6jLu0FDJ9n5(70PUgdAJ6c80FDJ9n5(70PEIFr)1n23K7VtN6pvstMJ7VUX(MC)D60P(gpPSUEK6VUfnx2R46w0Czi6KPmzRB1I7evgrfr8lEhHDQJmBL3nwAYme1v3vpf6zo(BslQNL4464TXpL11JKTIS1Z48iKe3q7Ijqwr26zK1xa)4jGcgPm0UOUcNnutMJ7VUHkJ7V(yslQlTTd3OUvsDbJQiBDj(XtFtArDPTD4g1TsQlmvr26QtdTQIOQZOkIQUPkIQUe)4jevr26s8JNySkYwxIF80JkYwxIF8K8SXs1tXStyGEUXstMJxzvqaqabeqwT4oGmd0Ypc9ex2GEzqaqabeqz8dfwpaYmqVzDT4U3Wpuy9yfRwChtGwEuj9ywEvqaqabeqzR8TQfFbtGW8zHy(whncuyfqMb6nR8TQfFHRf3TIvlUBvqaqabeq5NaLXpuy9aiZMbIfifgjqy(SqmFRJgbkSciZMb6P6Sbqd6adcaciGaciGacOum7egiwMaXYeiwMaXccaciGakoBKFcug)qH1dGmBgiuanOdmiaiGaciGaciGsXStyGyzceQ1YXeiuRLJjqSGaGaciGIZgabcaciGaciGacOum7egiuRxIjqOwVetGqTEjMaXccaciGakWibbbgz9eFuturu1L4hpjCfzRVTHqs8JNQWD60PodvKDrYX2Pf
    Hi this works perfectly for targeted spells, but how would I use this for Crash Lightning or Revenge in which I don't need a target to use it?

Posting Permissions

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