Need help with this LUA script, please. menu

User Tag List

Results 1 to 7 of 7
  1. #1
    Eliteplague's Avatar Master Sergeant
    Reputation
    46
    Join Date
    May 2006
    Posts
    101
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help with this LUA script, please.

    I want to add "Every Man for Himself" to this script, basically I wanted it to cast that whenever my character is stunned, feared, or hexed. What would be the correct LUA format?

    /run if UnitHealth("player")/UnitHealthMax("player")<0.10 and GetSpellCooldown("Divine Shield")==0 and IsUsableSpell("Divine Shield") then CastSpellByName("Divine Shield") end;
    /run if GetSpellCooldown("Divine Plea") ==0 and UnitPower("player")/UnitPowerMax("player")<=0.10 then CastSpellByName("Divine Plea") end;
    /run f=0; if UnitExists("focus") then for i=1,40 do d={UnitBuff("focus",i)}; if d~=nil and d[1]=="Beacon of Light" and d[8]=="player" and d[7]-GetTime()>=3 then f=1; break end end if f==0 then RunMacroText("/cast [@focus] Beacon of Light") end end;
    /run FoL=3000; HS=6000; HL=8000; t="raid"; nps=1; npe=GetNumRaidMembers(); if npe==0 then t="party"; nps=0; npe=GetNumPartyMembers() end; e=UnitExists; n=UnitName; h=UnitHealth; hm=UnitHealthMax; s=nil; f="focus"; fh=0; if e(f) then fh=hm(f)-h(f) end; m=0; w=f; for i=nps,npe do if i==0 then tt="player" else tt=t..i end; if e(tt) and (e(f)==nil or n(tt)~=n(f)) then a=hm(tt)-h(tt); if a>m and UnitInRange(tt)==1 and UnitIsDeadOrGhost(tt)~=1 then m=a w=tt end end end; if fh>2*m then m=fh end; if GetSpellCooldown("Holy Shock")==0 and m>=HS then s="Holy Shock" elseif m>=HL then s="Holy Light" elseif m>=FoL then s="Flash of Light" end; if s~=nil then RunMacroText("/cast [@"..w.."] "..s) end;
    /run if GetSpellCooldown("Judgement of Light") == 0 then RunMacroText("/cast [@focustarget] Judgement of Light") end;
    /run f=0; if UnitExists("focus") then for i=1,40 do d={UnitBuff("focus",i)}; if d~=nil and d[1]=="Sacred Shield" and d[8]=="player" and d[7]-GetTime()>=3 then f=1; break end end if f==0 then RunMacroText("/cast [@focus] Sacred Shield") end end;
    /run t="raid"; nps=1; npe=GetNumRaidMembers(); if npe==0 then t="party"; nps=0; npe=GetNumPartyMembers() end; w=nil; m=0; for i=nps,npe do if i==0 then tt="player" else tt=t..i end; if UnitExists(tt) and UnitInRange(tt)==1 and UnitIsDeadOrGhost(tt)~=1 then for j=1,40 do d={UnitDebuff(tt,j)}; if d~=nil and (d[5]=="Magic" or d[5]=="Poison" or d[5]=="Disease") and d[7]>m then w=tt; m=d[7] end end end end; if w~=nil then RunMacroText("/cast [@"..w.."] Cleanse") end;
    /run StaticPopup_Hide("MACRO_ACTION_FORBIDDEN");
    eppersdance: Once a hacker, always a hacker. eppersdance:

    Need help with this LUA script, please.
  2. #2
    Vandra's Avatar Contributor
    Reputation
    288
    Join Date
    Mar 2008
    Posts
    471
    Thanks G/R
    26/26
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could check stuns/cc by name/id then cast every man for himself:

    Code:
    if UnitDebuff("player", "buffName") then
         CastSpellByName("every man for himself")
    end
    untested but should be close

  3. #3
    Eliteplague's Avatar Master Sergeant
    Reputation
    46
    Join Date
    May 2006
    Posts
    101
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by vandra View Post
    You could check stuns/cc by name/id then cast every man for himself:

    Code:
    if UnitDebuff("player", "buffName") then
         CastSpellByName("every man for himself")
    end
    untested but should be close
    Didn't work. I tried
    /run if UnitDebuff("player","Polymorph" then
    CastSpellByName("Every Man for Himself") end
    I think there is more to it.
    Last edited by Eliteplague; 11-18-2011 at 02:34 AM.
    eppersdance: Once a hacker, always a hacker. eppersdance:

  4. #4
    Vandra's Avatar Contributor
    Reputation
    288
    Join Date
    Mar 2008
    Posts
    471
    Thanks G/R
    26/26
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried
    Code:
    if UnitDebuff("player","Weakened Soul") then
    print("debuff!")
    end
    Should work for any debuff, replace the print by your trinket, should be ok.

  5. #5
    Eliteplague's Avatar Master Sergeant
    Reputation
    46
    Join Date
    May 2006
    Posts
    101
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by vandra View Post
    I tried
    Code:
    if UnitDebuff("player","Weakened Soul") then
    print("debuff!")
    end
    Should work for any debuff, replace the print by your trinket, should be ok.
    /run if UnitDebuff("player","Polymorph"") then
    Every Man for Himself("debuff!")
    end
    Did not work, thanks for trying to help though.
    eppersdance: Once a hacker, always a hacker. eppersdance:

  6. #6
    Vandra's Avatar Contributor
    Reputation
    288
    Join Date
    Mar 2008
    Posts
    471
    Thanks G/R
    26/26
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Eliteplague View Post
    Did not work, thanks for trying to help though.
    Code:
    Every Man for Himself("debuff!")
    Hum, really? x)

    Code:
    if UnitDebuff("player","Polymorph") then
    CastSpellByName("Every Man for Himself") 
    end
    This IS working but you should use it in ONE line...
    And use /script not /run:

    Code:
    /script if UnitDebuff("player","Weakened Soul") then CastSpellByName("Every Man for Himself") end
    or

    Code:
    /script if UnitDebuff("player","Weakened Soul") then print("debuff!") end
    Use this one for testing.

  7. #7
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by vandra View Post
    Code:
    Every Man for Himself("debuff!")
    Hum, really? x)

    Code:
    if UnitDebuff("player","Polymorph") then
    CastSpellByName("Every Man for Himself") 
    end
    This IS working but you should use it in ONE line...
    And use /script not /run:

    Code:
    /script if UnitDebuff("player","Weakened Soul") then CastSpellByName("Every Man for Himself") end
    or

    Code:
    /script if UnitDebuff("player","Weakened Soul") then print("debuff!") end
    Use this one for testing.
    /script and /run are synonymous. Why not use the shorter 'run'?
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

Similar Threads

  1. [Mangos] need help with this web script
    By eric125 in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 07-20-2010, 10:56 PM
  2. [Lua Script] Need some help with my lua script
    By riizu in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 07-13-2010, 01:40 AM
  3. [Lua Script] Need help with this lua gossip script
    By diviee3 in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 06-21-2010, 07:52 PM
  4. Need help with an LUA script.
    By Ryoken in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 06-21-2009, 09:30 PM
  5. Help with this LUA script
    By jordash in forum World of Warcraft Emulator Servers
    Replies: 7
    Last Post: 03-08-2008, 04:19 PM
All times are GMT -5. The time now is 02:34 AM. 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