on *:text:!5050:[color:red]#yourchan[/color]: {
[color:green]; Create the table for scores and set it to load/save automatically so no data loss will occur.[/color]
if ($hget(Game) == $null) {
hmake Game 50
hload Game 5050.txt
.timerGame -o 0 10 hsave Game 5050.txt
}
[color:green]; Check the random number 1 or 2. If it's a 1, devoice or devoice/kick them.[/color]
if ($rand(1,2) == 1) {
[color:green]; Count the number of devoices and add them to the hash table.[/color]
hadd Game $+($nick,.devoices) $calc($hget(Game,$+($nick,.devoices)) + 1)
[color:green]; If the number of devoices is divisible by 5, kick the person.[/color]
if ($calc($hget(Game,$+($nick,.devoices)) % 5) == 0 && $me isop $chan) {
kick $chan $nick You have lost the 50/50 and suffer a kick.
}
[color:green]; If the number of devoices isn't divisible by 5, just devoice the person for 30 seconds.[/color]
else {
msg You have lost the 50/50.
if ($me isop $chan) {
mode $chan -v $nick
.timer $+ $+($nick,.devoice) 1 30 mode $chan +v $nick
}
}
}
[color:green]; If the random number is 2, give points.[/color]
else {
[color:green]; Add points to the hash table.[/color]
hadd Game $+($nick,.points) $calc($hget(Game,$+($nick,.points)) + 1)
msg $chan You have won the 50/50 and received 1 point for a total of $hget(Game,$+($nick,.points)) points.
}
}
[color:green]; Allow viewing scores with !won (to see your own) or !won nick (to see a nick's points).[/color]
on *:text:!won*:[color:red]#yourchan[/color]: {
if ($2 != $null) {
if ($hget(Game,$+($2,.points)) != $null) {
msg $chan $2 has won $hget(Game,$+($2,.points)) points in the 50/50.
}
else {
msg $chan $2 has not won any points in the 50/50.
}
}
else {
if ($hget(Game,$+($nick,.points)) != $null) {
msg $chan You have won $hget(Game,$+($nick,.points)) points in the 50/50.
}
else {
msg $chan You have not won any points in the 50/50.
}
}
}