I have three files with the following values:
file 1 contains:
<span>192.168.100.1</span><br>
<span>192.168.100.2</span><br>
file 2 contains:
<span>192.168.100.1</span><br>
<span>192.168.100.1</span><br>
file 3 is just empty:
then some unimportant code under that...
If file1 gets checked - I don't get any errors
If file3 gets checked - I don't get any errors
If file 2 gets checked - the app freezes with no errors, I know it's because both IP addresses found are the same but I don't know why it's freezing the app, does anyone have any idea? I have been at this for about 6 hours now and am no further forward that when I was when I begun.
Cheers.
file 1 contains:
<span>192.168.100.1</span><br>
<span>192.168.100.2</span><br>
file 2 contains:
<span>192.168.100.1</span><br>
<span>192.168.100.1</span><br>
file 3 is just empty:
Code:
--try reading last Folder from Registry LastFolder = Application.LoadValue("MultiThief", "LastFolder"); checkforfolder = Folder.DoesExist(LastFolder); if checkforfolder == true then --do nothing elseif checkforfolder == false then LastFolder = _DesktopFolder; end; target_table = {}; --Creates a table whose values are empty sections2 = {}; --Creates a table whose values are empty webpage = Dialog.FileBrowse(true, "Locate File", LastFolder, "All Files (*.*)|*.*|", "", ".*", false, false); if (webpage[1] == "CANCEL") then Application.ExitScript(); --removehtml() elseif (webpage[1] ~= "CANCEL") then mystring = TextFile.ReadToString(webpage[1]); --removehtml() end startposition = "0" regex = "<span>" .. '[0-9+\.]+' .. "</span>" find1 = string.match(mystring, regex,startposition) --find the ip address in a string function strip() strip0 = String.Replace(find1, "<span>", "", false); -- remove <span> from the start of string strip1 = String.Replace(strip0, "</span>", "", false); -- remove </span> from the string so we are left with the IP result1 = String.Find(mystring, find1, 1, false); --get the start position of the IP nextposition = result1+1 --store the found address then add 1 so we can find the next ip address from this position Table.Insert(target_table, Table.Count(target_table)+1, strip1); -- count the previous entries in our table then add our new string to the last entry. end if find1 == nil then Dialog.Message("Notice", "No IP addresses found", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); --prevent error message if no IP addresses were found Application.ExitScript(); --no point carrying on if no IP addresses are found. elseif find1 ~= nil then strip() end while( find1 ~= nil) --do a loop to check for more IP's do find1 = string.match(mystring, regex, nextposition) --find the ip address in a string if find1 == nil then break -- exit out of loop elseif find1 ~= nil then strip() end end -------------------------------------- --error above here -------------------------------------- filename = "AutoPlay\\Docs\\Config\\reaper.ini" sections2 = INIFile.GetSectionNames(filename); filestart = "/files/" table_values = Table.Concat(target_table, "\r\n", 1, TABLE_ALL); choice = Dialog.Message("IP's Found - would you like to download", table_values, MB_YESNO, MB_ICONINFORMATION, MB_DEFBUTTON1);
If file1 gets checked - I don't get any errors
If file3 gets checked - I don't get any errors
If file 2 gets checked - the app freezes with no errors, I know it's because both IP addresses found are the same but I don't know why it's freezing the app, does anyone have any idea? I have been at this for about 6 hours now and am no further forward that when I was when I begun.
Cheers.
Comment