Need help with LUA Script in 2.4.3 menu

User Tag List

Results 1 to 3 of 3
  1. #1
    DragonfireEX402's Avatar Banned
    Reputation
    6
    Join Date
    Feb 2011
    Posts
    163
    Thanks G/R
    2/1
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help with LUA Script in 2.4.3

    Trying to use this script with 2.4.3 using EWT.

    if not UnitBuff("player", "Seal of Righteousness") then CastSpellByName("Seal of Righteousness") end

    Although this command works on 3.3.5, using it in 2.4.3 not only doesn't work, but also leads to this error.

    [string "if not UnitBuff("player", "Seal of Righteou..."]:1:Usage: UnitBuff("unit" , index [,raidFilter])

    Need help with LUA Script in 2.4.3
  2. #2
    CrazyCo's Avatar Member
    Reputation
    13
    Join Date
    Apr 2017
    Posts
    17
    Thanks G/R
    6/5
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It doesn't seem like UnitBuff accepts buff name as second arguement in TBC.

    You could use wrapper function:

    Code:
    function UnitBuffByName(unit, buffname)
    
    local aura;
    local i= 1
    repeat
    aura = UnitBuff(unit, i)
    	if aura == buffname then
    		return UnitBuff(unit, i)
    		-- return true -- would work as well, depends what you are trying to do
    	end 
    i = i +1
    until aura == nil
    end

  3. Thanks DragonfireEX402 (1 members gave Thanks to CrazyCo for this useful post)
  4. #3
    DragonfireEX402's Avatar Banned
    Reputation
    6
    Join Date
    Feb 2011
    Posts
    163
    Thanks G/R
    2/1
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by CrazyCo View Post
    It doesn't seem like UnitBuff accepts buff name as second arguement in TBC.

    You could use wrapper function:

    Code:
    function UnitBuffByName(unit, buffname)
    
    local aura;
    local i= 1
    repeat
    aura = UnitBuff(unit, i)
    	if aura == buffname then
    		return UnitBuff(unit, i)
    		-- return true -- would work as well, depends what you are trying to do
    	end 
    i = i +1
    until aura == nil
    end
    Adding that along with
    Code:
    if not UnitBuffByName("player", "Seal of Righteousness") then CastSpellByName("Seal of Righteousness") end
    did the trick.

Similar Threads

  1. [Question] Need help with Lua Script error
    By Rempage in forum WoW Bots Questions & Requests
    Replies: 0
    Last Post: 11-12-2016, 08:06 PM
  2. Need help with Lua script
    By Pieterkii in forum WoW EMU Questions & Requests
    Replies: 7
    Last Post: 03-04-2010, 07:07 AM
  3. Need some help with LUA script
    By SupernovaHH in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 07-22-2009, 07:25 AM
  4. Need help with my script [lua]
    By Satzen in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 05-18-2008, 05:19 PM
  5. [Request] I need some help with lua script (boss on death)
    By Ellenor in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 03-03-2008, 03:47 PM
All times are GMT -5. The time now is 02:18 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