[LUA/macro] Another "need help" thread, easy rep. menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Ssateneth's Avatar Contributor
    Reputation
    141
    Join Date
    May 2008
    Posts
    866
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [LUA/macro] Another "need help" thread, easy rep.

    Aight, heres one for some of you guys that work well with making macros/addons (but I prefer it to be posted in the form of a macro as I don't know how to turn addon code into a macro) What I need is wrote down below.

    If enemy HP < 20% and in Battle Stance then cast berserker Stance
    If enemy HP > 20% and (my own copy of rend on the target has <3 seconds left or I don't have rend on the target or Overpower is usable) and I'm in berserker stance then cast Battle Stance elseif none of the previous and I'm in battle stance and I have 50 or less rage then cast Berserker Stance.

    /run if UnitHealth("target")/UnitHealthMax("target")<0.2 and GetShapeshiftForm()==1 then CastSpellByName("Berserker Stance") end
    /run if UnitHealth("target")/UnitHealthMax("target")>0.2 then if ***(my own copy of rend on the target has <3 seconds left or I don't have rend on the target*** or IsUsableSpell("Overpower")) and GetShapeshiftForm()==3 then CastSpellByName("Battle Stance") elseif ***none of the previous*** and GetShapeshiftForm()==1 and UnitPower("player")<51 then CastSpellByName("Berserker Stance") end end

    -Why?-
    Basically, with the new tactical mastery and the new stance bonuses, it's worth it to switch stances to berserker stance for the extra 5% damage bonus when casting your regular arms warrior abilities, but Rend and Overpower requires you to be in battle stance, and those two abilities are a pretty big chunk of the arms warrior's damage. It's a gimmicky way of increasing damage output, but I'll take anything I can get.

    edit: used some proper syntax for the parts I have figured out, but put stars around and bolded the parts I couldn't.

    Will +rep for successful macro.
    Last edited by Ssateneth; 11-04-2010 at 10:04 PM.

    [LUA/macro] Another &quot;need help&quot; thread, easy rep.
  2. #2
    Ssateneth's Avatar Contributor
    Reputation
    141
    Join Date
    May 2008
    Posts
    866
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nobody at all?

  3. #3
    nightcracker's Avatar Contributor
    Reputation
    102
    Join Date
    Jan 2008
    Posts
    96
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I will try, but I don't really get what you want yet.

    Please describe more carefully what the macro should do, in a step diagram:

    step 1. check if duration rend < 3, if true cast rend
    step 2. etc
    Three things are certain,
    Death, taxes and site not found,
    You, victim of one.

  4. #4
    Ssateneth's Avatar Contributor
    Reputation
    141
    Join Date
    May 2008
    Posts
    866
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by nightcracker View Post
    I will try, but I don't really get what you want yet.

    Please describe more carefully what the macro should do, in a step diagram:

    step 1. check if duration rend < 3, if true cast rend
    step 2. etc
    Will try my best.
    1. If enemy health is below 20%, go into berserker stance if not already in that stance and remain in berserker stance for the duration that the enemy is below 20% (I got this part already covered I believe)
    2. If I am in Berserker Stance and enemy health is above 20% and...
    >>a. if I don't have my own copy of the debuff "Rend" on the current target --OR--
    >>b. if my own copy of the debuff "Rend" Has less than 3 seconds left in it's duration on the current target --OR--
    >>c. My ability "Overpower" is a usable spell (It light's up from either an enemy dodge or the taste for blood buff on the player, but the cause is irrelevant)
    ... then cast Battle Stance.
    3. If I am in Battle Stance and enemy health is above 20% and I have more than 50 rage AND...
    >>a. I have my own copy of the debuff "Rend" on the current target --AND--
    >>b. my own copy of the debuff "Rend" has more than 3 seconds left in it's duration on the current target --AND--
    >>c. My ability "Overpower" is NOT a usable spell
    ... then cast Berserker Stance


    I hope I made that clear enough.

  5. #5
    Ultraviolence's Avatar Active Member
    Reputation
    15
    Join Date
    Aug 2008
    Posts
    102
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wouldn't this work? Seems pretty simple to me. I don't know if there's a way to tell if it's your Rend on the target, though.

    /run if UnitHealth("target")/UnitHealthMax("target")<0.2 and GetShapeshiftForm()==1 then CastSpellByName("Berserker Stance") elseif UnitHealth("target")/UnitHealthMax("target")>0.2 and UnitDebuff("target", "Rend")<3 or not UnitDebuff("target", "Rend") or IsUsableSpell("Overpower")==1 and GetShapeshiftForm()==3 then CastSpellByName("Battle Stance") elseif GetShapeshiftForm()==1 and UnitHealth("target")/UnitHealthMax("target")>0.2 and UnitPower("player")>50 and UnitDebuff("target", "Rend")>3 and IsUsableSpell("Overpower")==0 then CastSpellByName("Berserker Stance") end

  6. #6
    CrazyCactuaR's Avatar Contributor
    Reputation
    84
    Join Date
    Sep 2008
    Posts
    201
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry for the retard question but how the hell do you run lua commands since LuaNinja got canned? So out of date.

  7. #7
    Ultraviolence's Avatar Active Member
    Reputation
    15
    Join Date
    Aug 2008
    Posts
    102
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I guess you'll have to develop your own method until someone decides to release something to the public.
    Last edited by Ultraviolence; 11-12-2010 at 01:04 PM.

  8. #8
    Ssateneth's Avatar Contributor
    Reputation
    141
    Join Date
    May 2008
    Posts
    866
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No ultraviolence. That wouldn't work. It doesn't have the all-important rend-checking code in there. UnitDebuff - World of Warcraft Programming: A Guide and Reference for Creating WoW Addons

    Thanks for trying anyways. Any other takers?

  9. #9
    Ultraviolence's Avatar Active Member
    Reputation
    15
    Join Date
    Aug 2008
    Posts
    102
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Then maybe UnitDebuff("target", "Rend", "player")? That should let it recognize your own Rend.

  10. #10
    Ssateneth's Avatar Contributor
    Reputation
    141
    Join Date
    May 2008
    Posts
    866
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Ultraviolence View Post
    Then maybe UnitDebuff("target", "Rend", "player")? That should let it recognize your own Rend.
    Just checked the available filters and syntax. Might work, but I can't test it right now. will try later. If it does work out, it'll eliminate the need to do a while loop and check all the debuffs on an enemy if you have your own copy of a certain debuff.

  11. #11
    nightcracker's Avatar Contributor
    Reputation
    102
    Join Date
    Jan 2008
    Posts
    96
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Took me some time, but here it comes:

    Code:
    if UnitHealth"target"/UnitMaxHealth"target" < .2 then
    	if not GetShapeshiftForm()==3 then
    		CastSpellByName"Berserker Stance"
    	end
    elseif GetShapeshiftForm()==3 and ((not UnitDebuff("target", "Rend", "", "PLAYER") or (select(6, UnitDebuff("target", "Rend", "", "PLAYER")) < 3) or IsUsableSpell"Overpower") then
    	CastSpellByName"Battle Stance"
    elseif GetShapeshiftForm()==1 and UnitPower("player") > 50 and (UnitDebuff("target", "Rend", "", "PLAYER") and select(6, UnitDebuff("target", "Rend", "", "PLAYER")) > 3 and not IsUsableSpell"Overpower") then
    	CastSpellByName"Berserker Stance"
    end
    Three things are certain,
    Death, taxes and site not found,
    You, victim of one.

  12. #12
    Ssateneth's Avatar Contributor
    Reputation
    141
    Join Date
    May 2008
    Posts
    866
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, I'll test it once NoAddiction is updated for 4.0.3. It would appear that the extra argument for UnitDebuff will prove powerful as far as making my head hurt less and making some of my macros shorter. Can convert all those nasty while checks into something like..
    Code:
     ..and not d(t,"Rend","",p) then c("Rend") elseif..
    Implying that I'll store the commonly used terms like UnitDebuff, "target", "player", and CastSpellByName into variables like d, t, p, and c respectively.

    Will rep you once I can test it. Just a question though. Do you have to set the 3rd argument even though spells don't have ranks now?

    edit: I went about testing the extra arguments. Doing..
    Code:
    /run if UnitDebuff("target", "Rend", "", "PLAYER") then print("a") end
    should print a in the main chat window, but nothing comes up. Makes me think the arguments are a bit different. Checking the debuff via index like this works, but then it doesn't check if it's rend :P
    Code:
    /run if UnitDebuff("target", 1, "PLAYER") then print("a") end

    EDIT2: Did a little bit of poking around. UnitDebuff's second output is the "rank" of the spell, so I did a /dump on UnitDebuff("target","Rend"). There is still a "rank" but not like I thought. It outputs this string: "Battle, Defensive Stance". So I put that in as the third argument of the UnitDebuff and ran the following. It indeed printed "a" when I had Rend up on the target.
    Code:
    /run if UnitDebuff("target", "Rend", "Battle, Defensive Stance", "player") then print("a") end
    Soooooo.. fixing the above macro for when NA gets updated, we get..
    Code:
    if UnitHealth"target"/UnitMaxHealth"target" < .2 then
    	if not GetShapeshiftForm()==3 then
    		CastSpellByName"Berserker Stance"
    	end
    elseif GetShapeshiftForm()==3 and ((not UnitDebuff("target", "Rend", "Battle, Defensive Stance", "PLAYER") or (select(6, UnitDebuff("target", "Rend", "Battle, Defensive Stance", "PLAYER")) < 3) or IsUsableSpell"Overpower") then
    	CastSpellByName"Battle Stance"
    elseif GetShapeshiftForm()==1 and UnitPower("player") > 50 and (UnitDebuff("target", "Rend", "Battle, Defensive Stance", "PLAYER") and select(6, UnitDebuff("target", "Rend", "Battle, Defensive Stance", "PLAYER")) > 3 and not IsUsableSpell"Overpower") then
    	CastSpellByName"Berserker Stance"
    end
    Last edited by Ssateneth; 11-16-2010 at 11:19 PM.

  13. #13
    Ssateneth's Avatar Contributor
    Reputation
    141
    Join Date
    May 2008
    Posts
    866
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I finally got what I needed. Says I must spread my rep around before I give it to you again night :/ i'll try to give you rep again soon.
    Code:
    #STANCEDANCE
    /run if UnitHealth("target")/UnitHealthMax("target")<0.2 and GetShapeshiftForm()==1 then CastSpellByName("Berserker Stance") end
    /run t="target" p="player" rc="Battle, Defensive Stance" r="Rend" b=UnitBuff d=UnitDebuff gs=GetShapeshiftForm() c=CastSpellByName if UnitHealth(t)/UnitHealthMax(t)>0.2 then if gs==3 and ((not d(t,r,rc,p) or select(7,d(t,r,rc,p))-GetTime()<2.9 or (b(p,"Taste for Blood") and GetSpellCooldown("Mortal Strike")~=0))) then c("Battle Stance") elseif gs==1 and UnitPower(p)<50 and d(t,r,rc,p) and select(7,d(t,r,rc,p))-GetTime()>2.9 and not IsUsableSpell("Overpower") then c("Berserker Stance") end end
    There were some errors in your code (UnitMaxHealth instead of UnitHealthMax, missed a ) before a then somewhere, and probably one other thing) but I managed to figure out what happened. Also an error on my part, meant the rage check to be <51 rage, not >50 rage

  14. #14
    qbasasa's Avatar Private
    Reputation
    1
    Join Date
    Apr 2010
    Posts
    5
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi guys I need something to enprotect my lua codes, without it my super duper macros doesnt work.

  15. #15
    nightcracker's Avatar Contributor
    Reputation
    102
    Join Date
    Jan 2008
    Posts
    96
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by qbasasa View Post
    Hi guys I need something to enprotect my lua codes, without it my super duper macros doesnt work.
    Make a new thread.
    Three things are certain,
    Death, taxes and site not found,
    You, victim of one.

Page 1 of 2 12 LastLast

Similar Threads

  1. Lua Scirpt: something wrong need help
    By Jonthe838 in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 01-18-2009, 06:13 PM
  2. Another noob needing help with TLS...
    By KOS0937 in forum WoW Memory Editing
    Replies: 7
    Last Post: 05-24-2008, 01:12 AM
  3. Simple Lua Script , not working need help!
    By Arugos in forum World of Warcraft Emulator Servers
    Replies: 16
    Last Post: 12-30-2007, 02:06 PM
  4. NEED help with server plus rep
    By Denelly in forum World of Warcraft Emulator Servers
    Replies: 7
    Last Post: 10-30-2007, 09:12 PM
All times are GMT -5. The time now is 04:55 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search