menu * { 0's and X's:/dialog -md oxstart oxstart } dialog oxstart { title "0's and X's " size -1 -1 180 90 option dbu check "Heads", 1, 52 17 29 10 check "Tails", 2, 24 17 24 10 check "Start", 3, 98 17 26 10 check "Second", 4, 124 17 31 10 button "Flip the coin!", 5, 94 35 65 31, ok cancel box "Which side?", 6, 17 8 67 23 box "First or second?", 7, 93 8 67 23 box "", 8, 6 1 165 71 text "Made by Oliver", 9, 91 75 40 8 button "Close", 10, 46 73 37 12, cancel box "0 or X?", 11, 17 37 67 23 check "0", 12, 24 46 16 10 check "X", 13, 52 46 16 10 } on *:dialog:oxstart:sclick:5,1,2,3,4:{ if ($did == 5) { if ($did($dname,12).state == 1) { set %icon 0 set %iconcomp X } else { set %icon X set %iconcomp 0 } if ($did($dname,1).state == 1) { set %side heads } else { set %side tails } if ($did($dname,3).state == 1) { set %start start } else { set %start second } /dialog -md winlosetoss winlosetoss set %rand $rand(1,2) if (%rand == 1) { set %answer win } else { set %answer lose if (%icon == 0) { set %icon X set %iconcomp 0 } else { set %icon 0 set %iconcomp X } if (%side == heads) { set %side tails } else { set %side heads } if (%start == start) { set %start second } else { set %start start } } } elseif ($did == 1) { /did -u oxstart 2 } elseif ($did == 2) { /did -u oxstart 1 } elseif ($did == 3) { /did -u oxstart 4 } elseif ($did == 4) { /did -u oxstart 3 } } on *:dialog:oxstart:sclick:12:{ /did -u oxstart 13 } on *:dialog:oxstart:sclick:13:{ /did -u oxstart 12 } dialog winlosetoss { title "0's and X's" size -1 -1 120 68 option dbu text "", 1, 26 11 67 8 text "", 2, 48 28 0 8 box "", 3, 5 2 110 53 text "Made by Oliver", 4, 43 57 38 8 button "Start", 5, 21 38 38 13, ok cancel button "Close", 6, 62 38 38 13, cancel } on *:dialog:winlosetoss:init:*:{ if (%answer == win) { set %turn me /did -ar winlosetoss 1 You have WON the toss! } else { set %turn comp /did -ar winlosetoss 1 You have LOST the toss :( } } on *:dialog:winlosetoss:sclick:5:{ /dialog -md oxmain oxmain } dialog oxmain { title "0's and X's" size -1 -1 189 200 option dbu box "", 10, 6 4 176 172 edit "", 11, 60 182 70 10 text "Made by Oliver", 12, 135 183 40 8 button "Close", 9, 14 181 37 12, cancel icon 13, 16 14 46 46 icon 1, 70 14 46 46 icon 2, 124 14 46 46 icon 3, 16 67 46 46 icon 4, 70 67 46 46 icon 5, 124 67 46 46 icon 6, 16 121 46 46 icon 7, 70 121 46 46 icon 8, 124 121 46 46 box "", 14, 66 10 2 160 box "", 15, 120 10 2 160 box "", 16, 13 60 162 5 box "", 17, 13 114 162 5 } on *:dialog:oxmain:init:*:{ /did -m oxmain 11 /did -g oxmain 13,1,2,3,4,5,6,7,8 "C:\Program Files\mIRC\0's and X's\blank.bmp" if (%turn == me) { /write -c squares.txt /did -ar oxmain 11 Your Turn! write squares.txt 1 write squares.txt 2 write squares.txt 3 write squares.txt 4 write squares.txt 5 write squares.txt 6 write squares.txt 7 write squares.txt 8 write squares.txt 9 } elseif (%turn == comp) { /did -ar oxmain 11 Computer's Turn /write -c squares.txt write squares.txt 1 write squares.txt 2 write squares.txt 3 write squares.txt 4 write squares.txt 5 write squares.txt 6 write squares.txt 7 write squares.txt 8 write squares.txt 9 set %rand2 $rand(1, $+ $lines(squares.txt)) if ($read(squares.txt,%rand2)) && (%rand2 isnum) { if (%rand2 == 1) { /did -g oxmain 13 "C:\Program Files\mIRC\0's and X's\ $+ %iconcomp $+ .bmp" } elseif (%rand2 == 2) { /did -g oxmain 1 "C:\Program Files\mIRC\0's and X's\ $+ %iconcomp $+ .bmp" } elseif (%rand2 == 3) { /did -g oxmain 2 "C:\Program Files\mIRC\0's and X's\ $+ %iconcomp $+ .bmp" } elseif (%rand2 == 4) { /did -g oxmain 3 "C:\Program Files\mIRC\0's and X's\ $+ %iconcomp $+ .bmp" } elseif (%rand2 == 5) { /did -g oxmain 4 "C:\Program Files\mIRC\0's and X's\ $+ %iconcomp $+ .bmp" } elseif (%rand2 == 6) { /did -g oxmain 5 "C:\Program Files\mIRC\0's and X's\ $+ %iconcomp $+ .bmp" } elseif (%rand2 == 7) { /did -g oxmain 6 "C:\Program Files\mIRC\0's and X's\ $+ %iconcomp $+ .bmp" } elseif (%rand2 == 8) { /did -g oxmain 7 "C:\Program Files\mIRC\0's and X's\ $+ %iconcomp $+ .bmp" } elseif (%rand2 == 9) { /did -g oxmain 8 "C:\Program Files\mIRC\0's and X's\ $+ %iconcomp $+ .bmp" } set %turn me /write -ds $+ %rand2 squares.txt /did -ar oxmain 11 Your Turn! /write -dl $+ $calc($lines(squares.txt) + 1) squares.txt } else { /comp } } } alias comp { set %temp $lines(squares.txt) /did -ar oxmain 11 Computer's Turn set %rand2 $rand(1,%temp) if ($read(squares.txt,%rand2)) && (%rand2 isnum) { if (%rand2 == 1) { /did -g oxmain 13 "C:\Program Files\mIRC\0's and X's\ $+ %iconcomp $+ .bmp" | /wincheck 13 computer } elseif (%rand2 == 2) { /did -g oxmain 1 "C:\Program Files\mIRC\0's and X's\ $+ %iconcomp $+ .bmp" | /wincheck 1 computer } elseif (%rand2 == 3) { /did -g oxmain 2 "C:\Program Files\mIRC\0's and X's\ $+ %iconcomp $+ .bmp" | /wincheck 2 computer } elseif (%rand2 == 4) { /did -g oxmain 3 "C:\Program Files\mIRC\0's and X's\ $+ %iconcomp $+ .bmp" | /wincheck 3 computer } elseif (%rand2 == 5) { /did -g oxmain 4 "C:\Program Files\mIRC\0's and X's\ $+ %iconcomp $+ .bmp" | /wincheck 4 computer } elseif (%rand2 == 6) { /did -g oxmain 5 "C:\Program Files\mIRC\0's and X's\ $+ %iconcomp $+ .bmp" | /wincheck 5 computer } elseif (%rand2 == 7) { /did -g oxmain 6 "C:\Program Files\mIRC\0's and X's\ $+ %iconcomp $+ .bmp" | /wincheck 6 computer } elseif (%rand2 == 8) { /did -g oxmain 7 "C:\Program Files\mIRC\0's and X's\ $+ %iconcomp $+ .bmp" | /wincheck 7 computer } elseif (%rand2 == 9) { /did -g oxmain 8 "C:\Program Files\mIRC\0's and X's\ $+ %iconcomp $+ .bmp" | /wincheck 8 computer } set %turn me /did -ar oxmain 11 Your Turn! /write -ds $+ %rand2 squares.txt /write -dl $+ $calc($lines(squares.txt) + 1) squares.txt } else { /comp } } alias wincheck { if ($2 == computer) { set %checkicon %iconcomp set %resultperson computer } else { set %checkicon %icon set %resultperson me } if ($1 == 13) { if (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,1)) && (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,2)) { set %result win /dialog -md youwinlose youwinlose .timer 1 3 /dialog -x oxmain oxmain } elseif (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,3)) && (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,6)) { set %result win /dialog -md youwinlose youwinlose .timer 1 3 /dialog -x oxmain oxmain } elseif (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,4)) && (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,8)) { set %result win /dialog -md youwinlose youwinlose .timer 1 3 /dialog -x oxmain oxmain } } elseif ($1 == 1) { if (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,13)) && (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,2)) { set %result win /dialog -md youwinlose youwinlose .timer 1 3 /dialog -x oxmain oxmain } elseif (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,4)) && (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,7)) { set %result win /dialog -md youwinlose youwinlose .timer 1 3 /dialog -x oxmain oxmain } } elseif ($1 == 2) { if (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,1)) && (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,13)) { set %result win /dialog -md youwinlose youwinlose .timer 1 3 /dialog -x oxmain oxmain } elseif (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,5)) && (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,8)) { set %result win /dialog -md youwinlose youwinlose .timer 1 3 /dialog -x oxmain oxmain } elseif (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,4)) && (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,6)) { set %result win /dialog -md youwinlose youwinlose .timer 1 3 /dialog -x oxmain oxmain } } elseif ($1 == 3) { if (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,13)) && (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,6)) { set %result win /dialog -md youwinlose youwinlose .timer 1 3 /dialog -x oxmain oxmain } elseif (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,4)) && (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,5)) { set %result win /dialog -md youwinlose youwinlose .timer 1 3 /dialog -x oxmain oxmain } } elseif ($1 == 4) { if (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,13)) && (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,8)) { set %result win /dialog -md youwinlose youwinlose .timer 1 3 /dialog -x oxmain oxmain } elseif (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,3)) && (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,5)) { set %result win /dialog -md youwinlose youwinlose .timer 1 3 /dialog -x oxmain oxmain } elseif (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,6)) && (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,2)) { set %result win /dialog -md youwinlose youwinlose .timer 1 3 /dialog -x oxmain oxmain } } elseif ($1 == 5) { if (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,2)) && (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,8)) { set %result win /dialog -md youwinlose youwinlose .timer 1 3 /dialog -x oxmain oxmain } elseif (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,4)) && (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,3)) { set %result win /dialog -md youwinlose youwinlose .timer 1 3 /dialog -x oxmain oxmain } } elseif ($1 == 6) { if (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,3)) && (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,13)) { set %result win /dialog -md youwinlose youwinlose .timer 1 3 /dialog -x oxmain oxmain } elseif (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,4)) && (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,2)) { set %result win /dialog -md youwinlose youwinlose .timer 1 3 /dialog -x oxmain oxmain } elseif (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,7)) && (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,8)) { set %result win /dialog -md youwinlose youwinlose .timer 1 3 /dialog -x oxmain oxmain } } elseif ($1 == 7) { if (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,2)) && (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,4)) { set %result win /dialog -md youwinlose youwinlose .timer 1 3 /dialog -x oxmain oxmain } elseif (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,6)) && (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,8)) { set %result win /dialog -md youwinlose youwinlose .timer 1 3 /dialog -x oxmain oxmain } } elseif ($1 == 8) { if (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,5)) && (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,2)) { set %result win /dialog -md youwinlose youwinlose .timer 1 3 /dialog -x oxmain oxmain } elseif (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,7)) && (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,6)) { set %result win /dialog -md youwinlose youwinlose .timer 1 3 /dialog -x oxmain oxmain } elseif (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,4)) && (*C:\Program Files\mIRC\0's and X's\ $+ %checkicon $+ .bmp* iswm $did(oxmain,13)) { set %result win /dialog -md youwinlose youwinlose .timer 1 3 /dialog -x oxmain oxmain } } } on *:dialog:oxmain:sclick:13,1,2,3,4,5,6,7,8:{ if (%turn == me) { if ($did(oxmain,$did) == 0 C:\Program Files\mIRC\0's and X's\blank.bmp) { /did -g oxmain $did "C:\Program Files\mIRC\0's and X's\ $+ %icon $+ .bmp" if ($did == 13) { /write -ds $+ 1 squares.txt /wincheck 13 me } elseif ($did == 1) { /write -ds $+ 2 squares.txt | /wincheck 1 me } elseif ($did == 2) { /write -ds $+ 3 squares.txt | /wincheck 2 me } elseif ($did == 3) { /write -ds $+ 4 squares.txt | /wincheck 3 me } elseif ($did == 4) { /write -ds $+ 5 squares.txt | /wincheck 4 me } elseif ($did == 5) { /write -ds $+ 6 squares.txt | /wincheck 5 me } elseif ($did == 6) { /write -ds $+ 7 squares.txt | /wincheck 6 me } elseif ($did == 7) { /write -ds $+ 8 squares.txt | /wincheck 7 me } elseif ($did == 8) { /write -ds $+ 9 squares.txt | /wincheck 8 me } set %turn comp /write -dl $+ $lines(squares.txt) squares.txt .timer 1 1 /comp /did -ar oxmain 11 Computer's Turn } } } dialog youwinlose { title "0's and X's" size -1 -1 113 60 option dbu text "", 1, 16 13 82 8 button "New Game!", 2, 16 29 37 12, ok cancel button "Close", 3, 61 29 37 12, cancel box "", 4, 7 5 100 42 text "Made by Oliver", 5, 39 49 38 8 } on *:dialog:youwinlose:init:*:{ if (%resultperson == me) { /did -ar youwinlose 1 Congratualtions you've WON!! } else { /did -ar youwinlose 1 Oh dear you lost :( } } on *:dialog:youwinlose:sclick:2:{ /dialog -ms oxstart oxstart }