mIRC Home    About    Download    Register    News    Help

Print Thread
#152332 29/06/06 01:15 PM
Joined: Sep 2005
Posts: 53
C
Babel fish
OP Offline
Babel fish
C
Joined: Sep 2005
Posts: 53
Code:
 
$rand(v,($nick)0)


I forgot how you choose a random person on the list who is voiced. Its something like this but kinda diffrent. Again, im just trying to choose random people who are voiced from the chan.

#152333 29/06/06 02:34 PM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
$rand(0,$nick(#,v,0)) should work if I got it right. The reason I use 0 and not 1 is because it will spread the randoms out a tad more and if it chooses 0, you'll simply get the max number returned which would still be valid. If the code is wrong, somebody will correct me


Those who fail history are doomed to repeat it
#152334 29/06/06 04:09 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
$nick($chan,$rand(1,$nick($chan,0,v)),v)

#152335 30/06/06 04:51 AM
Joined: Sep 2005
Posts: 53
C
Babel fish
OP Offline
Babel fish
C
Joined: Sep 2005
Posts: 53
Say if I am also voiced, how can I make it so that if the random nick is me it goes to the beginning.
Can this work?
Code:
    set %nick $nick($chan,$rand(1,$nick($chan,0,v)),v)
    if %nick = $me { halt }
    { else }
    /msg $chan %nick , your voiced!

Last edited by CraZyHanD; 30/06/06 04:56 AM.
#152336 30/06/06 05:28 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
 while %nick == $me {
set %nick $nick($chan,$r(1,$nick($chan,0,v)),v)
}
.msg $chan %nick $+ $chr(44) You're voiced!
 


Link Copied to Clipboard