Need help with Lua Script error menu

User Tag List

Results 1 to 1 of 1
  1. #1
    Rempage's Avatar Member
    Reputation
    1
    Join Date
    Nov 2016
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help with Lua Script error

    Good day all!

    I've found a lua script, which checks up for LoS and make delay before next cast, here it is:
    Code:
    if not tLOS then tLOS={} end 
    if not fLOS then fLOS=CreateFrame("Frame") end 
    delay = 1
    function LineOfSight(target) 
    fLOS:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") 
    function fLOSOnEvent(self,event,...) 
    if event=="COMBAT_LOG_EVENT_UNFILTERED" then 
    local cLOG={...} 
    if cLOG and cLOG[2] and cLOG[2]=="SPELL_CAST_FAILED" then 
    local player=UnitGUID("player") or "" 
        if cLOG[4] and cLOG[4]==player then 
            if cLOG[15] then 
                if cLOG[15]==SPELL_FAILED_LINE_OF_SIGHT 
                or cLOG[15]==SPELL_FAILED_NOT_INFRONT 
                or cLOG[15]==SPELL_FAILED_OUT_OF_RANGE 
                or cLOG[15]==SPELL_FAILED_UNIT_NOT_INFRONT 
                or cLOG[15]==SPELL_FAILED_UNIT_NOT_BEHIND 
                or cLOG[15]==SPELL_FAILED_NOT_BEHIND 
                or cLOG[15]==SPELL_FAILED_MOVING 
                or cLOG[15]==SPELL_FAILED_IMMUNE 
                or cLOG[15]==SPELL_FAILED_FLEEING 
                or cLOG[15]==SPELL_FAILED_BAD_TARGETS 
                or cLOG[15]==SPELL_FAILED_STUNNED 
                or cLOG[15]==SPELL_FAILED_SILENCED 
                or cLOG[15]==SPELL_FAILED_NOT_IN_CONTROL 
                then 
                tinsert(tLOS,{unit=target,time=GetTime()}) 
                end 
            end 
        end 
    else 
    if #tLOS > 0 then 
    table.sort(tLOS,function(x,y) return x.time>y.time end) 
    for i=1,#tLOS do 
    local time=tLOS[i].time or GetTime() 
    if GetTime()>time+delay then 
    tremove(tLOS,i) 
    end 
    end 
    end 
    end 
    end 
    end 
    fLOS:SetScript("OnEvent",fLOSOnEvent) 
    if #tLOS > 0 then 
    for i=1,#tLOS do 
    if tLOS and tLOS[i] and tLOS[i].unit==target 
    then 
    return true 
    end 
    end 
    end 
    end
    Sometimes it shows errors:
    Code:
    Message: Interface\AddOns\WowAddon4\Frame.lua:87: attempt to index field '?' (a nil value)
    Time: 11/13/16 03:10:23
    Count: 2
    Stack: Interface\AddOns\WowAddon4\Frame.lua:87: in function <Interface\AddOns\WowAddon4\Frame.lua:58>
    
    Locals: self = <unnamed> {
     0 = <userdata>
    }
    event = "COMBAT_LOG_EVENT_UNFILTERED"
    cLOG = <table> {
     1 = 1478995822.928
     2 = "SPELL_PERIODIC_HEAL"
     3 = false
     4 = "Pet-0-1-0-0-69947-00000061D5"
     5 = "Spirit Beast"
     6 = 4369
     7 = 0
     8 = "Player-1-0004DE7A"
     9 = "Старкэ-x100"
     10 = 1297
     11 = 0
     12 = 90361
     13 = "Духовное лечение"
     14 = 8
     15 = 11103
     16 = 0
     17 = 0
     18 = true
     19 = false
    }
    (for index) = 2
    (for limit) = 2
    (for step) = 1
    i = 2
    (*temporary) = nil
    (*temporary) = <function> defined =[C]:-1
    (*temporary) = <table> {
     1 = <table> {
     }
    }
    (*temporary) = 1
    (*temporary) = "attempt to index field '?' (a nil value)"
    87 line is local time=tLOS[i].time or GetTime()
    Can anybody help me what is wrong?

    Need help with Lua Script error

Similar Threads

  1. Need help with Lua script
    By Pieterkii in forum WoW EMU Questions & Requests
    Replies: 7
    Last Post: 03-04-2010, 07:07 AM
  2. Need some help with LUA script
    By SupernovaHH in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 07-22-2009, 07:25 AM
  3. 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
  4. [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
  5. [C++]Need help with my Scripted Item
    By freezer1012 in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 01-13-2008, 05:55 PM
All times are GMT -5. The time now is 06:13 AM. 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