Thread Tools Display Modes
Prev Previous Post   Next Post Next
05-10-14, 10:00 PM   #1
TULOA
A Wyrmkin Dreamwalker
 
TULOA's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2009
Posts: 50
Problem Loading into game.

With my code changed to a repl.it tested URL Detection code the following function seems to be causing WoW to not get past the loading screen:

Code:
function URLFind(str)
    local _results = {}
    local _x = 0
    local isFound = false
    while _x <= #str do
        
        url = ""
        pos = 0
        url =  string.match(str, "https?://[%w-_%.%?%.:/%+=&]+", _x)
        pos = string.find(str, "https?://[%w-_%.%?%.:/%+=&]+", _x)
        --print(url)
        if url == nil then
            --Didnt find fully matched URL so lets try a shorter one.
            --url = string.match(str, "[^\.][^\s].*\.\.".."com".."[/]*\s?", _x)
            url = string.match(str, "[%w-_%.%?%.:/%+=&]+", _x)
            pos = string.find(str, "[%w-_%.%?%.:/%+=&]+", _x)
            
        end
        if url ~= nil then
            if url:sub(1,1) == " " then
                url = url:sub(2, #str)
                pos = pos + 1
            end
            tinsert(_results, {url, pos})
            --print(url.." | "..pos)
            _x = pos + #url
            --print("Adding. Next X: ".._x)
			isFound = true
        end
    end
    return isFound, _results
end
Anyone have an idea of why it would be doing that?
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Problem Loading into game.


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off