;Deal or No Deal Game Bot Script ;By John Beshir (aka Namegduf Live) 2006. Copyright © 2006 John Beshir. ;This program is free software; you can redistribute it and/or modify it under ;the terms of Version 2 of the GNU General Public License as published by the ;Free Software Foundation; This program is distributed in the hope that it ;will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty ;of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ;See the GNU General Public License Version 2 for more details, a copy of ;which should be distributed with the program; if not, write to the Free ;Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA ;------ Scripts ------ ;Game Mode Selecting Script on *:TEXT:!mode*:#: if ( ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 0 ) || ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == $null ) ) dmode $$2 ;Game Start Scripts on *:TEXT:!begin*:#: if ( ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 0 ) || ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == $null ) ) dbegin $2 on *:TEXT:!join*:#: if ( ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 1 ) && ( %djoiner [ $+ [ $nick ] ] == $null ) ) dpadd on *:TEXT:!cont*:#: if ( ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 1 ) && ( $nick isop $chan ) ) { timerd off | dselect $chan } ;Status Reporting Script on *:TEXT:!list*:#: if ( $nick == %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) { if ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] > 3 ) dlistboxes } ;Game Command Scripts on *:TEXT:!box*:#: if ( $nick == %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) { if ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 3 ) dpbox $$2 | elseif ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 4 ) dbopen $$2 } on *:TEXT:!case*:#: if ( $nick == %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) { if ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 3 ) dpbox $$2 | elseif ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 4 ) dbopen $$2 } on *:TEXT:!deal*:#: if ( $nick == %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) { if ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 6 ) dadeal } on *:TEXT:!nodeal*:#: if ( $nick == %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) { if ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 6 ) dndeal } on *:TEXT:!exchange*:#: if ( $nick == %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) { if ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 7 ) daexchange } on *:TEXT:!swap*:#: if ( $nick == %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) { if ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 7 ) daexchange } on *:TEXT:!ex*:#: if ( $nick == %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) { if ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 7 ) daexchange } on *:TEXT:!noexchange*:#: if ( $nick == %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) { if ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 7 ) dnexchange } on *:TEXT:!noswap*:#: if ( $nick == %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) { if ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 7 ) dnexchange } on *:TEXT:!noex*:#: if ( $nick == %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) { if ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 7 ) dnexchange } ;Force Game End Script on *:TEXT:!end*:#: if ( ( ( $nick == %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) || ( $nick isop $chan ) ) && ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) ) dend $chan ;Help Scripts on *:TEXT:!help game*:#: if ( ( ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 0 ) || ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == $null ) ) || ( $nick [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) ) dghelp on *:TEXT:!help game*:*: dghelp on *:TEXT:!help score*:#: if ( ( ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 0 ) || ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == $null ) ) || ( $nick [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) ) dshelp on *:TEXT:!help score*:*: dshelp on *:TEXT:!help*:#: if ( ( ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 0 ) || ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == $null ) ) || ( $nick [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) ) dhelp on *:TEXT:!help*:*: dhelp ;Score-Giving Script on *:TEXT:!score*:#: { if ( ( ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 0 ) || ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == $null ) ) || ( $nick [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) ) { if ( ( $3 == US ) || ( $3 == American ) ) dshowscore $2 US $ $chan | elseif ( ( $3 == UK ) || ( $3 == British ) ) dshowscore $2 UK £ $chan else { if ( %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == $null ) dmode | dshowscore $iif($2,$2,$nick) %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $chan } } } on *:TEXT:!score*:*: if ( ( $3 == US ) || ( $3 == American ) ) dshowscore $2 US $ $nick | elseif ( ( $3 == UK ) || ( $3 == British ) ) dshowscore $2 UK £ $nick | else dshowscore $iif($2,$2,$nick) UK £ $nick ;--- Rank Giving Scripts ;All Ranks on *:TEXT:!rank*:#: { if ( ( ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 0 ) || ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == $null ) ) || ( $nick [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) ) { if ( ( $3 == US ) || ( $3 == American ) ) dshowrank $2 US $chan | elseif ( ( $3 == UK ) || ( $3 == British ) ) dshowrank $2 UK $chan else { if ( %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == $null ) dmode | dshowrank $iif($2,$2,1) %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $chan } } } on *:TEXT:!rank*:*: if ( ( $3 == US ) || ( $3 == American ) ) dshowrank $2 US $nick | elseif ( ( $3 == UK ) || ( $3 == British ) ) dshowrank $2 UK $nick | else dshowrank $iif($2,$2,1) UK $nick ;Total Won Rank on *:TEXT:!trank*:#: { if ( ( ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 0 ) || ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == $null ) ) || ( $nick [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) ) { if ( ( $3 == US ) || ( $3 == American ) ) dshowtotalrank $2 US $ $chan | elseif ( ( $3 == UK ) || ( $3 == British ) ) dshowtotalrank $2 UK £ $chan else { if ( %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == $null ) dmode | dshowtotalrank $iif($2,$2,1) %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $chan } } } on *:TEXT:!trank*:*: if ( ( $3 == US ) || ( $3 == American ) ) dshowtotalrank $2 US $ $nick | elseif ( ( $3 == UK ) || ( $3 == British ) ) dshowtotalrank $2 UK £ $nick | else dshowtotalrank $iif($2,$2,1) UK £ $nick on *:TEXT:!totalrank*:#: { if ( ( ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 0 ) || ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == $null ) ) || ( $nick [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) ) { if ( ( $3 == US ) || ( $3 == American ) ) dshowtotalrank $2 US $ $chan | elseif ( ( $3 == UK ) || ( $3 == British ) ) dshowtotalrank $2 UK £ $chan else { if ( %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == $null ) dmode | dshowtotalrank $iif($2,$2,1) %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $chan } } } on *:TEXT:!totalrank*:*: if ( ( $3 == US ) || ( $3 == American ) ) dshowtotalrank $2 US $ $nick | elseif ( ( $3 == UK ) || ( $3 == British ) ) dshowtotalrank $2 UK £ $nick | else dshowtotalrank $iif($2,$2,1) UK £ $nick on *:TEXT:!mrank*:#: { if ( ( ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 0 ) || ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == $null ) ) || ( $nick [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) ) { if ( ( $3 == US ) || ( $3 == American ) ) dshowtotalrank $2 US $ $chan | elseif ( ( $3 == UK ) || ( $3 == British ) ) dshowtotalrank $2 UK £ $chan else { if ( %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == $null ) dmode | dshowtotalrank $iif($2,$2,1) %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $chan } } } on *:TEXT:!mrank*:*: if ( ( $3 == US ) || ( $3 == American ) ) dshowtotalrank $2 US $ $nick | elseif ( ( $3 == UK ) || ( $3 == British ) ) dshowtotalrank $2 UK £ $nick | else dshowtotalrank $iif($2,$2,1) UK £ $nick ;Games Played Rank on *:TEXT:!grank*:#: { if ( ( ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 0 ) || ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == $null ) ) || ( $nick [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) ) { if ( ( $3 == US ) || ( $3 == American ) ) dshowgamesrank $2 US $chan | elseif ( ( $3 == UK ) || ( $3 == British ) ) dshowgamesrank $2 UK $chan else { if ( %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == $null ) dmode | dshowgamesrank $iif($2,$2,1) %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $chan } } } on *:TEXT:!grank*:*: if ( ( $3 == US ) || ( $3 == American ) ) dshowgamesrank $2 US $nick | elseif ( ( $3 == UK ) || ( $3 == British ) ) dshowgamesrank $2 UK $nick | else dshowgamesrank $iif($2,$2,1) UK $nick on *:TEXT:!gamesrank*:#: { if ( ( ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 0 ) || ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == $null ) ) || ( $nick [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) ) { if ( ( $3 == US ) || ( $3 == American ) ) dshowgamesrank $2 US $chan | elseif ( ( $3 == UK ) || ( $3 == British ) ) dshowgamesrank $2 UK $chan else { if ( %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == $null ) dmode | dshowgamesrank $iif($2,$2,1) %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $chan } } } on *:TEXT:!gamesrank*:*: if ( ( $3 == US ) || ( $3 == American ) ) dshowgamesrank $2 US $nick | elseif ( ( $3 == UK ) || ( $3 == British ) ) dshowgamesrank $2 UK $nick | else dshowgamesrank $iif($2,$2,1) UK $nick ;Average Won Per Game Rank on *:TEXT:!arank*:#: { if ( ( ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 0 ) || ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == $null ) ) || ( $nick [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) ) { if ( ( $3 == US ) || ( $3 == American ) ) dshowaveragerank $2 US $ $chan | elseif ( ( $3 == UK ) || ( $3 == British ) ) dshowaveragerank $2 UK £ $chan else { if ( %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == $null ) dmode | dshowaveragerank $iif($2,$2,1) %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $chan } } } on *:TEXT:!arank*:*: if ( ( $3 == US ) || ( $3 == American ) ) dshowaveragerank $2 US $ $nick | elseif ( ( $3 == UK ) || ( $3 == British ) ) dshowaveragerank $2 UK £ $nick | else dshowaveragerank $iif($2,$2,1) UK £ $nick on *:TEXT:!averagerank*:#: { if ( ( ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 0 ) || ( %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == $null ) ) || ( $nick [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) ) { if ( ( $3 == US ) || ( $3 == American ) ) dshowaveragerank $2 US $ $chan | elseif ( ( $3 == UK ) || ( $3 == British ) ) dshowaveragerank $2 UK £ $chan else { if ( %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == $null ) dmode | dshowaveragerank $iif($2,$2,1) %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $chan } } } on *:TEXT:!averagerank*:*: if ( ( $3 == US ) || ( $3 == American ) ) dshowaveragerank $2 US $ $nick | elseif ( ( $3 == UK ) || ( $3 == British ) ) dshowaveragerank $2 UK £ $nick | else dshowaveragerank $iif($2,$2,1) UK £ $nick ;Scripts for Handling Nick Changes, Parts, and Quits on *:NICK: { var %temp 1 | while ( %temp <= $var( %dplayer [ $+ . $+ [ $network ] $+ . $+ * ] , 0) ) { if ( [ [ $var( %dplayer [ $+ . $+ [ $network ] $+ . $+ * ] , %temp ) ] ] == $nick ) set [ $var( %dplayer [ $+ . $+ [ $network ] $+ . $+ * ] , %temp ) ] $newnick | inc %temp } | %temp = 1 | while ( %temp <= $var( %djoiner [ $+ . $+ [ $network ] $+ . $+ * ] , 0 ) ) { var %text $var( %djoiner [ $+ . $+ [ $network ] $+ . $+ * ] , [ %temp ] ) | var %test [ $gettok( %text , 4 , 46 ) ] | if ( %test == $nick ) { unset [ $var( %djoiner [ $+ . $+ [ $network ] $+ . $+ * ] , %temp) ] | set %djoiner [ $+ . $+ [ $network ] $+ . $+ [ $gettok( %text , 3 , 46 ) ] $+ . $+ [ $newnick ] ] 0 } | inc %temp } } on *:PART:#: if ( $nick == %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) dpart | unset %djoiner [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ $nick ] ] on *:QUIT: var %temp 1 | while ( %temp <= $var( %dplayer [ $+ . $+ [ $network ] $+ . $+ * ] , 0) ) { var %text $var( %djoiner [ $+ . $+ [ $network ] $+ . $+ * ] , [ %temp ] ) | if ( [ [ $var( %dplayer [ $+ . $+ [ $network ] $+ . $+ * ] , %temp ) ] ] == $nick ) dend $gettok( %text , 3 , 46 ) | inc %temp } | %temp = 1 | while ( %temp <= $var( %djoiner [ $+ . $+ [ $network ] $+ . $+ * ] , 0 ) ) { var %text $var( %djoiner [ $+ . $+ [ $network ] $+ . $+ * ] , [ %temp ] ) | var %test [ $gettok( %text , 4 , 46 ) ] | if ( %test == $nick ) unset [ $var( %djoiner [ $+ . $+ [ $network ] $+ . $+ * ] , %temp) ] | inc %temp } } ;Script for Handling the Bot Disconnecting By terminating any active games. on *:DISCONNECT: var %temp 1 | while ( %temp <= $var( %dgameon [ $+ . $+ [ $network ] $+ . $+ * ] , 0) ) { var %text $var( %dgameon [ $+ . $+ [ $network ] $+ . $+ * ] , [ %temp ] ) | dend $gettok( %text , 3 , 46 ) | inc %temp } ;------ Aliases ------ ;Alias for listing the options for the help command. alias dhelp { notice $nick --- Deal or No Deal Bot Help --- notice $nick !help - Gives you this help list. notice $nick !help GAME - Gives you a list of in-channel commands for playing the game. notice $nick !help SCORE - Gives you a list of in-channel or PM commands for checking the scores and ranking of yourself and other players. } ;Alias for help on the in-channel game commands. alias dghelp { notice $nick --- Deal or No Deal Bot Game Commands (Can only be used in Channel) --- notice $nick !mode [US or UK] - Change the version of game being played in the channel where that command is entered. If no version is given, defaults to UK. notice $nick !begin [US or UK] - Requests a game start using the given version. If no version is given, goes with the last version played. notice $nick !cont - Skips any more time waiting for players, and starts the game. Channel operator only. notice $nick !list - Gives your chosen box, and lists what boxes you have already opened and what prizes remain in the game. notice $nick !end - Ends a game currently going on. Can be used by either the current player, or any channel operator. notice $nick Other game commands will be given by the bot as the game goes on. Note that while playing the game, if you don't do anything for a period of three minutes, the game is stopped. The same thing occurs if you leave the channel or quit. } ;Alias for help on the in-channel and PM score commands. alias dshelp { notice $nick --- Deal or No Deal Bot Score Commands (Can be PMed or used in Channel) --- notice $nick !score [nick] [version] - Gives you the rankings and scores of a given person, under a given version. notice $nick !rank [number] [version] - Shows who is at the rank for each type of ranking, for a given version. notice $nick !trank or !totalrank or !mrank [number] [version] - Shows who is at the given rank in total won for a given version. notice $nick !grank or !gamesrank [number] [version] - Shows who is at the given rank in total games played for a given version. notice $nick !arank or !averagerank [number] [version] - Shows who is at the given rank in average won per game for a given version. notice $nick Note that for all of the above commands, if the version isn't given, it assumes the current version in a channel, or UK if it is a PM. If a nick isn't given, it assumes the nick of the person using the command, and if a rank number isn't given, it assumes 1. notice $nick Also, during a game, in channel, the bot will only pay attention to the current player, even if anyone would normally be able to use the command. } ;Alias for setting game mode. alias dmode { if ( ( $1 == US ) || ( $1 == American ) ) { unset %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ * ] set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 1 ] 0.01 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 2 ] 1 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 3 ] 5 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 4 ] 10 set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 5 ] 25 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 6 ] 50 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 7 ] 75 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 8 ] 100 set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 9 ] 200 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 10 ] 300 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 11 ] 400 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 12 ] 500 set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 13 ] 750 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 14 ] 1000 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 15 ] 5000 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 16 ] 10000 set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 17 ] 25000 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 18 ] 50000 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 19 ] 75000 set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 20 ] 100000 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 21 ] 200000 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 22 ] 300000 set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 23 ] 400000 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 24 ] 500000 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 25 ] 750000 set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 26 ] 1000000 set %dmidvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] 1000 unset %droundb [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ * ] set %droundb [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 1 ] 6 set %droundb [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 2 ] 5 set %droundb [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 3 ] 4 set %droundb [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 4 ] 3 set %droundb [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 5 ] 2 set %droundb [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] 1 set %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] US set %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $ set %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] briefcase set %dpname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] briefcases set %dcommand [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] !case set %dexchange [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] 0 } else { unset %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ * ] set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 1 ] 0.01 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 2 ] 0.10 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 3 ] 0.50 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 4 ] 1 set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 5 ] 5 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 6 ] 10 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 7 ] 50 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 8 ] 100 set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 9 ] 250 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 10 ] 500 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 11 ] 250 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 12 ] 1000 set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 13 ] 3000 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 14 ] 5000 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 15 ] 10000 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 16 ] 15000 set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 17 ] 20000 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 18 ] 35000 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 19 ] 50000 set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 20 ] 75000 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 21 ] 100000 | set %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 22 ] 250000 set %dmidvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] 1000 unset %droundb [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ * ] set %droundb [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ 1 ] 5 set %droundb [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] 3 set %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] UK set %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] £ set %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] box set %dpname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] boxes set %dcommand [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] !box set %dexchange [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] 1 } } ;Alias for beginning a game. alias dbegin { if ( $1 != $null ) dmode $1 | elseif ( %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == $null ) dmode UK | msg $chan It's time for another game of Deal or No Deal! Anyone who wishes to have a chance to play, enter !join. | set %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] 1 | dfillboxes | timerd [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] 1 50 /dselect $chan } ;Alias for adding a player to the selection process. alias dpadd { msg $chan Player $nick has joined this game of Deal or No Deal! | set %djoiner [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ $nick ] ] 0 } ;Alias for selecting a player and asking for their choice of box. alias dselect { set %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] 2 | if ( $var(%djoiner [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] $+ . $+ * ] ,0) < 1 ) { msg $$1 No players, I'm afraid the show is cancelled for tonight, folks... | dend $$1 | halt } | msg $$1 Ladies and Gentlemen, our player today is... | set %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] $right($var(%djoiner [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] $+ . $+ * ] ,$rand(1,$var(%djoiner [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] $+ . $+ * ] ,0))), $calc(-11 - $len($network) - $len($$1))) | timerd [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] 1 5 /dselecttimer $$1 } alias dselecttimer { msg $$1 %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] $+ ! Choose your %dname [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] $+ . Enter %dcommand [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] to choose. | mode $$1 +v %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] | set %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] 3 | timerdt [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] 1 120 /dtwarning $$1 } ;Alias for randomly putting one value in each box. alias dfillboxes { var %temp 1 | while ( %temp <= $var(%dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ * ] ,0) ) { var %vused [ $+ [ %temp ] ] 0 | set %dbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ %temp ] ] 0 | set %dbopen [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ %temp ] ] 0 | inc %temp } %temp = 1 | while ( %temp <= $var(%dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ * ] ,0) ) { var %random $rand(1,$calc($var(%dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ * ] ,0)+1-%temp)) while ( %random > 0 ) { inc %dbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ %temp ] ] while ( %vused [ $+ [ %dbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ %temp ] ] ] ] == 1 ) inc %dbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ %temp ] ] dec %random } %vused [ $+ [ %dbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ %temp ] ] ] ] = 1 inc %temp } %temp = 1 | while ( %temp <= $var(%dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ * ] ,0) ) { %dbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ %temp ] ] = %dvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ %dbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ %temp ] ] ] ] | inc %temp } } ;Alias for the player choosing their box. alias dpbox { timerdt [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] off | if ( ( $$1 > $var(%dbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ * ] ,0) ) || ( $$1 < 1 ) ) halt | set %dpbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $$1 | msg $chan You have taken %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $$1 $+ ... now, for the first round! | set %dhighestoffer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] 0 | set %dround [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] 1 | dround } ;Alias for starting a game round. alias dround { if ( %droundb [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ %dround [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ] ] != $null ) set %droundboxes [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %droundb [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ %dround [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ] ] | else set %droundboxes [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %droundb [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] | set %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] 4 | set %dbopened [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] 0 msg $chan Begin Round %dround [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ ... choose %droundboxes [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $iif(%droundboxes [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] > 1,%dpname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ],%dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ]) to open. Enter %dcommand [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] to open a %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ . | dlistboxes | timerdt [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] 1 120 /dtwarning $chan } ;Alias for showing what boxes have already been opened and what values remain. alias dlistboxes { var %dlblue | var %dlred | var %dlopen | var %temp 1 | while ( %temp <= $var(%dbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ * ] ,0) ) { if ( %dbopen [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ %temp ] ] == 0 ) { if ( %dbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ %temp ] ] < %dmidvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) %dlblue = $addtok(%dlblue,%dbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ %temp ] ],32) | else %dlred = $addtok(%dlred,%dbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ %temp ] ],32) } | else %dlopen = %dlopen %temp | inc %temp } %dlblue = $replace($sorttok(%dlblue,32,n),$chr(32),$chr(32) $+ %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) %dlred = $replace($sorttok(%dlred,32,n),$chr(32),$chr(32) $+ %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) msg $chan Your %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] is %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dpbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ . msg $chan Already open %dpname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ : %dlopen msg $chan Remaining prizes: $iif(%dlblue != $null,12 $+ %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ %dlblue $+ 12 ) $iif(%dlred != $null,4 $+ %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ %dlred $+ 4) } ;Alias for having a box opened. alias dbopen { timerdt [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] off | if ( %dbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ $$1 ] ] == $null ) { msg $chan There is no %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $$1 $+ . | timerdt [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] 1 120 /dtwarning $chan | halt } | if ( %dbopen [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ $$1 ] ] == 1 ) { msg $chan You already opened %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $$1 $+ . | timerdt [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] 1 120 /dtwarning $chan | halt } if ( $$1 == %dpbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) { msg $chan You can't open your own %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ . | timerdt [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] 1 120 /dtwarning $chan | return } | set %dbopen [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ $$1 ] ] 1 | msg $chan You open %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $$1 $+ ... if ( %dbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ $$1 ] ] < %dmidvalue [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) msg $chan Inside is %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ %dbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ $$1 ] ] $+ . It's in the blue! | else msg $chan Inside is %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ %dbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ $$1 ] ] $+ . Red! Unlucky. | inc %dbopened [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] | if ( $calc(%dbopened [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] + 1) > %droundboxes [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) ddeal $chan elseif ( $calc(%dbopened [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] + 1) == %droundboxes [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) dnoexchange | else timerdt [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] 1 120 /dtwarning $chan } ;Alias for offering a deal (this bit is skipped if there is only one other box left, not enough for another round, and you can't exchange) alias ddeal { var %dtobeopen 2 | var %temp 1 | while ( %temp <= $var(%dbox [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] $+ . $+ * ] ,0) ) { if ( %dbopen [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] $+ . $+ [ %temp ] ] == 1 ) inc %dtobeopen | inc %temp } | if ( ( %dtobeopen > $var(%dbox [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] $+ . $+ * ] ,0) ) && ( %dexchange [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] == 0 ) ) { dnoexchange $$1 | return } set %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] 5 | msg $$1 That's %droundboxes [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] $iif(%droundboxes [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] > 1,%dpname [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ],%dname [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ]) opened... now wait for the banker to call. var %dbtotal 0 | var %dbtopen 0 | var %temp 1 | while ( %temp <= $var(%dbox [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] $+ . $+ * ] ,0) ) { if ( %dbopen [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] $+ . $+ [ %temp ] ] == 0 ) { %dbtotal = %dbtotal + %dbox [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] $+ . $+ [ %temp ] ] | inc %dbtopen } | inc %temp } set %doffer [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] $round($calc(((%dbtotal / %dbtopen) * $rand(60,110) ) / 100),0) | if ( %dhighestoffer [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] < %doffer [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] ) %dhighestoffer [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] = %doffer [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] | timerd [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] 1 5 /ddealtimer $$1 } alias ddealtimer { msg $$1 The banker offers %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] $+ %doffer [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] $+ ... Deal, or No Deal? Choose by entering !deal, or !nodeal. | set %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] 6 | timerdt [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] 1 120 /dtwarning $$1 } ;Alias for rejecting a deal and checking whether there are sufficient boxes for another round. alias dndeal { timerdt [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] off | var %dtobeopen 0 | var %temp 1 | while ( %temp <= $var(%dbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ * ] ,0) ) { if ( %dbopen [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ %temp ] ] == 1 ) inc %dtobeopen | inc %temp } if ( %droundb [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ [ $calc(%dround [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] + 1) ] ] != $null ) %dtobeopen = $calc(%dtobeopen + 1 + %droundb [ $+ [ $calc(%dround [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] + 1) ] ] ) else %dtobeopen = $calc(%dtobeopen + 1 + %droundb [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) | if ( %dtobeopen > $var(%dbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ * ] ,0) ) { if ( %dexchange [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == 1 ) dexchange | else dnoexchange | halt } msg $chan No deal! You have rejected the banker's offer of %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ %doffer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ ... onto the next round! | inc %dround [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] | dround } ;Alias for accepting a deal. alias dadeal { timerdt [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] off | if ( %doffer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] < %dbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ %dpbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ] ] ) { msg $chan You are going home today with the banker's offer of %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ %doffer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ ... but in your %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] there was %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ %dbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ %dpbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ] ] $+ . | msg $chan Better luck next time, %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ . dhighscore %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %doffer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $chan } elseif ( %doffer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] < %dhighestoffer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) { msg $chan You are going home today with the banker's offer of %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ %doffer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ ... and in your %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] there was only %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ %dbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ %dpbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ] ] $+ . | msg $chan Not bad, %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ , but you had higher offers! dhighscore %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %doffer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $chan } else { msg $chan You are going home today with the banker's offer of %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ %doffer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ ... and in your %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] there was only %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ %dbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ %dpbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ] ] $+ ! | msg $chan Good game, %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ ! | dhighscore %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %doffer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $chan } } ;Alias for the ending of the game and the offer to exchange your box if you reach that point on those versions with exchanging. alias dexchange { set %dlbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] 1 | while ( ( %dbopen [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ %dlbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ] ] == 1 ) || ( %dlbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] == %dpbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] ) ) inc %dlbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] msg $chan No deal! You have rejected the banker's offer of %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ %doffer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ ... and now there are only two %dpname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] left... your %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dpbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ , and %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dlbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ . msg $chan You have the chance to swap %dpname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] if you want... enter !exchange or !noexchange. set %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] 7 | timerdt [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] 1 120 /dtwarning $chan } ;Alias if you go home with your box. alias dnexchange { timerdt [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] off | var %lbox %dlbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] | var %pbox %dpbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] | var %pboxcontents %dbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ %pbox ] ] | var %lboxcontents %dbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ %lbox ] ] | var %offer %doffer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] | var %highestoffer %dhighestoffer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] if ( %offer > %pboxcontents ) { msg $chan Today you go home with the contents of your %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ , which you find is... %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ %pboxcontents $+ , less than the banker's offer, and less than the other %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ , which contained %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ %lboxcontents $+ ! | msg $chan Better luck next time, %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ . dhighscore %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %pboxcontents $chan } elseif ( %highestoffer > %pboxcontents ) { msg $chan Today you go home with the contents of your %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ , which you find is... %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ %pboxcontents $+ , more than the banker's offer and more than the other %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ , which contained %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ %lboxcontents $+ ! | msg $chan Not bad, %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ , but you had offers higher than that! dhighscore %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %pboxcontents $chan } else { msg $chan Today you go home with the contents of your %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ , which you find is... %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ %pboxcontents $+ , higher than any offer, and more than the other %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ , which contained %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ %lboxcontents $+ ! | msg $chan Good game, %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ ! | dhighscore %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %pboxcontents $chan } } ;Alias if you go home with the other box. alias daexchange { timerdt [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] off | var %lbox %dlbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] | var %pbox %dpbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] | var %pboxcontents %dbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ %pbox ] ] | var %lboxcontents %dbox [ $+ . $+ [ $network ] $+ . $+ [ $chan ] $+ . $+ [ %lbox ] ] | var %offer %doffer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] | var %highestoffer %dhighestoffer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] if ( %offer > %lboxcontents ) { msg $chan You switch %dpname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ ... today you go home with the contents of %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %lbox $+ , which you find is... %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ %lboxcontents $+ , less than the banker's offer, and less than your original %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ , which contained %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ %pboxcontents $+ ! | msg $chan Better luck next time, %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ . dhighscore %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %lboxcontents $chan } elseif ( %highestoffer > %lboxcontents ) { msg $chan You switch %dpname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ ... today you go home with the contents of %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %lbox $+ , which you find is... %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ %lboxcontents $+ , more than the banker's offer, and more than your original %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ , which contained %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ %pboxcontents $+ ! | msg $chan Not bad, %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ , but you had offers higher than that! dhighscore %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %lboxcontents $chan } else { msg $chan You switch %dpname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ ... today you go home with the contents of %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %lbox $+ , which you find is... %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ %lboxcontents $+ , more than the highest offer, and more than your original %dname [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ , which contained %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] $+ %pboxcontents $+ ! | dhighscore %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dmode [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $chan ] ] %lboxcontents $chan } } ;Alias if you do not have the option to exchange and must go home with your box. alias dnoexchange { set %dlbox [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] 1 | while ( ( %dbopen [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] $+ . $+ [ %dlbox ] ] == 1 ) || ( %dlbox [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] == %dpbox [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] ) ) inc %dlbox [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] msg $$1 And now there are not enough boxes left for another round! if ( %dhighestoffer [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] > %dbox [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] $+ . $+ [ %dpbox [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] ] ] ) { msg $$1 Today you go home with the contents of your %dname [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] $+ , which you find is... %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] $+ %dbox [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] $+ . $+ [ %dpbox [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] ] ] $+ ! | msg $$1 You had offers higher than that, %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] $+ . dhighscore %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] %dmode [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] %dbox [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] $+ . $+ [ %dpbox [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] ] ] $$1 } else { msg $$1 Today you go home with the contents of your %dname [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] $+ , which you find is... %dsymbol $+ %dbox [ $+ [ %dpbox [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] ] ] $+ , higher than any offer! | msg $$1 Good game, %dplayer $+ ! | dhighscore %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] %dmode [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] %dsymbol [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] %dbox [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] $+ . $+ [ %dpbox [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] ] ] $$1 } } ;Alias for ending a game and resetting all variables. alias dend { var %player %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] | unset %dgameon [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] | unset %djoiner [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] $+ * ] | unset %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] | unset %dbox [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] $+ * ] | unset %dbopen [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] $+ * ] | unset %dpbox [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] unset %dround [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] | unset %dbopened [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] unset %droundboxes [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] | unset %doffer [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] | unset %dhighestoffer [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] | unset %dlbox [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] | timerd [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] off | timerdt [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] off | mode $$1 -v %player | msg $$1 And that brings us to the end of another game of Deal or No Deal! Come back soon! } ;Alias for adding a highscore for the player under the version of the game they are playing, includes updating the ranking alias dhighscore { ;Update the scores set %dplayertotalmoney [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] $calc(%dplayertotalmoney [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] + $$4) if ( ( $round(%dplayertotalmoney [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] , 0) != %dplayertotalmoney [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] ) && ( $round(%dplayertotalmoney [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] , 1 ) == %dplayertotalmoney [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] ) ) %dplayertotalmoney [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] = %dplayertotalmoney [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] $+ 0 set %dplayergames [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] $calc(%dplayergames [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] + 1) set %dplayeraverage [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] $round($calc( %dplayertotalmoney [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] / %dplayergames [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] ),2) if ( ( $round(%dplayeraverage [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] , 0) != %dplayeraverage [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] ) && ( $round(%dplayeraverage [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] , 1 ) == %dplayeraverage [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] ) ) %dplayeraverage [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] = %dplayeraverage [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] $+ 0 ;Update the maximum amount won in a single game for this player if ( %dplayermostmoney [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] == $null ) set %dplayermostmoney [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] $$4 elseif ( $$4 > %dplayermostmoney [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] ) set %dplayermostmoney [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] $$4 ;Update the rankings var %oldtotalmoneyrank %dplayertotalmoneyrank [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] | var %oldgamesrank %dplayergamesrank [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] | var %oldaveragerank %dplayeraveragerank [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] var %temp 1 | set %dplayertotalmoneyrank [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] 0 | while ( %temp <= $var(%dplayertotalmoney [ $+ . $+ [ $$2 ] $+ * ] ,0) ) { if ( [ [ $var(%dplayertotalmoney [ $+ . $+ [ $$2 ] $+ * ] , %temp) ] ] < %dplayertotalmoney [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] ) { inc %dplayertotalmoneyrank [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] | if ( ( [ [ $var(%dplayertotalmoneyrank [ $+ . $+ [ $$2 ] $+ * ] , %temp) ] ] < %oldtotalmoneyrank) || (%oldtotalmoneyrank == $null) ) inc $var(%dplayertotalmoneyrank [ $+ . $+ [ $$2 ] $+ * ] , %temp) } | inc %temp } | %dplayertotalmoneyrank [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] = $var(%dplayertotalmoney [ $+ . $+ [ $$2 ] $+ * ] ,0) - %dplayertotalmoneyrank [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] %temp = 1 | set %dplayergamesrank [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] 0 | while ( %temp <= $var(%dplayertotalmoney [ $+ . $+ [ $$2 ] $+ * ] ,0) ) { if ( [ [ $var(%dplayergames [ $+ . $+ [ $$2 ] $+ * ] , %temp) ] ] < %dplayergames [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] ) { inc %dplayergamesrank [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] | if ( ( [ [ $var(%dplayergamesrank [ $+ . $+ [ $$2 ] $+ * ] , %temp) ] ] < %oldgamesrank) || (%oldgamesrank == $null) ) inc $var(%dplayergamesrank [ $+ . $+ [ $$2 ] $+ * ] , %temp) } | inc %temp } | %dplayergamesrank [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] = $var(%dplayergames [ $+ . $+ [ $$2 ] $+ * ] ,0) - %dplayergamesrank [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] %temp = 1 | set %dplayeraveragerank [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] 0 | while ( %temp <= $var(%dplayertotalmoney [ $+ . $+ [ $$2 ] $+ * ] ,0) ) { if ( [ [ $var(%dplayeraverage [ $+ . $+ [ $$2 ] $+ * ] , %temp) ] ] < %dplayeraverage [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] ) { inc %dplayeraveragerank [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] | if ( ( [ [ $var(%dplayeraveragerank [ $+ . $+ [ $$2 ] $+ * ] , %temp) ] ] < %oldaveragerank) || (%oldaveragerank == $null) ) inc $var(%dplayeraveragerank [ $+ . $+ [ $$2 ] $+ * ] , %temp) } | inc %temp } | %dplayeraveragerank [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] = $var(%dplayeraverage [ $+ . $+ [ $$2 ] $+ * ] ,0) - %dplayeraveragerank [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] ;End the game and show the player their score dend $$5 | dshowscore $$1 $$2 $$3 $$5 } ;Alias for showing a highscore alias dshowscore { if ( %dplayertotalmoney [ $+ . $+ [ $$2 ] $+ . $+ [ $$1 ] ] == $null ) { notice $$4 Player $$1 has not played any games under the $$2 version. | halt } var %suffix . $+ [ $$2 ] $+ . $+ [ $$1 ] | var %players $var(%dplayertotalmoney [ $+ . $+ [ $$2 ] $+ . $+ * ] , 0) notice $$4 $$1 $+ 's Score ( $+ $$2 Version): 8Total Won: $$3 $+ %dplayertotalmoney [ $+ [ %suffix ] ] (Rank: %dplayertotalmoneyrank [ $+ [ %suffix ] ] $+ / $+ %players $+ , Most Won In A Single Game: $$3 $+ %dplayermostmoney [ $+ [ %suffix ] ] $+ ) 4Total Games Played: %dplayergames [ $+ [ %suffix ] ] (Rank: %dplayergamesrank [ $+ [ %suffix ] ] $+ / $+ %players $+ ) 9Average Won Per Game: $$3 $+ %dplayeraverage [ $+ [ %suffix ] ] (Rank: %dplayeraveragerank [ $+ [ %suffix ] ] $+ / $+ %players $+ ) } ;Alias for showing who has a certain rank for all of total won, average, and games played alias dshowrank { var %totalplayer | var %gamesplayer | var %averageplayer | var %temp 1 while ( %temp <= $var(%dplayertotalmoneyrank [ $+ . $+ [ $$2 ] $+ . $+ * ] , 0) ) { if ( [ [ $var(%dplayertotalmoneyrank [ $+ . $+ [ $$2 ] $+ . $+ * ] , %temp) ] ] == $$1 ) %totalplayer = $right($var(%dplayertotalmoneyrank [ $+ . $+ [ $$2 ] $+ . $+ * ] , %temp),$calc(-24-$len($$2))) if ( [ [ $var(%dplayergamesrank [ $+ . $+ [ $$2 ] $+ . $+ * ] , %temp) ] ] == $$1 ) %gamesplayer = $right($var(%dplayergamesrank [ $+ . $+ [ $$2 ] $+ . $+ * ] , %temp),$calc(-19-$len($$2))) if ( [ [ $var(%dplayeraveragerank [ $+ . $+ [ $$2 ] $+ . $+ * ] , %temp) ] ] == $$1 ) %averageplayer = $right($var(%dplayeraveragerank [ $+ . $+ [ $$2 ] $+ . $+ * ] , %temp),$calc(-21-$len($$2))) | inc %temp } if ( %totalplayer == $null ) { notice $$3 No players ranked $ord($$1) found for the $$2 version. | return } var %colour | if ( $$1 == 1 ) %colour = 8 | elseif ( $$1 == 2 ) %colour = 15 | elseif ( $$1 == 3 ) %colour = 7 notice $$3 %colour $+ (For the $$2 Version) In $ord($$1) place for total won is %totalplayer $+ , in $ord($$1) place for total games played is %gamesplayer $+ , and in $ord($$1) place for average won per game is %averageplayer $+ . } ;Alias for showing who has a certain rank in total won. alias dshowtotalrank { var %player | var %nextplayer | var %previousplayer | var %temp 1 while ( %temp <= $var(%dplayertotalmoneyrank [ $+ . $+ [ $$2 ] $+ . $+ * ] , 0) ) { if ( [ [ $var(%dplayertotalmoneyrank [ $+ . $+ [ $$2 ] $+ . $+ * ] , %temp) ] ] == $$1 ) %player = $right($var(%dplayertotalmoneyrank [ $+ . $+ [ $$2 ] $+ . $+ * ] , %temp),$calc(-24-$len($$2))) elseif ( [ [ $var(%dplayertotalmoneyrank [ $+ . $+ [ $$2 ] $+ . $+ * ] , %temp) ] ] == $calc($$1 + 1) ) %nextplayer = $right($var(%dplayertotalmoneyrank [ $+ . $+ [ $$2 ] $+ . $+ * ] , %temp),$calc(-24-$len($$2))) elseif ( [ [ $var(%dplayertotalmoneyrank [ $+ . $+ [ $$2 ] $+ . $+ * ] , %temp) ] ] == $calc($$1 - 1) ) %previousplayer = $right($var(%dplayertotalmoneyrank [ $+ . $+ [ $$2 ] $+ . $+ * ] , %temp),$calc(-24-$len($$2))) | inc %temp } if ( %player == $null ) { notice $$4 No player ranked $ord($$1) in total won found for the $$2 version. | return } var %colour | if ( $$1 == 1 ) %colour = 8 | elseif ( $$1 == 2 ) %colour = 15 | elseif ( $$1 == 3 ) %colour = 7 var %rankmessage if ( ( %previousplayer ) && ( %nextplayer ) ) %rankmessage = %player is ranked $ord($$1) for total won under the $$2 version, with $$3 $+ %dplayertotalmoney [ $+ . $+ [ $$2 ] $+ . $+ [ %player ] ] $+ , behind %previousplayer in $ord($calc($$1 - 1)) place with $$3 $+ %dplayertotalmoney [ $+ . $+ [ $$2 ] $+ . $+ [ %previousplayer ] ] $+ , and ahead of %nextplayer in $ord($calc($$1 + 1)) place with $$3 $+ %dplayertotalmoney [ $+ . $+ [ $$2 ] $+ . $+ [ %nextplayer ] ] $+ . elseif ( %previousplayer ) %rankmessage = %player is ranked $ord($$1) for total won under the $$2 version, bottom of the list, with $$3 $+ %dplayertotalmoney [ $+ . $+ [ $$2 ] $+ . $+ [ %player ] ] $+ . Above them is %previousplayer with $$3 $+ %dplayertotalmoney [ $+ . $+ [ $$2 ] $+ . $+ [ %previousplayer ] ] $+ , in $ord($calc($$1 - 1)) position. elseif ( %nextplayer ) %rankmessage = %player is in 1st place for total won under the $$2 version, winning the most with $$3 $+ %dplayertotalmoney [ $+ . $+ [ $$2 ] $+ . $+ [ %player ] ] $+ ! In 2nd place behind them is %nextplayer with $$3 $+ %dplayertotalmoney [ $+ . $+ [ $$2 ] $+ . $+ [ %nextplayer ] ] $+ . else %rankmessage = %player is in 1st place for total won on the $$2 version with $$3 $+ %dplayertotalmoney [ $+ . $+ [ $$2 ] $+ . $+ [ %player ] ] $+ , but maybe partly because no one else has played yet! notice $$4 %colour $+ %rankmessage } ;Alias for showing who has a certain rank in games played. alias dshowgamesrank { var %player | var %nextplayer | var %previousplayer | var %temp 1 while ( %temp <= $var(%dplayergamesrank [ $+ . $+ [ $$2 ] $+ . $+ * ] , 0) ) { if ( [ [ $var(%dplayergamesrank [ $+ . $+ [ $$2 ] $+ . $+ * ] , %temp) ] ] == $$1 ) %player = $right($var(%dplayergamesrank [ $+ . $+ [ $$2 ] $+ . $+ * ] , %temp),$calc(-19-$len($$2))) elseif ( [ [ $var(%dplayergamesrank [ $+ . $+ [ $$2 ] $+ . $+ * ] , %temp) ] ] == $calc($$1 + 1) ) %nextplayer = $right($var(%dplayergamesrank [ $+ . $+ [ $$2 ] $+ . $+ * ] , %temp),$calc(-19-$len($$2))) elseif ( [ [ $var(%dplayergamesrank [ $+ . $+ [ $$2 ] $+ . $+ * ] , %temp) ] ] == $calc($$1 - 1) ) %previousplayer = $right($var(%dplayergamesrank [ $+ . $+ [ $$2 ] $+ . $+ * ] , %temp),$calc(-19-$len($$2))) | inc %temp } if ( %player == $null ) { notice $$3 No player ranked $ord($$1) for games played found for the $$2 version. | return } var %colour | if ( $$1 == 1 ) %colour = 8 | elseif ( $$1 == 2 ) %colour = 15 | elseif ( $$1 == 3 ) %colour = 7 var %rankmessage if ( ( %previousplayer ) && ( %nextplayer ) ) %rankmessage = %player is ranked $ord($$1) for games played under the $$2 version, with %dplayergames [ $+ . $+ [ $$2 ] $+ . $+ [ %player ] ] games played, behind %previousplayer in $ord($calc($$1 - 1)) place with %dplayergames [ $+ . $+ [ $$2 ] $+ . $+ [ %previousplayer ] ] games, and ahead of %nextplayer in $ord($calc($$1 + 1)) place with %dplayergames [ $+ . $+ [ $$2 ] $+ . $+ [ %nextplayer ] ] $+ . elseif ( %previousplayer ) %rankmessage = %player is ranked $ord($$1) for games played under the $$2 version, bottom of the list, with %dplayergames [ $+ . $+ [ $$2 ] $+ . $+ [ %player ] ] games played. Above them is %previousplayer with %dplayergames [ $+ . $+ [ $$2 ] $+ . $+ [ %previousplayer ] ] games, in $ord($calc($$1 - 1)) position. elseif ( %nextplayer ) %rankmessage = %player is in 1st place for games played under the $$2 version, having played the most with %dplayergames [ $+ . $+ [ $$2 ] $+ . $+ [ %player ] ] games played! In 2nd place behind them is %nextplayer with %dplayergames [ $+ . $+ [ $$2 ] $+ . $+ [ %nextplayer ] ] games. else %rankmessage = %player is in 1st place for games played on the $$2 version with %dplayergames [ $+ . $+ [ $$2 ] $+ . $+ [ %player ] ] games played, but maybe partly because no one else has played yet! notice $$3 %colour $+ %rankmessage } ;Alias for showing who has a certain rank in average won per game. alias dshowaveragerank { var %player | var %nextplayer | var %previousplayer | var %temp 1 while ( %temp <= $var(%dplayeraveragerank [ $+ . $+ [ $$2 ] $+ . $+ * ] , 0) ) { if ( [ [ $var(%dplayeraveragerank [ $+ . $+ [ $$2 ] $+ . $+ * ] , %temp) ] ] == $$1 ) %player = $right($var(%dplayeraveragerank [ $+ . $+ [ $$2 ] $+ . $+ * ] , %temp),$calc(-21-$len($$2))) elseif ( [ [ $var(%dplayeraveragerank [ $+ . $+ [ $$2 ] $+ . $+ * ] , %temp) ] ] == $calc($$1 + 1) ) %nextplayer = $right($var(%dplayeraveragerank [ $+ . $+ [ $$2 ] $+ . $+ * ] , %temp),$calc(-21-$len($$2))) elseif ( [ [ $var(%dplayeraveragerank [ $+ . $+ [ $$2 ] $+ . $+ * ] , %temp) ] ] == $calc($$1 - 1) ) %previousplayer = $right($var(%dplayeraveragerank [ $+ . $+ [ $$2 ] $+ . $+ * ] , %temp),$calc(-21-$len($$2))) | inc %temp } if ( %player == $null ) { notice $$4 No player ranked $ord($$1) in average won per game found for the $$2 version. | return } var %colour | if ( $$1 == 1 ) %colour = 8 | elseif ( $$1 == 2 ) %colour = 15 | elseif ( $$1 == 3 ) %colour = 7 var %rankmessage if ( ( %previousplayer ) && ( %nextplayer ) ) %rankmessage = %player is ranked $ord($$1) for average won per game under the $$2 version, with an average of $$3 $+ %dplayeraverage [ $+ . $+ [ $$2 ] $+ . $+ [ %player ] ] $+ , behind %previousplayer in $ord($calc($$1 - 1)) place with an average of $$3 $+ %dplayeraverage [ $+ . $+ [ $$2 ] $+ . $+ [ %previousplayer ] ] $+ , and ahead of %nextplayer in $ord($calc($$1 + 1)) place with an average of $$3 $+ %dplayeraverage [ $+ . $+ [ $$2 ] $+ . $+ [ %nextplayer ] ] $+ . elseif ( %previousplayer ) %rankmessage = %player is ranked $ord($$1) for average won per game under the $$2 version, bottom of the list, with an average of $$3 $+ %dplayeraverage [ $+ . $+ [ $$2 ] $+ . $+ [ %player ] ] $+ . Above them is %previousplayer with an average of $$3 $+ %dplayeraverage [ $+ . $+ [ $$2 ] $+ . $+ [ %previousplayer ] ] $+ , in $ord($calc($$1 - 1)) position. elseif ( %nextplayer ) %rankmessage = %player is in 1st place for average won per game under the $$2 version, winning the most per game with $$3 $+ %dplayeraverage [ $+ . $+ [ $$2 ] $+ . $+ [ %player ] ] $+ ! In 2nd place behind them is %nextplayer with an average of $$3 $+ %dplayeraverage [ $+ . $+ [ $$2 ] $+ . $+ [ %nextplayer ] ] $+ . else %rankmessage = %player is in 1st place for average won per game on the $$2 version with an average of $$3 $+ %dplayeraverage [ $+ . $+ [ $$2 ] $+ . $+ [ %player ] ] $+ , but maybe partly because no one else has played yet! notice $$4 %colour $+ %rankmessage } ;Alias for warning about timeout alias dtwarning { msg $$1 You are taking your time, %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] $+ ... one more minute and your time is up! | timerdt [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] 1 60 /dtimeout $$1 } ;Alias for timing out alias dtimeout { msg $$1 Player %dplayer [ $+ . $+ [ $network ] $+ . $+ [ $$1 ] ] has run out of time, game ended. | dend $$1 } ;Alias for leaving the channel or quit alias dpart { msg $chan Player %dplayer has left the building! Game ended. | dend $chan }