mIRC Home    About    Download    Register    News    Help

Print Thread
#95314 23/08/04 08:26 PM
Joined: Jun 2004
Posts: 139
N
Ninko Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Jun 2004
Posts: 139
Hi there,
I'm just wondering how I could go about getting mIRC to say a random nickname that is in the chatroom at the time?

Thanks smile

#95315 23/08/04 08:35 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
I dont know what you want to do with the random nick: Echo it? Say it in the channel? Add it to other commands? Either way, the random nick "picking" should work with this:
Code:
 [color:green]; Code begins here.. does what it is supposed to...
 ; Choosing randon nick follows[/color]
 var %all = $nick([color:red]#channel[/color],0)
 var %nick = $nick([color:red]#channel[/color],$rand(1,%all))
 [color:green]; From now on, %nick contains the random nick that was chosen
 ; Code continues..[/color]
 .
 .
This part of a code should choose a random nickname from the #channel specified. smile

Zyzzyx.


"All we are saying is give peace a chance" -- John Lennon
#95316 23/08/04 08:39 PM
Joined: Jun 2004
Posts: 139
N
Ninko Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Jun 2004
Posts: 139
I would like it to say it in the chatroom if possible, triggered by a command like, !pick

#95317 23/08/04 08:47 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
If the command should be triggered by someone else besides you:
Code:
on *:TEXT:!pick:[color:red]#channel[/color]: {
 var %all = $nick([color:red]#channel[/color],0)
 var %nick = $nick([color:red]#channel[/color],$rand(1,%all))
 msg $chan [color:green]Hey there, %nick :)[/color]
}


If the command should be triggered by you alone - usage is: /pick <#channel>
Code:
alias pick { 
 if (!$1) { echo $color(info) -a * You must specify a channel. }
 var %all = $nick($$1,0)
 var %nick = $nick($$1,$rand(1,%all))
 msg $$1 [color:green]Hey there, %nick :)[/color]
}
In the first code you can change the #channel to any channel you wish, or just use # to ALL channels. The 2nd script is activated through an alias called /pick - you should use it like /pick #channel

In both cases you can change the message sent to the channel. Also in both codes, the %variable that holds the nickname chosen is %nick, meaning wherever you want to say the person's nick, use that variable smile

Have fun!
Zyzzy.


"All we are saying is give peace a chance" -- John Lennon
#95318 23/08/04 08:54 PM
Joined: Jun 2004
Posts: 139
N
Ninko Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Jun 2004
Posts: 139
Ok thanks so much for your help.

Take care smile


Link Copied to Clipboard