;;;; Script by OrFeAsGr ;;;;
;;;; My website: http://humanity.ucoz.com ;;;;
;;;; Right Click On A User and click Tic Tac Toe ;;;;
;;;; To pick a sign type /toesign X or O ;;;;
;;;; To accept or decline a game invitation type /toeacc or /toedec ;;;;
dialog tictactoe {
title "Tic Tac Toe"
size -1 -1 100 100
option dbu
icon 1, 1 1 30 20
icon 2, 40 1 30 33
icon 3, 80 1 30 33
icon 4, 1 40 30 33
icon 5, 40 40 30 33
icon 6, 80 40 30 33
icon 7, 1 80 30 33
icon 8, 40 80 30 33
icon 9, 80 80 30 33
box "", 11, 33 1 2 100
box "", 12, 65 1 2 100
text "_____________" 13, 1 20 34 8
text "______________" 14, 34 20 32 8
text "________________" 15, 65 20 34 8
text "_____________" 16, 1 60 34 8
text "______________" 17, 34 60 32 8
text "________________" 18, 65 60 34 8
}
on *:DIALOG:tictactoe:*:*: {
if ($devent == sclick) {
if (%tttoeison) {
if (!%tttmestop) {
if (!$istok(%playedmetttoe,$did,126)) && (!$istok(%playedothertttoe,$did,126)) {
inc %tttoeleft 1
if (%tttoeleft == 10) {
.notice %tttoenick It's A Tie!
endtttoe
}
elseif (%tttoeleft < 10) {
did -g $dname $did $tttsign(%mysign)
set %playedmetttoe $addtok(%playedmetttoe,$did,126)
set $+(%,tttmine,~,$did) 1
.notice %tttoenick Played Tic Tac Toe $did
set %tttmestop 1
if ($($+(%,tttmine,~,1),2)) && ($($+(%,tttmine,~,2),2)) && ($($+(%,tttmine,~,3),2)) {
.notice %tttoenick I Win! YAY!!!!
endtttoe
}
if ($($+(%,tttmine,~,4),2)) && ($($+(%,tttmine,~,5),2)) && ($($+(%,tttmine,~,6),2)) {
.notice %tttoenick I Win! YAY!!!!
endtttoe
}
if ($($+(%,tttmine,~,7),2)) && ($($+(%,tttmine,~,8),2)) && ($($+(%,tttmine,~,9),2)) {
.notice %tttoenick I Win! YAY!!!!
endtttoe
}
if ($($+(%,tttmine,~,1),2)) && ($($+(%,tttmine,~,4),2)) && ($($+(%,tttmine,~,7),2)) {
.notice %tttoenick I Win! YAY!!!!
endtttoe
}
if ($($+(%,tttmine,~,2),2)) && ($($+(%,tttmine,~,5),2)) && ($($+(%,tttmine,~,8),2)) {
.notice %tttoenick I Win! YAY!!!!
endtttoe
}
if ($($+(%,tttmine,~,3),2)) && ($($+(%,tttmine,~,6),2)) && ($($+(%,tttmine,~,9),2)) {
.notice %tttoenick I Win! YAY!!!!
endtttoe
}
if ($($+(%,tttmine,~,1),2)) && ($($+(%,tttmine,~,5),2)) && ($($+(%,tttmine,~,9),2)) {
.notice %tttoenick I Win! YAY!!!!
endtttoe
}
if ($($+(%,tttmine,~,3),2)) && ($($+(%,tttmine,~,5),2)) && ($($+(%,tttmine,~,7),2)) {
.notice %tttoenick I Win! YAY!!!!
endtttoe
}
}
}
}
}
elseif (!%tttoeison) {
echo -at You Can't Play Yet.
}
}
}
on *:notice:*:?: {
if (!%tttoeison) {
if (!%TICTACTOEversion) || (%TICTACTOEversion != v0.1) { set %TICTACTOEversion v0.1 }
if (Wanna Play Tic Tac Toe??? == $strip($1-)) {
set %tttoenick $nick
echo -at $nick Wants To Play Tic Tac Toe With You!
echo -at To Accept Type /toeacc
echo -at To Decline Type /toedec
haltdef
}
if ($nick == %tttoenick) {
if ($strip($1) == !accept) {
set %tttoemestop 1
echo -at $nick Accepted Your Request. To Choose "X" or "O" Type /toesign X or O
echo -at $nick Plays 1st
haltdef
}
elseif ($strip($1) == !decline) {
dialog -x tictactoe
echo -at $nick Declined Your Request.
unset %tttoenick
}
if ($strip($1-3) == I Chose Sign) {
echo -at $nick Chose Sign $strip($4)
haltdef
set %mysign $iif($strip($4) == X, O, X)
set %othersign $strip($4)
set %tttoeison 1
echo -at Your Sign Is Automatically Set To $iif($strip($4) == X, O, X)
haltdef
}
}
}
elseif (%tttoeison) {
if ($strip($1-4) == Played Tic Tac Toe) {
inc %tttoeleft 1
if (%tttoeleft == 10) {
.notice %tttoenick It's A Tie!
endtttoe
}
elseif (%tttoeleft < 10) {
did -g tictactoe $strip($5) $tttsign(%othersign)
unset %tttmestop
set %playedothertttoe $addtok(%playedothertttoe,$strip($5),126)
set $+(%,tttother,~,$strip($5)) 1
if ($($+(%,tttother,~,1),2)) && ($($+(%,tttother,~,2),2)) && ($($+(%,tttother,~,3),2)) {
endtttoe
.notice %tttoenick Good Game!!!
unset %tttoeison
}
if ($($+(%,tttother,~,4),2)) && ($($+(%,tttother,~,5),2)) && ($($+(%,tttother,~,6),2)) {
endtttoe
.notice %tttoenick Good Game!!!
unset %tttoeison
}
if ($($+(%,tttother,~,7),2)) && ($($+(%,tttother,~,8),2)) && ($($+(%,tttother,~,9),2)) {
.notice %tttoenick Good Game!!!
endtttoe
unset %tttoeison
}
if ($($+(%,tttother,~,1),2)) && ($($+(%,tttother,~,4),2)) && ($($+(%,tttother,~,7),2)) {
.notice %tttoenick Good Game!!!
endtttoe
unset %tttoeison
}
if ($($+(%,tttother,~,2),2)) && ($($+(%,tttother,~,5),2)) && ($($+(%,tttother,~,8),2)) {
.notice %tttoenick Good Game!!!
endtttoe
unset %tttoeison
}
if ($($+(%,tttother,~,3),2)) && ($($+(%,tttother,~,6),2)) && ($($+(%,tttother,~,9),2)) {
.notice %tttoenick Good Game!!!
endtttoe
unset %tttoeison
}
if ($($+(%,tttother,~,1),2)) && ($($+(%,tttother,~,5),2)) && ($($+(%,tttother,~,9),2)) {
.notice %tttoenick Good Game!!!
endtttoe
unset %tttoeison
}
if ($($+(%,tttother,~,3),2)) && ($($+(%,tttother,~,5),2)) && ($($+(%,tttother,~,7),2)) {
.notice %tttoenick Good Game!!!
endtttoe
unset %tttoeison
}
}
}
}
}
alias toeacc {
.notice %tttoenick !accept
echo -at Choose "X" or "O" By Typing /toesign X or O
}
alias toedec {
.notice %tttoenick !decline
}
alias toesign {
if ($strip($1) == O) || ($strip($1) == X) {
set %mysign $strip($1)
set %othersign $iif($1 == O, X, O)
set %tttoeison 1
.notice %tttoenick I Chose Sign $strip($1)
dialog -md tictactoe tictactoe
echo -at You Play 1st!!!
}
else {
echo -at $iif($1, $1 Is Not X or O please Input X or O To Continue, Please Input X or O To Continue)
}
}
alias asktoe {
.notice $1 Wanna Play Tic Tac Toe???
}
menu nicklist {
Tic Tac Toe:asktoe $$1 | dialog -md tictactoe tictactoe | set %tttoenick $$1
}
alias tttsign {
return $+(tictactoe,$1,.ico)
}
alias endtttoe {
unset %tttmestop
unset %tttoe*
unset %played*tttoe
unset %mysign
unset %othersign
unset %tttmine*
unset %tttother*
dialog -x tictactoe
}
Or do you want to donate some bucks because you like my scripts??? Visit https://www.paypal.me/OrFeAsGr
Thx! ^_^
https://www.dropbox.com/s/9mhu13wgqj3eu7c/Untitled%2043.mp4?dl=0
i'm not sure about the video quality but i think you'll get the idea...
Click a nickname on the nicklist. (Of course to play with someone he/she needs the script too.)