mIRC Home    About    Download    Register    News    Help

Print Thread
#160992 02/10/06 06:25 PM
P
poormillionaire
poormillionaire
P
How about adding the $rantok identifier?

So $rantok(%var,32) is the same as $gettok(%var,$rand(1,$numtok(%var,32)),32)

It picks a random token like $rantok(lol lol2 lol3,32) = lol or $rantok(lol lol2 lol3,32) = lol3

#160993 02/10/06 08:37 PM
D
DaveC
DaveC
D
For now....

alias rantok { if ($isid) { return $gettok($1,$rand(1,$numtok($1,$2)),$2) } | :error }

#160994 02/10/06 11:31 PM
Joined: Dec 2002
Posts: 2,884
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,884
That error handler does nothing...

#160995 03/10/06 05:27 AM
Joined: Feb 2004
Posts: 201
J
Jae Offline
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2004
Posts: 201
Quote:
That error handler does nothing...

isnt that the point?

#160996 03/10/06 01:29 PM
Joined: Dec 2002
Posts: 2,884
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,884
No, I mean it does nothing, as in the same thing would happen even if it wasn't there. It doesn't reset the error or anything (and there's no reason you'd want it to), it just takes up 13 bytes on a harddisk. Won't somebody please think of the bytes!

#160997 03/10/06 02:03 PM
Joined: Apr 2004
Posts: 755
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 755
Poor bytes frown
Code:
alias rantok if ($isid) return $gettok($1,$r(1,$numtok($1,$2)),$2)

#160998 03/10/06 04:53 PM
P
poormillionaire
poormillionaire
P
There are many other $tok's that can also be done without being built-in. For example, $numtok(..,32) is the same as $gettok(..,0,32).

So it's not about the bytes.


Link Copied to Clipboard