Originally posted by mrdude
View Post

MeCount = 0; while( find1 ~= nil) do find1 = string.match(mystring, regex, nextposition); if find1 == nil then break else MeCount = MeCount +1; Dialog.Message("IP Found No:"..MeCount, "I found: "..find1, MB_OK, MB_ICONNONE, MB_DEFBUTTON1); result = Table.Count(target_table); if result >= 10 then Dialog.Message("Notice", "This page contains duplicate IP addresses\r\n" .. "Breaking out of a loop now\r\n" .. "Please check manually", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); break else strip() end end end
while( find1 ~= nil) do find1 = string.match(mystring, regex, nextposition) if find1 == nil then break else result = Table.Count(target_table); if result >= 10 then Dialog.Message("Notice", "This page contains duplicate IP addresses\r\n" .. "Breaking out of a loop now\r\n" .. "Please check manually", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); break else strip() end end end
MeCount = 0; while( find1 ~= nil) do find1 = string.match(mystring, regex, nextposition); if find1 == nil then break else MeCount = MeCount +1; Dialog.Message("IP Found No:"..MeCount, "I found: "..find1, MB_OK, MB_ICONNONE, MB_DEFBUTTON1); result = Table.Count(target_table); if result >= 10 then Dialog.Message("Notice", "This page contains duplicate IP addresses\r\n" .. "Breaking out of a loop now\r\n" .. "Please check manually", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); break else strip() end end end
while( find1 ~= nil) do find1 = string.match(mystring, regex, nextposition) if find1 == nil then break else result = Table.Count(target_table); if result >= 10 then Dialog.Message("Notice", "This page contains duplicate IP addresses\r\n" .. "Breaking out of a loop now\r\n" .. "Please check manually", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); break else strip() end end end
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 ---put check for dupe here: Dialog.Message("Notice", nextposition, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); --end of check: 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
while( find1 ~= nil) do find1 = string.match(mystring, regex, nextposition) if find1 == nil then break else strip() break end 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
while( find1 ~= nil) do find1 = string.match(mystring, regex, nextposition) if find1 == nil then break else strip() end 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
--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);
Leave a comment: