Addition to /tokenize - 06/06/03 01:14 AM
/tokenize [prefix] <c> <text>
Let me explain that a bit with some examples then the reasoning why:
/tokenize N 32 1 2 3 4 5
$N1 = 1
$N2 = 2
$N3 = 3
$N4 = 4
$N5 = 5
The idea is, consider this
ON *:TEXT:*:*:{
tokenize 45 $1
echo -a $nick typed $1 $+ . $+ $2
}
Once that tokenize is performed, everything else sent as text ($2-) just disappeared. To continue using original params you'd have to do something like:
ON *:TEXT:*:*:{
var %text = $1-
tokenize 45 $1
echo -a $nick typed $1 $+ . $+ $2
tokenize 32 %text
echo -a The third word of that line was $3
}
With my idea:
ON *:TEXT:*:*:{
tokenize N 45 $1
echo -a $nick typed $N1 $+ . $+ $N2
echo -a The third word of that line was $3
}
Basically it just prevents it from overwriting what is currently in $1..N and also allows you to easily use many tokenize calls in the same event/alias/etc.
Let me explain that a bit with some examples then the reasoning why:
/tokenize N 32 1 2 3 4 5
$N1 = 1
$N2 = 2
$N3 = 3
$N4 = 4
$N5 = 5
The idea is, consider this
ON *:TEXT:*:*:{
tokenize 45 $1
echo -a $nick typed $1 $+ . $+ $2
}
Once that tokenize is performed, everything else sent as text ($2-) just disappeared. To continue using original params you'd have to do something like:
ON *:TEXT:*:*:{
var %text = $1-
tokenize 45 $1
echo -a $nick typed $1 $+ . $+ $2
tokenize 32 %text
echo -a The third word of that line was $3
}
With my idea:
ON *:TEXT:*:*:{
tokenize N 45 $1
echo -a $nick typed $N1 $+ . $+ $N2
echo -a The third word of that line was $3
}
Basically it just prevents it from overwriting what is currently in $1..N and also allows you to easily use many tokenize calls in the same event/alias/etc.