-
Notifications
You must be signed in to change notification settings - Fork 15
/
randuser.mrc
19 lines (19 loc) · 1.12 KB
/
randuser.mrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
alias randuser {
VAR %x = 1
WHILE ($hget(activeusers, %x).item != $null) {
VAR %nick $v1
IF (!$1) { IF ((%nick ison %mychan) || ($calc($hget(activeusers, %nick) + 90) >= %activetime)) VAR %activelist %activelist %nick }
ELSEIF ($1 == other) { IF (((%nick ison %mychan) || ($calc($hget(activeusers, %nick) + 90) >= %activetime)) && (%nick != $nick)) VAR %activelist %activelist %nick }
ELSEIF ($1 == notme) { IF (((%nick ison %mychan) || ($calc($hget(activeusers, %nick) + 90) >= %activetime)) && (%nick != %streamer)) VAR %activelist %activelist %nick }
ELSEIF ($1 == othernotme) { IF (((%nick ison %mychan) || ($calc($hget(activeusers, %nick) + 90) >= %activetime)) && (%nick != %streamer) && (%nick != $nick)) VAR %activelist %activelist %nick }
ELSEIF ($1 == list) { IF ((%nick ison %mychan) || ($calc($hget(activeusers, %nick) + 90) >= %activetime)) VAR %activelist %activelist %nick }
ELSE BREAK
INC %x
}
IF ($1 == list) RETURN %activelist
ELSE {
VAR %randuser $gettok(%activelist, $rand(1, $numtok(%activelist, 32)), 32)
IF (%randuser != $null) RETURN %randuser
ELSE RETURN $nick
}
}