alias game { dialog -md game game }
dialog Game {
title "Game"
size -1 -1 500 500
list 1, 5 5 490 100
list 2, 5 120 100 200
}
on *:DIALOG:Game:*:*:{
if ($devent == init) {
ctcp [GI]Xarrion JOINGAME
}
if ($devent == close) {
ctcp [GI]Xarrion LEAVEGAME
}
}
ctcp *:NEWPLAYER:*:{
if ($dialog(game)) {
did -a $2 1 $3 has joined the game.
ctcp [GI]Xarrion PLAYER
}
}
ctcp *:LEAVEPLAYER:*:{
if ($3 == $me) { halt }
elseif ($dialog(game)) {
did -a $2 1 $3 has left the game
ctcp [GI]Xarrion PLAYER
}
}
on *:CTCPREPLY:PLAYER*:{
if ($dialog(game)) {
did -r $2 2
var %x 2
while (%x < $0) {
inc %x
did -a $2 2 $($+($chr(36),%x),2)
}
}
}