UNO — File Browser
UNO.mrc — 23.89 KB — Download this file
on *:LOAD:{
window -pCfdBoh +dL @UNO 1 1 250 200 @UNO
drawrect -rnf @UNO 0 1 0 0 250 200
drawrect -rn @UNO $rgb(255,255,255) 1 1 1 248 198
var %a 1
while %a < 11 {
drawtext -ron @UNO $rgb(200,200,0) Tahoma 100 $calc(15-%a) %a UNO
inc %a
}
drawtext -ron @UNO $rgb(255,255,0) Tahoma 100 15 0 UNO
drawtext -rn @UNO $rgb(255,255,0) Tahoma 12 73 160 v2 by poiuy_qwert
drawtext -rn @UNO $rgb(200,200,200) Tahoma 12 45 180 (Right-click for more options)
drawdot @UNO
}
menu @UNO {
Open Readme:run $+(",$scriptdirreadme.html")
Open Settings:run notepad $+(",$scriptdirsettings.ini")
Close Splash:window -c @UNO
}
on *:KEYUP:@UNO:13,27:if ($keyval == 13) && (!%enter) inc %enter | else { window -c @UNO | unset %enter }
on *:CONNECT:if ($uno.set(autojoin)) join $uno.set(channel)
on *:TEXT:$($uno.set(trigger) $+ *):$($uno.set(channel)):{
tokenize 32 $right($1-,-1)
if (*m* iswmcs $chan($chan).mode) && ($me isreg $chan) && ($uno.set(moderror)) { uno.msg $nick 7UNO14 can't be played with mode +m on unless the bot is voiced or opped. | return }
if ($1 == on) {
if ($uno.access($1,$nick,$chan)) uno.msg $chan You must be $v1 to use that command.
elseif (!$uno.hash(on)) {
uno.msg $chan 8UNU14 is now on! Type $uno.set(trigger) $+ join to join the game.
hadd -m uno on 1
}
else uno.msg $chan 8UNU15 is allready on.
}
elseif ($1 == join) {
if ($uno.access($1,$nick,$chan)) uno.msg $chan You must be $v1 to use that command.
elseif ($istok($uno.hash(names),$nick,32)) uno.msg $chan You are allready in the game.
elseif ($uno.hash(players) == 10) uno.msg $chan The game is allready full.
elseif ($uno.hash(on) > 1) uno.msg $chan You can't join the game after it has started. Type $uno.set(trigger) $+ replace to be put on the waiting list to replace players that leave.
elseif (!$uno.hash(on)) uno.msg $chan You have to turn 8UNO14 on to join the game. Type $uno.set(trigger) $+ on to turn 8UNO14 on.
else {
hinc uno players 1
hadd uno names $uno.hash(names) $nick
uno.msg $chan $+ $nick has joined the game. $iif($uno.hash(players) > 1,Type $uno.set(trigger) $+ start to begin the game.)
}
}
elseif ($1 == leave) {
if (!$uno.hash(on)) uno.msg $chan You can't leave at this time.
elseif (!$istok($uno.hash(names),$nick,32)) uno.msg $chan You arn't in the game.
else uno.left $chan $nick
}
elseif ($1 == start) {
if ($uno.access($1,$nick,$chan)) uno.msg $chan You must be $v1 to use that command.
elseif ($uno.hash(on) != 1) uno.msg $chan You can't start the game at this time.
elseif ($uno.hash(players) < 2) uno.msg $chan You must have at least 2 players to play.
elseif (!$istok($uno.hash(names),$nick,32)) uno.msg $chan You can't start the game if you are not in it.
else {
uno.msg $chan The uno game has begun!
hinc uno on 1
var %a 1,%cards B0 B1 B1 B2 B2 B3 B3 B4 B4 B5 B5 B6 B6 B7 B7 B8 B8 B9 B9 G0 G1 G1 G2 G2 G3 G3 G4 G4 G5 G5 G6 G6 G7 G7 G8 G8 G9 G9 R0 R1 R1 R2 R2 R3 R3 R4 R4 R5 R5 R6 R6 R7 R7 R8 R8 R9 R9 Y0 Y1 Y1 Y2 Y2 Y3 Y3 Y4 Y4 Y5 Y5 Y6 Y6 Y7 Y7 Y8 Y8 Y9 Y9 BD2 BD2 GD2 GD2 RD2 RD2 YD2 YD2 BR BR GR GR RR RR YR YR BS BS GS GS RS RS YS YS W W W W WD4 WD4 WD4 WD4
while %a <= $uno.hash(players) {
var %b 1,%c,%p = $gettok($uno.hash(names),%a,32)
while %b < 8 {
var %c $gettok(%cards,$r(1,$gettok(%cards,0,32)),32),%cards = $remtok(%cards,%c,1,32)
hadd uno %p $uno.hash(%p) %c
inc %b
}
uno.msg %p Cards: $uno.cards($uno.hash(%p))
inc %a
}
var %c $gettok(%cards,$r(1,$gettok(%cards,0,32)),32)
while (($len(%c) != 2) || ($right(%c,1) !isnum)) %c = $gettok(%cards,$r(1,$gettok(%cards,0,32)),32)
%cards = $remtok(%cards,%c,1,32)
hadd uno played %c
hadd uno top %c
hadd uno deck %cards
hadd uno turn $r(1,$uno.hash(players))
hadd uno order 1
hadd uno started $ctime
uno.msg $chan $+ $gettok($uno.hash(names),$uno.hash(turn),32) $+ 's turn with $gettok($uno.hash($gettok($uno.hash(names),$uno.hash(turn),32)),0,32) cards. Playing on: $uno.cards($uno.hash(top))
}
}
elseif ($1 == play) {
if ($uno.hash(on) !isnum 2-3) uno.msg $chan You can't play a card at this time.
elseif (!$istok($uno.hash(names),$nick,32)) uno.msg $chan You arn't in this game.
elseif ($findtok($uno.hash(names),$nick,1,32) != $uno.hash(turn)) uno.msg $chan It isn't your turn.
elseif ($2 != S) && (!$istok($uno.hash($nick),$2,32)) uno.msg $chan You don't have that card in your hand.
else {
var %n $iif($uno.hash(order),$iif($calc($uno.hash(turn)+1) > $uno.hash(players),1,$v1),$iif($calc($uno.hash(turn)-1) > 0,$v1,$uno.hash(players)))
if ($2 == S) {
if ($3 !isnum 0-9) && (!$istok(R S D2,$3,32)) { uno.msg $chan That is an invalid card to stack. | return }
if (!$4) || (!$istok(B G R Y,$4,32)) { uno.msg $chan You must supply the ending color of the stack. | return }
if (!$istok($uno.hash($nick),$4 $+ $3,32)) { uno.msg $chan You don't have $uno.cards($4 $+ $3) in your hand. | return }
var %a 1,%cards
while $gettok($uno.hash($nick),%a,32) {
var %c $v1,%r
if (W* !iswm %c) && ($len(%c) == $len($+($4,$3))) && ($+(*,$3) iswm %c) { hadd uno $nick $remtok($uno.hash($nick),%c,1,32) | %cards = %cards %c }
else inc %a
}
if ($3 == R) { hadd uno order $calc(($uno.hash(order) + $gettok(%cards,0,32)) % 2) | uno.msg $chan $+ $nick played $uno.cards($remtok(%cards,$4 $+ $3,1,32) $4 $+ $3) reversing $gettok(%cards,0,32) times. }
elseif ($3 == S) { var %n $calc(($uno.hash(turn)+$gettok(%cards,0,32)) % $uno.hash(players)+1) | uno.msg $chan $+ $nick played $uno.cards($remtok(%cards,$4 $+ $3,1,32) $4 $+ $3) skipping $gettok(%cards,0,32) turns. }
elseif ($3 == D2) {
if ($gettok($uno.hash(deck),0,32) < $calc($gettok(%cards,0,32)*2)) { hadd uno deck $uno.hash(deck) $gettok($uno.hash(played),2-,32) | hadd uno played $gettok($uno.hash(played),1,32) | uno.msg $chan The deck has been reshuffled for $gettok($uno.hash(names),%n,32) to pick up 4 cards. }
var %a 1,%c
while %a <= $calc($gettok(%cards,0,32)*2) {
%c = $gettok($uno.hash(deck),$r(1,$gettok($uno.hash(deck),0,32)),32)
hadd uno deck $remtok($uno.hash(deck),%c,1,32)
hadd uno $gettok($uno.hash(names),%n,32) $uno.hash($gettok($uno.hash(names),%n,32)) %c
inc %a
}
uno.msg $chan $+ $nick played $uno.cards($remtok(%cards,$4 $+ $3,1,32) $4 $+ $3) making $gettok($uno.hash(names),%n,32) pick up $calc($gettok(%cards,0,32)*2) cards.
}
else uno.msg $chan $+ $nick played $uno.cards($remtok(%cards,$4 $+ $3,1,32) $4 $+ $3) $+ .
hadd uno top $4 $+ $3
hadd uno played %cards $uno.hash(played)
}
elseif ($left($2,1) == w) && ($istok(B G R Y,$3,32)) {
if (!$3) || (!$istok(B G R Y,$3,32)) { uno.msg $chan You must supply a color to change to. | return }
if ($right($2,2) == D4) {
uno.msg $chan $+ $nick played $uno.cards($2) making $gettok($uno.hash(names),%n,32) pick up 4 and changed the suit to $uno.cards($3)
if ($gettok($uno.hash(deck),0,32) < 4) { hadd uno deck $uno.hash(deck) $gettok($uno.hash(played),2-,32) | hadd uno played $gettok($uno.hash(played),1,32) | uno.msg $chan The deck has been reshuffled for $gettok($uno.hash(names),%n,32) to pick up 4 cards. }
var %a 1,%c
while %a < 5 {
%c = $gettok($uno.hash(deck),$r(1,$gettok($uno.hash(deck),0,32)),32)
hadd uno deck $remtok($uno.hash(deck),%c,1,32)
hadd uno $gettok($uno.hash(names),%n,32) $uno.hash($gettok($uno.hash(names),%n,32)) %c
inc %a
}
}
else uno.msg $chan $+ $nick played $uno.cards($2) and changed the suit to $uno.cards($3)
hadd uno top $3
}
elseif ($len($2) == 2) && ($right($2,1) !isnum 0-9) {
if ($left($2,1) != $left($uno.hash(top),1)) && ($right($2,1) != $right($uno.hash(top),1)) { uno.msg $chan That is an invalid card. | return }
if ($right($2,1) == R) {
if ($uno.hash(players) == 2) { uno.msg $chan $+ $nick played $uno.cards($2) and since it 1 on 1, skipped $gettok($uno.hash(names),%n,32) $+ 's turn. | %n = $iif($uno.hash(order),$iif($calc($uno.hash(turn)+2) > $uno.hash(players),$calc($v1 - $v2),$v1),$iif($calc($uno.hash(turn)-2) < 1,$calc($uno.hash(players)- $abs($v1)),$v1)) }
else { uno.msg $chan $+ $nick played $uno.cards($2) and reversed the order. | hadd uno order $iif($uno.hash(order),0,1) }
}
elseif ($right($2,1) == S) { uno.msg $chan $+ $nick played $uno.cards($2) and skipped $gettok($uno.hash(names),%n,32) $+ 's turn. | %n = $iif($uno.hash(order),$iif($calc($uno.hash(turn)+2) > $uno.hash(players),$calc($v1 - $v2),$v1),$iif($calc($uno.hash(turn)-2) < 1,$calc($uno.hash(players)- $abs($v1)),$v1)) }
hadd uno top $2
}
elseif ($len($2) == 2) && ($right($2,1) isnum 0-9) {
if (($len($uno.hash(top)) != 2) && ($left($2,1) != $left($uno.hash(top),1))) || (($len($uno.hash(top)) == 2) && ($left($2,1) != $left($uno.hash(top),1)) && ($right($2,1) != $right($uno.hash(top),1))) { uno.msg $chan That is an invalid card. | return }
uno.msg $chan $+ $nick played $uno.cards($2) $+ .
hadd uno top $2
}
elseif ($right($2,2) == D2) {
if ($left($2,1) != $left($uno.hash(top),1)) && ($right($uno.hash(top),2) != D2) { uno.msg $chan That is the wrong color. | return }
uno.msg $chan $+ $nick played $uno.cards($2) making $gettok($uno.hash(names),%n,32) pick up 2 cards.
if ($gettok($uno.hash(deck),0,32) < 2) { hadd uno deck $uno.hash(deck) $gettok($uno.hash(played),2-,32) | hadd uno played $gettok($uno.hash(played),1,32) | uno.msg $chan The deck has been reshuffled for $gettok($uno.hash(names),%n,32) to pick up 2 cards. }
var %a 1,%c
while %a < 3 {
%c = $gettok($uno.hash(deck),$r(1,$gettok($uno.hash(deck),0,32)),32)
hadd uno deck $remtok($uno.hash(deck),%c,1,32)
hadd uno $gettok($uno.hash(names),%n,32) $uno.hash($gettok($uno.hash(names),%n,32)) %c
inc %a
}
hadd uno top $2
}
else { uno.msg $chan That is an invalid card. | return }
if ($2 != A) { hadd uno $nick $remtok($uno.hash($nick),$2,1,32) | hadd uno played $2 $uno.hash(played) }
hadd uno turn %n
var %n $iif($uno.hash(order),$iif($calc($uno.hash(turn)-1) > 0,$v1,$uno.hash(players)),$iif($calc($uno.hash(turn)+1) < $uno.hash(players),$v1,1))
if ($uno.hash(on) == 3) { uno.msg $chan $+ $nick went while $gettok($uno.hash(names),%n,32) had 1 card left, stopping anyone from making him draw 2 cards. | hdec uno on 1 }
if ($uno.hash(draw)) hdel uno draw
if ($gettok($uno.hash($nick),0,32) == 1) { hinc uno on 1 }
elseif (!$uno.hash($nick)) {
var %a 1,%p 0
while $gettok($uno.hash(names),%a,32) {
var %b 1,%n $v1
if (%n == $nick) { inc %a | continue }
while $gettok($uno.hash(%n),%b,32) {
var %c $v1
inc %p $iif($len(%c) == 2,$iif($right(%c,1) isnum,$v1,20),50)
inc %b
}
inc %a
}
writeini -n $+(",$scriptdirsettings.ini") points $md5($wildsite) $calc($uno.points($wildsite)+%p)
window -sl @Ranks
var %a 1
while $uno.points(%a) {
aline @Ranks $uno.points($v1) $uno.points(%a)
inc %a
}
uno.msg $chan 4 $+ $nick has won the game in $duration($calc($ctime -$uno.hash(started))) $+ !14 $nick gained %p points, now having $uno.points($wildsite) points total bringing him in $ord($fline(@Ranks,* $md5($wildsite),1)) place.
uno.msg $chan Type $uno.set(trigger) $+ on to start another game!
window -c @Ranks
hfree uno
return
}
uno.msg $chan $+ $gettok($uno.hash(names),$uno.hash(turn),32) $+ 's turn with $gettok($uno.hash($gettok($uno.hash(names),$uno.hash(turn),32)),0,32) cards. Playing on: $uno.cards($uno.hash(top))
uno.msg $gettok($uno.hash(names),$uno.hash(turn),32) Cards: $uno.cards($uno.hash($gettok($uno.hash(names),$uno.hash(turn),32)))
}
}
elseif ($1 == draw) || ($1 == pass) {
if ($uno.hash(on) !isnum 2-3) uno.msg $chan You can't $1 at this time.
elseif (!$istok($uno.hash(names),$nick,32)) uno.msg $chan You arn't in this game.
elseif ($findtok($uno.hash(names),$nick,1,32) != $uno.hash(turn)) uno.msg $chan It isn't your turn.
elseif ($uno.hash(draw)) && ($1 == draw) uno.msg $chan You can't draw again. Type $uno.set(trigger) $+ play Card if you can play a card, or $uno.set(trigger) $+ pass to pass.
elseif (!$uno.hahs(draw)) && ($1 == prass) uno.msg $chan You can't pass untill you draw. Type $uno.set(trigger) $+ draw to draw a card.
else {
if ($1 == draw) {
var %n $iif($uno.hash(order),$iif($calc($uno.hash(turn)-1) > 0,$v1,$uno.hash(players)),$iif($calc($uno.hash(turn)+1) < $uno.hash(players),$v1,1))
if ($uno.hash(on) == 3) { uno.msg $chan $+ $nick draw while $gettok($uno.hash(names),%n,32) had 1 card left, stopping anyone from making him draw 2 cards. | hdec uno on 1 }
if ($gettok($uno.hash(deck),0,32) < 1) { hadd uno deck $uno.hash(deck) $gettok($uno.hash(played),2-,32) | hadd uno played $gettok($uno.hash(played),1,32) | uno.msg $chan The deck has been reshuffled for $gettok($uno.hash(names),%n,32) to pick up his card. }
%c = $gettok($uno.hash(deck),$r(1,$gettok($uno.hash(deck),0,32)),32)
hadd uno deck $remtok($uno.hash(deck),%c,1,32)
hadd uno $nick $uno.hash($nick) %c
hadd uno draw 1
uno.msg $chan $+ $nick drew a card.
uno.msg $nick Cards: $uno.cards($uno.hash($nick))
}
else {
hdel uno draw
uno.msg $chan $+ $nick passed his turn.
hadd uno turn $iif($uno.hash(order),$iif($calc($uno.hash(turn)+1) > $uno.hash(players),1,$v1),$iif($calc($uno.hash(turn)-1) > 0,$v1,$uno.hash(players)))
uno.msg $chan $+ $gettok($uno.hash(names),$uno.hash(turn),32) $+ 's turn with $gettok($uno.hash($gettok($uno.hash(names),$uno.hash(turn),32)),0,32) cards. Playing on: $uno.cards($uno.hash(top))
uno.msg $gettok($uno.hash(names),$uno.hash(turn),32) Cards: $uno.cards($uno.hash($gettok($uno.hash(names),$uno.hash(turn),32)))
}
}
}
elseif ($1 == uno) {
if ($uno.hash(on) != 3) uno.msg $chan You can't use that at this time.
elseif (!$istok($uno.hash(names),$nick,32)) uno.msg $chan You arn't in this game.
else {
var %n $iif($uno.hash(order),$iif($calc($uno.hash(turn)-1) > 0,$v1,$uno.hash(players)),$iif($calc($uno.hash(turn)+1) < $uno.hash(players),$v1,1))
if ($nick == $gettok($uno.hash(names),%n,32)) { uno.msg $chan $+ $gettok($uno.hash(names),%n,32) prevented his opponents from making him draw 2 cards. | hdec uno on 1 | return }
uno.msg $chan $+ $gettok($uno.hash(names),%n,32) had 1 card left but $nick called 8UNO14 before him causing him to draw 2 cards.
if ($gettok($uno.hash(deck),0,32) < 2) { hadd uno deck $uno.hash(deck) $gettok($uno.hash(played),2-,32) | hadd uno played $gettok($uno.hash(played),1,32) | uno.msg $chan The deck has been reshuffled for $gettok($uno.hash(names),%n,32) to pick up 2 cards. }
var %a 1,%c
while %a < 3 {
%c = $gettok($uno.hash(deck),$r(1,$gettok($uno.hash(deck),0,32)),32)
hadd uno deck $remtok($uno.hash(deck),%c,1,32)
hadd uno $gettok($uno.hash(names),%n,32) $uno.hash($gettok($uno.hash(names),%n,32)) %c
inc %a
}
hdec uno on 1
}
}
elseif ($1 == replace) {
if ($uno.access($1,$nick,$chan)) uno.msg $chan You must be $v1 to use that command.
elseif ($uno.hash(on) < 2) uno.msg $chan You can't be put on the replace list at this time.
elseif ($istok($uno.hash(names),$nick,32)) uno.msg $chan You are allready in the game.
elseif ($istok($uno.hash(replace),$nick,32)) uno.msg $chan You are allready on the replace list.
else { hadd uno replace $uno.hash(replace) $nick | uno.msg $chan $+ $nick has been added to the replace list in case someone leaves the game. }
}
elseif ($1 == off) {
if ($uno.access($1,$nick,$chan)) uno.msg $chan You must be $v1 to use that command.
elseif (!$uno.hash(on)) uno.msg $chan 8UNO14 is not on.
else { uno.msg $chan $+ $nick has turned 8UNO14 off. | hfree uno }
}
elseif ($1 == help) {
tokenize 32 $iif($2,$2,help)
if ($uno.access($1,$nick,$chan)) uno.msg $chan You must be $v1 to use that command.
elseif (!$uno.help($1)) uno.msg $nick Invalid topic.
else uno.msg $nick $replace($uno.help($1),^,,*,$uno.set(trigger))
}
elseif ($1 == trigger) {
if ($uno.access($1,$nick)) uno.msg $chan You must be $v1 to use that command.
elseif (!$2) uno.msg $chan You must supply a trigger.
elseif ($asc($left($2,1)) !isnum 33-126) uno.msg $chan That is an invalid trigger.
else { writeini -n $+(",$scriptdirsettings.ini") settings trigger $left($2,1) | uno.msg $chan $+ $nick changed trigger to $uno.set(trigger) $+ . }
}
elseif ($1 == addadmin) {
if ($uno.access($1,$nick)) uno.msg $chan You must be $v1 to use that command.
elseif (!$2) || ($2 !ison $chan) uno.msg $chan You must supply a nick in this channel.
elseif ($uno.set($address($2,2)).admin) uno.msg $chan $+ $2 is allready an admin.
else { writeini -n $+(",$scriptdirsettings.ini") admins $address($2,2) 1 | uno.msg $chan $+(,$2 ,$chr(40),,$address($2,2),,$chr(41)) was added as an admin. }
}
elseif ($1 == deladmin) {
if ($uno.access($1,$nick)) uno.msg $chan You must be $v1 to use that command.
elseif (!$2) || ($2 !ison $chan) || (!$uno.set($2).admin) uno.msg $chan You must supply a nick in this channel, or the address of an admin.
elseif ($nick == $2) || ($wildsite == $2) uno.msg $chan You cant delete yourself.
elseif (!$uno.set($2).admin) && (!$uno.set($address($2,2)).admin) uno.msg $chan That nick/address does not belong to an admin.
else { remini $+(",$scriptdirsettings.ini") admins $iif($uno.set($2).admin,$2,$address($2,2)) | uno.msg $chan $+($iif($uno.set($2).admin,$+(,$2,),$+(,$2 ,$chr(40),,$address($2,2),,$chr(41))) has been deleted from the admins. }
}
elseif ($1 == suspend) {
if ($uno.access($1,$nick)) uno.msg $chan You must be $v1 to use that command.
elseif (!$2) || ($2 !ison $chan) || (!$uno.set($2).admin) uno.msg $chan You must supply a nick in this channel, or the address of an admin.
elseif (!$uno.set($2).admin) && (!$uno.set($address($2,2)).admin) uno.msg $chan That nick/address does not belong to an admin.
elseif ($nick == $2) || ($wildsite == $2) uno.msg $chan You cant suspend yourself.
elseif ($uno.set($2).admin == 2) || ($uno.set($address($2,2)).admin == 2) uno.msg $chan That admin is allready suspended.
else { writeini -n $+(",$scriptdirsettings.ini") admins $iif($uno.set($2).admin,$2,$address($2,2)) 2 | uno.msg $chan $+($iif($uno.set($2).admin,$+(,$2,),$+(,$2 ,$chr(40),,$address($2,2),,$chr(41))) was suspended. }
}
elseif ($1 == unsuspend) {
if ($uno.access($1,$nick)) uno.msg $chan You must be $v1 to use that command.
elseif (!$2) || ($2 !ison $chan) || (!$uno.set($2).admin) uno.msg $chan You must supply a nick in this channel, or the address of an admin.
elseif (!$uno.set($2).admin) && (!$uno.set($address($2,2)).admin) uno.msg $chan That nick/address does not belong to an admin.
elseif ($nick == $2) || ($wildsite == $2) uno.msg $chan You cant unsuspend yourself.
elseif ($uno.set($2).admin != 2) || ($uno.set($address($2,2)).admin != 2) uno.msg $chan That admin isn't suspended.
else { writeini -n $+(",$scriptdirsettings.ini") admins $iif($uno.set($2).admin,$2,$address($2,2)) 1 | uno.msg $chan $+($iif($uno.set($2).admin,$+(,$2,),$+(,$2 ,$chr(40),,$address($2,2),,$chr(41))) was unsuspended. }
}
}
on *:PART:$($uno.set(channel)):uno.left $chan $nick
on *:QUIT:if ($nick ison $uno.set(channel)) uno.left $v2 $nick
on *:KICK:$($uno.set(channel)):uno.left $chan $nick
on *:BAN:$($uno.set(channel)):uno.left $chan $nick
on *:NICK:{
if ($nick !ison $uno.set(channel)) || (!$uno.hash(on)) || (!$istok($uno.hash(names),$2,32)) return
hadd uno $newnick $uno.hash($nick)
hdel uno $nick
hadd uno names $reptok($uno.hash(names),$nick,$newnick,1,32)
}
alias -l uno.left {
if ($istok($uno.hash(replace),$2,32)) { hadd uno replace $remtok($uno.hash(replace),$2,32) | return }
if (!$uno.hash(on)) || (!$istok($uno.hash(names),$2,32)) return
if ($uno.hash(on) == 1) { hadd uno names $remtok($uno.hash(names),$2,32) | hdec uno players 1 | uno.msg $1 $+ $2 has left the game. $iif($uno.hash(players) > 1,Type $uno.set(trigger) $+ start to begin the game.) }
elseif ($uno.hash(on) isnum 2-3) {
if ($gettok($uno.hash(replace),1,32)) {
uno.msg $1 $+ $2 has left the game and was replaced with $v1 $+ .
hadd uno $v1 $uno.hash($2)
hdel uno $2
hadd uno names $reptok($uno.hash(names),$2,$v1,1,32)
hadd uno replace $remtok($uno.hash(replace),$v1,32)
if ($gettok($uno.hash(names),$uno.hash(turn),32) == $v1) { uno.msg $1 $+ $v1 $+ 's turn with $gettok($uno.hash($v1),0,32) cards. Playing on: $uno.cards($uno.hash(top)) | uno.msg $v1 Cards: $uno.cards($uno.hash($v1)) }
}
else {
if ($uno.hash(players) == 2) { uno.msg $1 $+ $2 left the game. There are no replacements and only one player left so the game has been turned off. | hfree uno | return }
uno.msg $1 $+ $2 hash left the game. There are no people on the replace list so his cards were put in the deck.
hadd uno deck $uno.hash(deck) $uno.hash($2)
hdel uno $2
if ($gettok($uno.hash(names),$uno.hash(turn),32) == $2) {
if (!$uno.hash(order)) hadd uno turn $iif($calc($uno.hash(turn)-1) < 1,$calc($uno.hash(players)-1),$v1)
hadd uno names $remtok($uno.hash(names),$2,32)
uno.msg $1 $+ $gettok($uno.hash(names),$uno.hash(turn),32) $+ 's turn with $gettok($uno.hash($gettok($uno.hash(names),$uno.hash(turn),32)),0,32) cards. Playing on: $uno.cards($uno.hash(top))
uno.msg $gettok($uno.hash(names),$uno.hash(turn),32) Cards: $uno.cards($uno.hash($gettok($uno.hash(names),$uno.hash(turn),32)))
}
}
}
}
alias -l uno.set return $readini($+(",$scriptdirsettings.ini"),settings,$1)
alias -l uno.msg { var %msg $iif(!$uno.set(noprefix),$+(4,$chr(44),1[7U8N0O4])) 14,1 $+ $2- | $iif(#* iswm $1,msg,.notice) $1 $iif($uno.set(nocolor),$strip(%msg,c),$iif(*c* iswmcs $chan($1).mode,$strip(%msg,c),%msg)) }
alias -l uno.hash return $hget(uno,$1)
alias -l uno.cards {
var %a 1,%r
while $gettok($1,%a,32) {
%r = %r $replace($left($v1,1),B,12,G,9,R,4,Y,8,W,15) $+ $v1
inc %a
}
return $upper(%r) $+ 14,1
}
alias -l uno.points {
if ($1 isnum) return $ini($+(",$scriptdirsettings.ini"),points,$1)
else return $readini($+(",$scriptdirsettings.ini"),points,$iif($regex($1,[^a-z0-9]),$md5($1),$1))
}
alias -l uno.access {
if ($address($2,2) == $uno.set(owner)) return
if ($uno.set($1) == 1) && ($address($2,2) != $uno.set(owner)) return the bot owner
if ($uno.set($1) == 2) && ($2 isreg $3) return a voice, op
if ($uno.set($1) == 3) && ($2 !isop $3) return an op, or the bot owner
if ($uno.set($1) == 4) && (!$uno.set($address($2,2)).admin) return a bot admin, or the bot owner
if ($uno.set($1) == 5) && ($2 isreg $3) && ($address($2,2) != $uno.set(admin)) return return a voice, op, an admin, or the bot owner
if ($uno.set($1) == 6) && ($2 !isop $3) && ($address($2,2) != $uno.set(admin)) return return an op, an admin, or the bot owner
}
alias -l uno.help return $readini($+(",$scriptdirsettings.ini"),help,$1)