1. #1

    ALT Cast w/ Macro

    Hey guys, I use 2 long script macros for Pain Suppression and Power Infusion that send a tell/raid message when I PS or PI someone and also checks range/CD so it doesn't spam the message if I can't cast the spell at that time. One problem I am running into is that sometimes I want to cast these on myself, and ALT casting isn't working. I have to actually target myself to use them, when I hold down ALT and use the macro, it still casts it on whatever my current target it.

    Now, I'm not very knowledgeable in LUA script/macro writing except for the little bit I added to these (I used a base and then tweaked it for my own use).

    Finally, my question is (lol)...what do I have to add to make ALT casting possible with these 2 macros? Thanks in advance to any knowledgeable macro people that can help me!!!

    Code:
    #showtooltip Pain Suppression
    /script local u,ps,c="target","Pain Suppression",GetNumRaidMembers()>0 and "RAID" or "PARTY";if IsSpellInRange(ps,u)==1 and GetSpellCooldown(ps)==0 then SendChatMessage("<<<<  "..GetSpellLink(ps).."  ON "..UnitName(u):upper().."  >>>>",c); SendChatMessage("<<<<  "..GetSpellLink(ps).."  ON YOU  >>>>","WHISPER",nil,UnitName(u)) end
    
    /cast [target] Pain Suppression
    Code:
    #showtooltip Power Infusion
    /script local u,pi="target","Power Infusion";if IsSpellInRange(pi,u)==1 and GetSpellCooldown(pi)==0 then SendChatMessage("<<<  YOU JUST GOT "..GetSpellLink(pi).." !!!!!!!!!!!!!!!!!!!","WHISPER",nil,UnitName(u)) end
    
    /cast [target] Power Infusion

    EX - <PIE CHART> US TOP 10 Check 'em out http://piechart-guild.com/

  2. #2
    Quote Originally Posted by glowyrm View Post
    Hey guys, I use 2 long script macros for Pain Suppression and Power Infusion that send a tell/raid message when I PS or PI someone and also checks range/CD so it doesn't spam the message if I can't cast the spell at that time. One problem I am running into is that sometimes I want to cast these on myself, and ALT casting isn't working. I have to actually target myself to use them, when I hold down ALT and use the macro, it still casts it on whatever my current target it.

    Now, I'm not very knowledgeable in LUA script/macro writing except for the little bit I added to these (I used a base and then tweaked it for my own use).

    Finally, my question is (lol)...what do I have to add to make ALT casting possible with these 2 macros? Thanks in advance to any knowledgeable macro people that can help me!!!

    Code:
    #showtooltip Pain Suppression
    /script local u,ps,c="target","Pain Suppression",GetNumRaidMembers()>0 and "RAID" or "PARTY";if IsSpellInRange(ps,u)==1 and GetSpellCooldown(ps)==0 then SendChatMessage("<<<<  "..GetSpellLink(ps).."  ON "..UnitName(u):upper().."  >>>>",c); SendChatMessage("<<<<  "..GetSpellLink(ps).."  ON YOU  >>>>","WHISPER",nil,UnitName(u)) end
    
    /cast [target] Pain Suppression
    Code:
    #showtooltip Power Infusion
    /script local u,pi="target","Power Infusion";if IsSpellInRange(pi,u)==1 and GetSpellCooldown(pi)==0 then SendChatMessage("<<<  YOU JUST GOT "..GetSpellLink(pi).." !!!!!!!!!!!!!!!!!!!","WHISPER",nil,UnitName(u)) end
    
    /cast [target] Power Infusion
    Not 100% on this, but I'm guessing that the [target] overrides the normal behavior. You could either remove [target] from /cast [target] Power Infusion and probably get the behavior you want or probably make a longer macro with checking the modifier for alt. I'm dead tired, so if that doesn't work you'll have to wait until someone else figures it out or I get some sleep and let you know.

    I think it might still send a tell to your target when you really cast it on yourself like that though. If no one helps, hopefully I can in the morning a bit better...

    To make it not send a tell you'd probably just need to add an "and no mod alt" to the script conditional part, but I dunno how to do that offhand.
    Last edited by Cactrot; 2010-07-28 at 06:14 AM.

  3. #3
    if you are using the default self cast settings you should just be able to remove [target] from the macros as this is overriding the default behavior
    Last edited by Dwing; 2010-07-28 at 06:12 AM. Reason: someone beat me to it

  4. #4
    Deleted
    Code:
    #showtooltip Pain Suppression
    /cast [mod:alt,@player][@target]Pain Suppression
    /stopmacro [mod:alt]
    /script local u,ps,c="target","Pain Suppression",GetNumRaidMembers()>0 and "RAID" or "PARTY";if IsSpellInRange(ps,u)==1 and GetSpellCooldown(ps)==0 then SendChatMessage("<<<<  "..GetSpellLink(ps).."  ON "..UnitName(u):upper().."  >>>>",c); SendChatMessage("<<<<  "..GetSpellLink(ps).."  ON YOU  >>>>","WHISPER",nil,UnitName(u)) end
    Code:
    #showtooltip Power Infusion
    /cast [mod:alt,@player][@target] Power Infusion
    /stopmacro [mod:alt]
    /script local u,pi="target","Power Infusion";if IsSpellInRange(pi,u)==1 and GetSpellCooldown(pi)==0 then SendChatMessage("<<<  YOU JUST GOT "..GetSpellLink(pi).." !!!!!!!!!!!!!!!!!!!","WHISPER",nil,UnitName(u)) end
    EDIT: Could swear that somebody once requested this already and I made a mini-addon for him that got rid of all the /script parts and allowed for mouseover etc. if needed. Sec, gonna check my post history.

    EDIT2: Yup, this should work:
    Code:
    local a = CreateFrame("Frame")
    a:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
    a:SetScript("OnEvent", function(self,event,...)
        local arg = {...}
        self.pguid = self.pguid or UnitGUID("player")
        if (arg[3] == self.pguid) and (arg[9] == 33206) and (arg[2] == "SPELL_CAST_SUCCESS") then
            SendChatMessage("*** \124cff71d5ff\124Hspell:33206\124h[Pain Suppression]\124h\124r ON "..arg[7].." ***", GetRealNumRaidMembers()>0 and "RAID" or GetNumRaidMembers()>0 and "BATTLEGROUND" or GetNumPartyMembers()>0 and "PARTY" or "SAY")
            SendChatMessage("*** \124cff71d5ff\124Hspell:33206\124h[Pain Suppression]\124h\124r ON YOU ***", "WHISPER", nil, arg[7])
        end
        if (arg[3] == self.pguid) and (arg[9] == 10060) and (arg[2] == "SPELL_CAST_SUCCESS") then
    hen
            SendChatMessage("*** \124cff71d5ff\124Hspell:10060\124h[Power Infusion]\124h\124r ON "..arg[7].." ***", GetRealNumRaidMembers()>0 and "RAID" or GetNumRaidMembers()>0 and "BATTLEGROUND" or GetNumPartyMembers()>0 and "PARTY" or "SAY")
            SendChatMessage("*** \124cff71d5ff\124Hspell:10060\124h[Power Infusion]\124h\124r ON YOU ***", "WHISPER", nil, arg[7])
        end
    end)
    How to implement
    Last edited by mmocba105e19de; 2010-07-28 at 06:19 AM.

  5. #5
    Yeah that was me you were helping a few weeks ago. I did all of that and made the mini addon deal but there was a reason why I didn't like it, I forget what it was. I couldn't figure out how to tailor it more to my specific needs, this is a few weeks ago now so I don't remember exactly what it was I didn't like/needed or whatever.
    Last edited by G l o w y r m; 2010-07-28 at 06:38 AM.

    EX - <PIE CHART> US TOP 10 Check 'em out http://piechart-guild.com/

  6. #6
    Deleted
    Ah, that was you. If you happen to remember what your issues were, I'm sure I could fix them.

Posting Permissions

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