• 0

    posted a message on Help with wildcards in Windows batch files
    Quote from Phanx
    There is no longer any reason to delete the creature cache, as it is no longer possible (since patch 6.0.2) for addons to detect rare spawns (or anything else) by scanning the cache.


    Sure ok, but still, this might be usefull for something else later.

    So, yeah, is it possible to replace \enUS\ by some kind of wildcard ?
    Posted in: General Chat
  • 0

    posted a message on Help with wildcards in Windows batch files
    Sorry for digging this post up but i have a question similar to this.

    Here's what i use

    @echo off
    echo.
    
    REM Variable block below.  Change to match your settings if you get an error.
    
    set wowdir="D:\World of Warcraft\
    set wow_process64="Wow-64.exe"
    set wow_process32="Wow.exe"
    
    set launcher_file=%wowdir%World of Warcraft Launcher.exe"
    
    set creature_file=%wowdir%Cache\WDB\enUS\creaturecache.wdb"
    set error_files=%wowdir%Errors\*"
    set archive_files=%wowdir%Logs\archive\*"
    
    set wow_mfil=%wowdir%WoW.mfil"
    set wow_pfil=%wowdir%WoW.pfil"
    set wow_tfil=%wowdir%WoW.tfil"
    
    
    REM End variable block.  You should not need to change anything below this line.
    
    tasklist /FI "IMAGENAME eq %wow_process64%" 2>NUL | find /I /N %wow_process64%>NUL
    if "%ERRORLEVEL%"=="0" goto processrunning64
    goto Check32
    
    :Check32
    tasklist /FI "IMAGENAME eq %wow_process32%" 2>NUL | find /I /N %wow_process32%>NUL
    if "%ERRORLEVEL%"=="0" goto processrunning32
    goto misc
    
    :processrunning64
    echo Skipping files cleanup, %wow_process64% is already running.
    goto wowstart
    
    :processrunning32
    echo Skipping files cleanup, %wow_process32% is already running. 
    goto wowstart
    
    :misc
    if exist %error_files% del /q %error_files%
    if exist %archive_files% del /q %archive_files%
    goto creaturecheck
    
    :creaturecheck
    if exist %creature_file% goto clearcreature
    goto notfoundcreature
    
    :notfoundcreature
    echo Skipped %creature_file%
    echo.
    goto mfilcheck
    
    :clearcreature
    del /q %creature_file%
    echo Deleted %creature_file%
    echo.
    goto mfilcheck
    
    :mfilcheck
    if exist %wow_mfil% goto clearmfil
    goto notfoundmfil
    
    :notfoundmfil
    echo Skipped %wow_mfil%
    echo.
    goto pfilcheck
    
    :clearmfil
    del /q %wow_mfil%
    echo Deleted %wow_mfil%
    echo.
    goto pfilcheck
    
    :pfilcheck
    if exist %wow_pfil% goto clearpfil
    goto notfoundpfil
    
    :notfoundpfil
    echo Skipped %wow_pfil%
    echo.
    goto tfilcheck
    
    :clearpfil
    del /q %wow_pfil%
    echo Deleted %wow_pfil%
    echo.
    goto tfilcheck
    
    :tfilcheck
    if exist %wow_tfil% goto cleartfil
    goto notfoundtfil
    
    :notfoundtfil
    echo Skipped %wow_tfil%
    goto startwow
    
    :cleartfil
    del /q %wow_tfil%
    echo Deleted %wow_tfil%
    goto startwow
    
    :startwow
    if exist %launcher_file% goto wowstart
    echo.
    echo --------------------
    echo Launcher NOT found at %launcher_file%. Check your path. 
    echo --------------------
    pause
    goto end
    
    :wowstart
    echo.
    echo --------------------
    echo Starting Launcher
    echo --------------------
    echo.
    echo Enjoy!
    echo.
    %launcher_file%
    @echo off
    echo This window will remain open for 5 seconds.
    PING -n 6 127.0.0.1>nul 
    :end
    exit


    Now, what do i have to do so that it deletes creaturecache in every language because i have enUS but also frFR
    Posted in: General Chat
  • 0

    posted a message on String gsub help
    Quote from jerry
    adding a limit will probably fix your issue.
    s = s:gsub("%[([^]]*)%]", "%1", 1)



    Just noticed an issue, when someone link at least 2 items in the same line, his name is correctly formatted, but the first item gets formatted aswell, the [] are removed from the first item, the second items is fine, with []
    Posted in: Lua Code Discussion
  • 0

    posted a message on String gsub help
    Quote from Arrowmaster
    s = s:gsub("|Hplayer:(.-)|h%[(.-)%]|h", "|Hplayer:%1|h%2|h")


    That one doesn't work Arrow :|
    Posted in: Lua Code Discussion
  • 0

    posted a message on String gsub help
    Yes ! apparently it did :)
    Posted in: Lua Code Discussion
  • 0

    posted a message on String gsub help
    Or hmm actually what you suggest remove everything between any [] even if i type [test] in chat it won't appear. Any way to only remove the [] from players name ?
    Posted in: Lua Code Discussion
  • 0

    posted a message on String gsub help
    Thanks ! omg finally, had almost no hair left to pull :)
    Posted in: Lua Code Discussion
  • 0

    posted a message on String gsub help
    Allright, i've been trying for about 3 hours before asking here, and http://lua-users.org/wiki/StringLibraryTutorial didn't help me much so

    I'm using gsub like this to reformat my chat gsub('%[Guild%]', '(g)') and it works just fine, but there's one thing i really can't manage to do.

    In my chat, every names are formatted like this [Name], i'm trying to remove the [] no matter what chat they're tying in

    for example, someone typing in raid looks like (rl) [misterx]: test, and i want to have it like this (rl) misterx: test. Same goes for whispers, guild etc etc, anyone good with this ?
    Posted in: Lua Code Discussion
  • 0

    posted a message on kgPanels Offical Thread
    Quote from Seerah
    Anyone who has scripts set up for their frames gets that. If you are no longer using a layout that uses scripts, then you can delete the old layout(s) you still have saved.


    Ok well it's only a print line anyway, so i've simply removed it. Thanks.
    Posted in: General AddOns
  • 0

    posted a message on Quick question
    Well, apparently it's only going wrong on a newly created character, if i don't put that line in, the combat log stays docked to the ChatFrame1, if i put it in, it's being moved where i want it but gives that error.

    I've tried :SetUserPlaced(true) instead but that didn't do anything :|

    Edit: oh and it only does it "once". if i move the frame manually then reload ui, it's correctly placed and gives no error anymore on that character. So basically not a big deal, just weird. (for me)
    Posted in: Lua Code Discussion
  • 0

    posted a message on Quick question
    Thanks that helped, for the second point, it was KgPanels, that's weird.

    Anyway, there's something weird i've noticed aswell. it's the ChatFrame2 (the combat log)

    if i don't put the following line, it doesn't care of my positionning.

    ChatFrame2.SetPoint = function() end


    but if i put it in, it's being positionned correctly but gives this error

    ...ace\AddOns\Blizzard_CombatLog\Blizzard_CombatLog.lua:3445: attempt to perform arithmetic on local 'xOfs' (a nil value)
    [C]: ?
    ...ace\AddOns\Blizzard_CombatLog\Blizzard_CombatLog.lua:3445: in function <...ace\AddOns\Blizzard_CombatLog\Blizzard_CombatLog.lua:3424>
    ...ace\AddOns\Blizzard_CombatLog\Blizzard_CombatLog.lua:3491: in function `FCF_DockUpdate'
    Interface\FrameXML\UIParent.lua:1795: in function `UIParentManageFramePositions'
    Interface\FrameXML\UIParent.lua:1208: in function <Interface\FrameXML\UIParent.lua:1195>
    [C]: in function `SetAttribute'
    Interface\FrameXML\UIParent.lua:1802: in function `UIParent_ManageFramePositions'
    Interface\FrameXML\UIOptionsPanels.lua:868: in function `InterfaceOptions_UpdateMultiActionBars'
    [string "*:OnLoad"]:4: in function `setFunc'
    Interface\FrameXML\UIOptionsPanels.lua:837: in function <Interface\FrameXML\UIOptionsPanels.lua:830>


    Any ideas ?
    Posted in: Lua Code Discussion
  • 0

    posted a message on kgPanels Offical Thread
    Didn't find anything about this nor anyone reporting it so i'm afraid it's only me, anyway, whenever i login into the game or reload ui, i'm getting this in my chatframe

    Setting up scripts for LOAD
    Setting up scripts for EVENT
    Setting up scripts for LOAD
    Setting up scripts for SHOW
    Setting up scripts for EVENT
    Setting up scripts for UPDATE
    Setting up scripts for LOAD
    Setting up scripts for LOAD
    Setting up scripts for LOAD
    Setting up scripts for UPDATE
    Setting up scripts for LOAD
    Setting up scripts for LOAD
    Setting up scripts for LOAD
    Setting up scripts for LOAD


    Is there anything i can do to stop this from displaying every time ?
    Posted in: General AddOns
  • 0

    posted a message on Quick question
    I'm setting up some default for my chat frames, like this for example

    cTweaks:RegisterEvent('PLAYER_LOGIN')
    function cTweaks:PLAYER_LOGIN()
     ChatFrame1:ClearAllPoints()
     ChatFrame1:SetPoint('TOPLEFT', UIParent, 'CENTER', 245, -312)
     ChatFrame1:SetHeight(116.5)
     ChatFrame1:SetWidth(312)
     ChatFrame1.SetPoint = function() end
     
     ChatFrame2:ClearAllPoints()
     ChatFrame2:SetPoint('TOPRIGHT', UIParent, 'CENTER', -245, -336.5)
     ChatFrame2:SetHeight(92)
     ChatFrame2:SetWidth(312)
     ChatFrame2:SetJustifyH'RIGHT'
     ChatFrame2.SetPoint = function() end
     
     for i = 1, 4 do
      SetChatWindowAlpha(i, 0)
      SetChatWindowLocked(i, 1)
      SetChatWindowSize(i, 9)
     end
     
     for i = 3, 4 do
      SetChatWindowDocked(i, 1)
     end
    end


    As i have 4 chatframes it works just fine, but when i log in on a new character for example it forces it to create chatframe3 and 4, how could i do it so it affect 3 and 4 only if they exists ?

    Second question, i've had this for a while in my chat when i login, does anyone have a clue where it comes from ?

    Setting up scripts for LOAD
    Setting up scripts for EVENT
    Setting up scripts for LOAD
    Setting up scripts for SHOW
    Setting up scripts for EVENT
    Setting up scripts for UPDATE
    Posted in: Lua Code Discussion
  • 0

    posted a message on Need help with a function
    Anyway, thanks all, everything works now :)
    Posted in: Lua Code Discussion
  • 0

    posted a message on Need help with a function
    Well, i don't understand, everything works now thanks for that, just not the loot function
    No matter if i write it with a . or a : it doesn't autoroll greed like it's supposed to, it doesn't do anymore errors though.
    local cTweaks = CreateFrame('Frame', nil, UIParent)
    cTweaks:SetScript('OnEvent', function(self, event, ...) self[event](self, ...) end)
    cTweaks:RegisterEvent('START_LOOT_ROLL')
    function cTweaks:START_LOOT_ROLL(_, _, id) (OR WITH .)
     if id
      and (select(4, GetLootRollItemInfo(id)) == 2)
      and not (select(5, GetLootRollItemInfo(id))) then
       RollOnLoot(id, 2)
     end
    end



    The only way i've found to have it work is to put it in a separate file with this format
    local cTweaks = CreateFrame('Frame', nil, UIParent)
    cTweaks:RegisterEvent('START_LOOT_ROLL')
    cTweaks:SetScript('OnEvent', function(_, _, id)
     if id
      and (select(4, GetLootRollItemInfo(id)) == 2)
      and not (select(5, GetLootRollItemInfo(id))) then
       RollOnLoot(id, 2)
     end


    Do you know why it doesn't work when i put it in the main file and how to fix it ?
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.