mIRC Home    About    Download    Register    News    Help

Print Thread
#160992 02/10/06 06:25 PM
Joined: Jul 2005
Posts: 51
P
Babel fish
OP Offline
Babel fish
P
Joined: Jul 2005
Posts: 51
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


chadchoud @ DALnet
#160993 02/10/06 08:37 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
That error handler does nothing...


Spelling mistakes, grammatical errors, and stupid comments are intentional.
#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,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
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!


Spelling mistakes, grammatical errors, and stupid comments are intentional.
#160997 03/10/06 02:03 PM
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
Poor bytes frown
Code:
alias rantok if ($isid) return $gettok($1,$r(1,$numtok($1,$2)),$2)


$maybe
#160998 03/10/06 04:53 PM
Joined: Jul 2005
Posts: 51
P
Babel fish
OP Offline
Babel fish
P
Joined: Jul 2005
Posts: 51
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.


chadchoud @ DALnet

Link Copied to Clipboard