mIRC Home    About    Download    Register    News    Help

Print Thread
#241994 08/06/13 03:20 PM
Joined: Jun 2013
Posts: 43
G
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Jun 2013
Posts: 43
I am having some trouble with a random name picker. At the moment it is working fine except for I want it to exclude all ops and just pick normal level users. The code at the minute is:

Code:
on +3:text:!winner:#: {

  set %nick1 $nick($chan,$rand(0,$nick($chan,0)))
  if (%nick1 == $me) { set %nick1 $nick($chan,$rand(0,$nick($chan,0))) }
  else
  msg $chan Randomly selecting a winner........
  timerlawl 1 5 msg $chan The winner is %nick1 $+ ! Congratulations $nick1 :) You win... %prize. [ $+ [ $network ] $+ ] . [ $+ [ $chan ] ]
}

on +3:text:!prize *:#: {
  set %prize. [ $+ [ $network ] $+ ] . [ $+ [ $chan ] ] $2-
  msg $chan New prize set!
}

on +3:text:!clprize:#: {
  set %prize. [ $+ [ $network ] $+ ] . [ $+ [ $chan ] ] Nothing
  msg $chan Prize cleared!
}


If somebody could help with this it would be great!

Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
See /help $nick (second entry)

Use $nick($chan,$r(1,$nick($chan,0,r)),r)
Note that addition of "r" and the change of 0 into 1.

Joined: Jun 2013
Posts: 43
G
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Jun 2013
Posts: 43
Okay, that seems to work, thanks!


Link Copied to Clipboard