PtokaX forum

Development Section => HOW-TO's => Topic started by: Guibs on 07 November, 2003, 01:58:44

Title: *Connection type: way to parse,....
Post by: Guibs on 07 November, 2003, 01:58:44
Hi all,,

Because i've spent a >lot of time< on it (lol),... i post the 'good' way to parse the info to get the correct connection type,...
-----
s,e,connection = strfind(data,"[$]+[^$]+[$]+[^$]+[$]+[^$]+[$]+([^$]+)")
-----
Because before,, i get some beautifull:
---
connection = "DSL"
---
loOol

Enjoy it,, :)

l8tr,, ;)
Title:
Post by: Guibs on 07 November, 2003, 05:28:39
Hmm,,,

Sometime,, with Dc clients,, it seems it wasn't 'perfect',...

That one seems to work better,,
---------
s,e,connection = strfind(data,"[$]+[^$]+[$]+[^$]+[$]+[^$]+[$]+([^$]+)")

if connection  ~= nil then
if strfind(connection,"") then
vstart = strfind(data,connection)
vlenght = strlen(connection)-1
realconnection = strsub(data,vstart,vlenght)
s,e,realconnection = strfind(connection,"(%S+)")
connection = realconnection
end
end

---------

l8tr,,