LuaNinja Macro Collection menu

Shout-Out

User Tag List

Page 22 of 42 FirstFirst ... 181920212223242526 ... LastLast
Results 316 to 330 of 629
  1. #316
    pulse1200's Avatar Member
    Reputation
    4
    Join Date
    Jul 2009
    Posts
    23
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That would be absolutely brilliant and as soon as i am able will send rep your way. I wouldnt of guessed it would be quite simple for kittys but I would be deeply indebted to you for the work.

    Cheers =))

    LuaNinja Macro Collection
  2. #317
    Viral Fly-by's Avatar Contributor
    Reputation
    136
    Join Date
    Dec 2009
    Posts
    376
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How in the heck does that Macro work anyhow?

    One of the things I've been asked a lot is how in the heck some of these macros work. I hope to explain some of that with this post.

    First off, let me say that FORMATTING THE MACRO LIKE REAL CODE makes a huge difference as to how understandable it is. For example, consider this line from a macro:
    Code:
    /run f=0; if UnitExists("focus") then for i=1,40 do d={UnitBuff("focus",i)}; if d~=nil and d[1]=="Earth Shield" and d[8]=="player" and d[4]>1 and d[7]-GetTime()>=60 then f=1; break end end if f==0 then RunMacroText("/cast [@focus] Earth Shield") end end;
    WTF? Now format it properly...
    Code:
    /run f=0; 
    if UnitExists("focus") then 
    	for i=1,40 do 
    		d={UnitBuff("focus",i)}; 
    		if d~=nil and d[1]=="Earth Shield" and d[8]=="player" and d[4]>1 and d[7]-GetTime()>=60 then 
    			f=1; 
    			break 
    		end 
    	end 
    	if f==0 then 
    		RunMacroText("/cast [@focus] Earth Shield") 
    	end 
    end;
    Hopefully that makes more sense...you can see it's saying "if the focus exists" and then it's looking 1 to 40 checking each buff to see if it is Earth Shield from the player and some other stuff (they are checking the number of charges and time remaining). If it find such a buff on the focus, it sets f=1. So if the loop finishes and never found the buff, f will still be 0 (from the first line). So then we say "if f==0 then" and cast a new earth shield. Voila!


    Now for something a bit more complex...this is the "heal" line from my Resto Shaman macro...I've formatted it and added in comments in green to explain what each part is doing:
    Code:
    RT=2500;  -- Set variable for minimum damage taken to use Riptide
    RT2=5000; -- Set variable for maximum damage taken to use Riptide
    LHW=4000; -- Set variable for min dmg taken to use Lesser Healing Wave
    HW=10000; [COLOR="SeaGreen"]-- Set variable for min dmg taken to use Healing Wavev
    CH=10000; -- Set variable for "chain hheal threshold"
    NS=0.10;  -- Set variable for health threshold that will trigger use of Nature's Swiftness
    
    
    -- So we're going to be scanning the party/raid to find out who to heal...so we need unitids
    -- If it's a party, we need:  player, party1, party2, party3, party4
    -- If it's a raid, we need:  raid1, raid2, ..., raid40
    -- So we want to set 3 variables:
    --   t is the prefix of the unitid, either raid or party
    --   nps is "num players start"...so start with 1 for raid...start with 0 for party (party0 will become "player" later)
    --   npe is "num players end"...so it is the number of people in the raid/party
    
    t="raid"; nps=1; 
    npe=GetNumRaidMembers(); -- How many members in raid?  If no raid, we'll get 0.
    if npe==0 then -- if it was not a raid
    	-- then go party mode
    	t="party"; nps=0; npe=GetNumPartyMembers() 
    end; 
    
    s=nil; -- s will eventually hold the name of the spell we're going to cast
    m=0;   -- m will hold the maximum amount of damage taken by any raid/party member
    w=f;   -- w will hold the unitid of the person who took the max dmg
    
    -- loop through all the people in the raid/partyv
    for i=nps,npe do 
    	-- set tt to the unitid to check
    	-- normally just t..i is correct...but there is no partyN unitid for you,
    	-- so we use this if statement to change "party0" into "player"
    	if i==0 then tt="player" else tt=t..i end; 
    
    	-- if that unit exists, is in range, and isn't dead
    	if UnitExists(tt) and UnitInRange(tt)==1 and UnitIsDeadOrGhost(tt)~=1 then 
    		-- a holds how much damage they've taken
    		a=UnitHealthMax(tt)-UnitHealth(tt); 
    		-- if a is more than m, this person is our new "max damage" person
    		if a>m then 
    			-- save the damage they took (m) and their unit (w)
    			m=a w=tt 
    		end 
    	end 
    end; 
    
    -- after the loop is complete, we now know who is missing the most hp (w is their unitid) 
    -- and how much hp they are missing (m), so use those values to choose a spell (s)
    
    -- If Riptide is ready and the damage falls within Riptide's range, then set our spell to Riptide
    if GetSpellCooldown("Riptide")==0 and m>=RT and m<RT2 then 
    	s="Riptide" 
    
    -- Else if the damage is high enough to warrant a full Healing Wave...
    elseif m>=HW then 
    	-- If NS is ready and their health is below the NS threshold, then set our spell to NS
    	if GetSpellCooldown("Nature's Swiftness")==0 and UnitHealth(w)/UnitHealthMax(w)<NS then 
    		s="NS" 
    
    	-- Else if you have Tidal Waves or Bloodlust, then set our spell to Healing Wave
    	elseif UnitBuff("player","Tidal Waves") or UnitBuff("player","Bloodlust") or UnitBuff("player","Heroism") then 
    		s="Healing Wave" 
    
    	-- Otherwise just use LHW
    	else 
    		s="Lesser Healing Wave" 
    	end 
    
    -- Else if they've taken enough damage to warrant healing at all...
    elseif m>=LHW then 
    	-- If their maximum "power" is less than the Chain Heal threshold, set our spell to CH
    	-- The premise is that people with low max "power" are melee and so they are close enough
    	-- to each other to let CH bounce. People with higher max "power" are likely ranged and so
    	-- CH may not bounce so then LHW is faster/better.
    	if UnitPowerMax(w) < CH then 
    		s="Chain Heal" 
    
    	-- Otherwise just use LHW
    	else 
    		s="Lesser Healing Wave" 
    	end 
    end; 
    
    -- now we know who to heal and how to heal them...so let's do it.
    
    
    -- If we're using NS, stop casting and pop NS...then set the spell to Healing Wave
    if s=="NS" then 
    	SpellStopCasting(); 
    	CastSpellByName("Nature's Swiftness"); 
    	SpellStopCasting(); 
    	s="Healing Wave" 
    end; 
    
    -- Finally...if a spell was selected, cast that spell (s) on the appropriate unitid (w)
    -- If the person with the most damage wasn't hurt enough to warrrant healing, s will
    -- still be nil and so no  spell will be cast.
    if s~=nil then 
    	RunMacroText("/cast [@"..w.."] "..s) 
    end;
    This is how I write them...properly formatted...then at the very end I just delete all the new lines to combine each concrete step into it's own /run line.

    Hopefully someone finds this useful or at least interesting and maybe it helps some understand a bit more about what in the heck is going on in these macros. If you have any specific questions, just ask! =)
    Last edited by Viral Fly-by; 01-07-2010 at 05:43 PM.

  3. #318
    camav's Avatar Member
    Reputation
    6
    Join Date
    Mar 2008
    Posts
    18
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Elitetech View Post
    /run if not UnitDebuff("target", "Improved Scorch") then CastSpellByName("Scorch") end
    Thanks for this, this will be useful as well.

    I wasn't clear enough in my post, is it possible to add that to this macro thats on the front page?


    /run c=CastSpellByName;if not UnitDebuff("target", "Living Bomb") then c("Living Bomb") elseif UnitBuff("player", "Hot Streak") then c("Pyroblast") else c("Frostfire Bolt") end

  4. #319
    Viral Fly-by's Avatar Contributor
    Reputation
    136
    Join Date
    Dec 2009
    Posts
    376
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Viral Fly-by View Post
    pinhe1ro is correct. There is a problem in the macros around dispelling.


    I had UnitIsDeadorGhost rather than UnitIsDeadOrGhost. This is causing ALL of my cleansing macros from a few posts back to fail. It is also causing the Holy Paladin and Resto Shaman macros NOT TO DISPEL.

    I have UPDATED all of those posts with the corrected macro. Elitetech please update the front page for the change to the cleansing macros for all classes and the main HPala and RSham macros.
    Elitetech, you still need to update the front page...the healing macros and cleansing macros are wrong because of the typo I described.

  5. #320
    Viral Fly-by's Avatar Contributor
    Reputation
    136
    Join Date
    Dec 2009
    Posts
    376
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by camav View Post
    Thanks for this, this will be useful as well.

    I wasn't clear enough in my post, is it possible to add that to this macro thats on the front page?


    /run c=CastSpellByName;if not UnitDebuff("target", "Living Bomb") then c("Living Bomb") elseif UnitBuff("player", "Hot Streak") then c("Pyroblast") else c("Frostfire Bolt") end

    Here you go:
    Code:
    /run c=CastSpellByName; if not UnitDebuff("target", "Living Bomb") then c("Living Bomb") elseif (not UnitDebuff("target", "Improved Scorch") and not UnitDebuff("target", "Winter's Chill") and not UnitDebuff("target", "Shadow Mastery")) then c("Scorch") elseif UnitBuff("player", "Hot Streak") then c("Pyroblast") else c("Frostfire Bolt") end
    It will check for all sources of the debuff and cast Scorch only if they are all missing. Other than that it does the same as it did before...

  6. #321
    Elitetech's Avatar Contributor
    Reputation
    98
    Join Date
    Oct 2008
    Posts
    279
    Thanks G/R
    3/7
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just add 2 lines in the macro? So it'll be

    Code:
    /run if not UnitDebuff("target", "Improved Scorch") then CastSpellByName("Scorch") end
    /run c=CastSpellByName;if not UnitDebuff("target", "Living Bomb") then c("Living Bomb") elseif UnitBuff("player", "Hot Streak") then c("Pyroblast") else c("Frostfire Bolt") end
    Or if you really don't like more than 1 line then add it into.
    Code:
    /run c=CastSpellByName;if not UnitDebuff("target", "Living Bomb") then c("Living Bomb") elseif not UnitDebuff("target", "Improved Scorch") then c("Scorch") elseif UnitBuff("player", "Hot Streak") then c("Pyroblast") else c("Frostfire Bolt") end
    Edit: Or just use Virals. This ONLY (only) checks for improved scorch while Viral's checks for Winter's chill and shadow mastery as well.
    Knowledge is often mistaken for intelligence. This is like mistaking a cup of milk for a cow.

  7. #322
    Elitetech's Avatar Contributor
    Reputation
    98
    Join Date
    Oct 2008
    Posts
    279
    Thanks G/R
    3/7
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also updated the front page.
    Knowledge is often mistaken for intelligence. This is like mistaking a cup of milk for a cow.

  8. #323
    kakamonster's Avatar Member
    Reputation
    3
    Join Date
    Aug 2008
    Posts
    50
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    /run if IsUsableSpell("Hammer of Justice") and (UnitCastingInfo("target") or UnitChannelInfo("target")) and GetSpellCooldown("Hammer of Justice")==0 and IsSpellInRange("Hammer of Justice", "target")==1 then SpellStopCasting() CastSpellByName("Hammer of Justice") elseif IsUsableSpell("Arcane Torrent") and (UnitCastingInfo("target") or UnitChannelInfo("target")) and GetSpellCooldown("Arcane Torrent")==0 and IsSpellInRange("Crusader Strike", "target")==1 then SpellStopCasting() CastSpellByName("Arcane Torrent") end
    this still burn both Hammer of Justice and Arcane Torrent on enemy spell cast, anyone know how to fix it?

  9. #324
    camav's Avatar Member
    Reputation
    6
    Join Date
    Mar 2008
    Posts
    18
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Viral Fly-by View Post
    Here you go:
    Code:
    /run c=CastSpellByName; if not UnitDebuff("target", "Living Bomb") then c("Living Bomb") elseif (not UnitDebuff("target", "Improved Scorch") and not UnitDebuff("target", "Winter's Chill") and not UnitDebuff("target", "Shadow Mastery")) then c("Scorch") elseif UnitBuff("player", "Hot Streak") then c("Pyroblast") else c("Frostfire Bolt") end
    It will check for all sources of the debuff and cast Scorch only if they are all missing. Other than that it does the same as it did before...
    Thanks man, Appreciate it

  10. #325
    MrNemo's Avatar Member
    Reputation
    1
    Join Date
    Nov 2008
    Posts
    10
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Viral Fly-by View Post
    Why exactly would you need a macro to pull all of some item from a guild bank? Knocked over any 7-11s recently?
    Because I have 3 gather bots running and I deal with tabs of herbs and ore a day. I have yet to find an addon that does anything close to what I need it to do and a simple macro like such would save me countless amounts of time depositing/withdrawing from the gbank.

  11. #326
    Elitetech's Avatar Contributor
    Reputation
    98
    Join Date
    Oct 2008
    Posts
    279
    Thanks G/R
    3/7
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by MrNemo View Post
    Because I have 3 gather bots running and I deal with tabs of herbs and ore a day. I have yet to find an addon that does anything close to what I need it to do and a simple macro like such would save me countless amounts of time depositing/withdrawing from the gbank.
    Afaik BankStack does that yes?
    Knowledge is often mistaken for intelligence. This is like mistaking a cup of milk for a cow.

  12. #327
    MrNemo's Avatar Member
    Reputation
    1
    Join Date
    Nov 2008
    Posts
    10
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It can move stuff from bags to bank and vice versa, but not guild bank. It will also not take/put only say Adder's tongue out of the guild bank. Bankstack does an amazing job at keeping it all sorted and compressed though.

  13. #328
    Viral Fly-by's Avatar Contributor
    Reputation
    136
    Join Date
    Dec 2009
    Posts
    376
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by kakamonster View Post
    Code:
    /run if IsUsableSpell("Hammer of Justice") and (UnitCastingInfo("target") or UnitChannelInfo("target")) and GetSpellCooldown("Hammer of Justice")==0 and IsSpellInRange("Hammer of Justice", "target")==1 then SpellStopCasting() CastSpellByName("Hammer of Justice") elseif IsUsableSpell("Arcane Torrent") and (UnitCastingInfo("target") or UnitChannelInfo("target")) and GetSpellCooldown("Arcane Torrent")==0 and IsSpellInRange("Crusader Strike", "target")==1 then SpellStopCasting() CastSpellByName("Arcane Torrent") end
    this still burn both Hammer of Justice and Arcane Torrent on enemy spell cast, anyone know how to fix it?
    That's because Arcane Torrent is off the GCD so spamming it will make it cast them both because of latency.

    I made this one not do two interrupts within 1-second of each other. If you did an interrupt less than a second ago, it won't do try to do another.

    Code:
    /run if (_G["RetInterrupt"==nil or GetTime()-_G["RetInterrupt"]>1) then if IsUsableSpell("Hammer of Justice") and (UnitCastingInfo("target") or UnitChannelInfo("target")) and GetSpellCooldown("Hammer of Justice")==0 and IsSpellInRange("Hammer of Justice", "target")==1 then SpellStopCasting() CastSpellByName("Hammer of Justice") _G["RetInterrupt"]=GetTime() elseif IsUsableSpell("Arcane Torrent") and (UnitCastingInfo("target") or UnitChannelInfo("target")) and GetSpellCooldown("Arcane Torrent")==0 and IsSpellInRange("Crusader Strike", "target")==1 then SpellStopCasting() CastSpellByName("Arcane Torrent") _G["RetInterrupt"]=GetTime() end end

  14. #329
    Viral Fly-by's Avatar Contributor
    Reputation
    136
    Join Date
    Dec 2009
    Posts
    376
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by camav View Post
    Thanks man, Appreciate it
    NP...if you need anything else let me know. We could do a lot more with the macro if you wanted such as automatically using CS to interrupt or keeping your armor up or popping icy veins when it's up or whatever.

  15. #330
    kakamonster's Avatar Member
    Reputation
    3
    Join Date
    Aug 2008
    Posts
    50
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks will try it tomorrow. U DA MAN!

Page 22 of 42 FirstFirst ... 181920212223242526 ... LastLast

Similar Threads

  1. [Macro-Collection] All-In-One-Button Macro for all Classes from Level 15-90!
    By Classicclean in forum WoW UI, Macros and Talent Specs
    Replies: 21
    Last Post: 01-21-2014, 08:16 AM
  2. Addon For LuaNinja Macros
    By Tracerv0 in forum WoW UI, Macros and Talent Specs
    Replies: 7
    Last Post: 01-06-2010, 02:21 PM
  3. /Dump Macro Collection (WIP at mo!)
    By Anotherfox in forum WoW UI, Macros and Talent Specs
    Replies: 97
    Last Post: 01-04-2010, 03:21 PM
  4. [HOW TO] Ascii Macro + my collection
    By wickermanz in forum World of Warcraft Guides
    Replies: 12
    Last Post: 01-05-2009, 12:58 PM
  5. Macro Love - My Collection of useful and/or Space saving Macro's!
    By Anotherfox in forum World of Warcraft Guides
    Replies: 15
    Last Post: 12-28-2008, 12:29 AM
All times are GMT -5. The time now is 02:50 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search