mIRC Home    About    Download    Register    News    Help

Print Thread
#201765 04/07/08 02:22 AM
Joined: May 2008
Posts: 329
A
AWEstun Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: May 2008
Posts: 329
I'm trying to revent control code and the box (contrl-k) symbol in the string. This sort of works, but not always:

var %userbio = $strip($replacex($gettok($6-,-1,35),,),-burcmo)


I registered; you should too.
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
$strip(%text) will remove ctrl+ b u r k o (asc: 2, 31, 22, 3, 15)

$strip(%text,b) will remove ctrl+b
$strip(%text,u) will remove ctrl+u

etc.

-genius_at_work

Joined: May 2008
Posts: 329
A
AWEstun Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: May 2008
Posts: 329
This works:

var %userbio = $strip($gettok($6-,-1,35))

but how do I strip out the  (multiple) that are left.


I registered; you should too.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Try
Code:
var %userbio = $gettok($6-,-1,35)
%userbio = $strip(%userbio)

In theory, what you have shouldn't have any of those control blocks in it, as the start and end control blocks for each part that is being stripped should be removed.

Joined: May 2008
Posts: 329
A
AWEstun Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: May 2008
Posts: 329
That doesnt work either. Also tried:

$remove(%userbio,)

but that didnt work either.


I registered; you should too.
Joined: Aug 2003
Posts: 144
M
Vogon poet
Offline
Vogon poet
M
Joined: Aug 2003
Posts: 144
Hi.

You need to ue the $chr(nr) off the character.
To know the nr off the $chr identifier you need to use $asc(character) them it will return a number... that number is to be used in $chr. Example:.

Code:
//echo -s $asc(§)
167
//echo -s $chr(167)
§


them $remove( text, $chr(nr))

good luck

Joined: May 2008
Posts: 329
A
AWEstun Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: May 2008
Posts: 329
Originally Posted By: Miguel_A
Hi.

You need to ue the $chr(nr) off the character.
To know the nr off the $chr identifier you need to use $asc(character) them it will return a number... that number is to be used in $chr. Example:.

Code:
//echo -s $asc(§)
167
//echo -s $chr(167)
§


them $remove( text, $chr(nr))

good luck


I tried:

var %userbio = $strip($gettok($6-,-1,35))
var %userbio = $remove(%userbio,$chr(11))

but it's not removing the ctrl-k symbol.


I registered; you should too.
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
$chr(11) is not the color control code.

ctrl+__

b= 2
u= 31
r= 22
k= 3
o= 15

Maybe the mutilated server you are on is using different control code characters.

-genius_at_work

Joined: May 2008
Posts: 329
A
AWEstun Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: May 2008
Posts: 329
Originally Posted By: genius_at_work
$chr(11) is not the color control code.

ctrl+__

b= 2
u= 31
r= 22
k= 3
o= 15

Maybe the mutilated server you are on is using different control code characters.

-genius_at_work


It doesn't matter how F'd up the server is, as I'm extracting the infoline and trying to strip codes from with with mIRC.

11 is ctrl-k

source: http://www.nthelp.com/ascii.htm


I registered; you should too.
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
As he tried to tell you, $chr(11) is NOT the color code!

Try doing:

//echo -s $asc(x)

where you us the ctrl-K in place of the X, and you'll see that it returns 3 and not 11. The color code before the color number is $chr(3) Ctrl-C not the Ctrl-K you entered. You'll find that Ctrl-U puts in a $chr(31) not the $chr(21) you'd expect, etc.

Joined: May 2008
Posts: 329
A
AWEstun Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: May 2008
Posts: 329
Originally Posted By: maroon
As he tried to tell you, $chr(11) is NOT the color code!

Try doing:

//echo -s $asc(x)

where you us the ctrl-K in place of the X, and you'll see that it returns 3 and not 11. The color code before the color number is $chr(3) Ctrl-C not the Ctrl-K you entered. You'll find that Ctrl-U puts in a $chr(31) not the $chr(21) you'd expect, etc.


Well, THANK GOD you jumped in and clearified his post! We need more people like you! Have you considered cloning and/or DNA storage?


I registered; you should too.

Link Copied to Clipboard