mIRC Home    About    Download    Register    News    Help

Print Thread
#227192 31/10/10 03:08 AM
Joined: Sep 2003
Posts: 16
U
Pikka bird
OP Offline
Pikka bird
U
Joined: Sep 2003
Posts: 16
Its possible make a filter and get this on sockread...

1: Hirens BootCD v9.8<br />Uploader<br />1230983498<br /><br /><a href='http://www.site.org/viewtopic.php?f=1&t=1'></a><br /><br />

and the result ...
$1 = Hirens BootCD v9.8
$2 = Uploader
$3 = 1230983498
$4 = http://www.site.com/viewtopic.php?f=1&t=1


Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
There are probably other ways of doing this, but one option is to use something like
Code:
tokenize 44 $replace(%sock.read.text,<br />,$chr(44))
where %sock.read.text is the text/data read from the socket.

What I'm doing here, is replacing a multiple character string with a single character, then using the tokenize command with the ascii value of the character that I used for the replacement.

In this case, I used 44, which is the comma character.

Joined: Sep 2003
Posts: 16
U
Pikka bird
OP Offline
Pikka bird
U
Joined: Sep 2003
Posts: 16
Originally Posted By: RusselB
There are probably other ways of doing this, but one option is to use something like
Code:
tokenize 44 $replace(%sock.read.text,
,$chr(44))
where %sock.read.text is the text/data read from the socket.

What I'm doing here, is replacing a multiple character string with a single character, then using the tokenize command with the ascii value of the character that I used for the replacement.

In this case, I used 44, which is the comma character.


thanks u so much. works fine laugh

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Looks like RusselB's example won't completely filter out the tags and you may end up with:
Quote:
1: Hirens BootCD v9.8
Uploader
1230983498
<a href='http://www.site.org/viewtopic.php?f=1&t=1'></a>
Do it with regex then:
Code:
tokenize 44 $regsubex(%sock.read.text,/\d+\:|<.. */?>|<. .{4}\='|'>/g,$chr(44))
This gives you:
Quote:
Hirens BootCD v9.8
Uploader
1230983498
http://www.site.org/viewtopic.php?f=1&t=1


Link Copied to Clipboard