mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2006
Posts: 10
N
Pikka bird
OP Offline
Pikka bird
N
Joined: Jan 2006
Posts: 10
How is this done? I want to use a script that randomly voices a user in the listbox, but I'm not quite sure how to do this. Suggestions?

Joined: Mar 2005
Posts: 212
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
i can give you the "core" you didnt mention how u want it
triggered i assume by listbox you mean nicklist
Code:
alias random.voice {
  if ($me isop $chan) {    
    var %tnum = $nick($chan,0)
    mode $chan +v $nick($chan,$rand(1,%tnum))    
  }
}

^untested
i should probably mention the way you use this is to type /random.voice in the channel in question which u can replace in the code with what you prefer

Last edited by NeUtRoN_StaR; 03/01/06 06:44 AM.
Joined: Jan 2006
Posts: 10
N
Pikka bird
OP Offline
Pikka bird
N
Joined: Jan 2006
Posts: 10
Okay. I just wasn't sure how to make a script randomly pick a user, but you showed me. grin Thanks.

Joined: Mar 2005
Posts: 212
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
if u want additional clarity try /help $nick and /help $rand

Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
Code:
alias randv {
  if ($me isop $chan && $vnick($chan,0) < $nick($chan,0)) {
    var %max = $nick($chan,0)
    var %isvoice = $true
    while (%isvoice) {
      var %nick = $nick($chan,$rand(1,%max))
      if (%nick !isvoice $chan) {
        mode $chan +v %nick
        %isvoice = $false
      }
    }
  }
}


This will pick a new random nick if the current one is already voiced.

Joined: Mar 2005
Posts: 212
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
:tongue:

Joined: Jun 2005
Posts: 127
H
Vogon poet
Offline
Vogon poet
H
Joined: Jun 2005
Posts: 127
alias randv { if ($me isop $chan) { mode $chan +v $nick($chan,$rand(1,$nick($chan,0,r)),r) } }

/randv


-- HAMM3R (aka: alhammer)
http://www.HAMM3R.net

Link Copied to Clipboard