/* CrTicTacFoozle originally by PSR Software (©1993 for Spot) updated by
   David Lascelles, Creepy Productions - 2:256/503.0
   $VER: CrTicTacFoozle v1.0 (10.06.95)
   I have decided to leave this file open for inspection, please do not
change anything below the line if it works, and if you do change to
produce what you consider a better result, please forward it to me. :)
*/

parse arg AREA NUMBER FRoM FRoM2 NAME NAME2

/*change!*/

origin="Call Creepys BBS - 0191 3832181 - for Foozle and TA support!"

add="2:256/503"
TEMPDIR='T:'     /*Temp Directory*/
EDITCMD='c:ed'   /* editor to use! if C='s ed then -sticky!*/



/* Do not change, except for personal use - or return to author.*/

Do y=1 To 4
Do x=1 To 3
PoS.x.y=' '
end
end
from=from||" "||from2
name=name||""||name2
addlib('rexxreqtools.library',0,-30)
NL='0a'x
addlib("rexxsupport.library",0,-30)
addlib("rexxarplib.library",0,-30,0)
de=Area"/"number".msg"
begin:
ret=rtezrequest("Scan Message ?!?","S_can|_Start|_Info","There is only one thing better than Info - and you're too young!","rt_pubscrname=FOOZLE rt_reqpos=reqpos_centerscr rt_font=bronze.font/70")
if ret=1 then do;signal ddw;end
if ret=2 then signal David
if ret=0 then call INFo
ddw:


call open(msg,de,"R")
all=readch(msg,65535)
From=substr(all,1,36)
To=substr(all,37,36)
Subj=substr(all,73,72)
Date=substr(all,145,20)
Dest=substr(all,167,2)
orig=substr(all,169,2)
Mess=substr(all,216)
From=strip(from,'t','00'x)
To=strip(to,'t','00'x)
Subj=strip(subj,'t','00'x)
Date=strip(date,'t','00'x)
orig=strip(orig,'t','00'x)
do i=1 to length(mess)
x=substr(mess,i,1)
if x='00'x then iterate
if x='0d'x then x='0a'x
call open(nm,TEMPDIR'TicTacFooz.temp',"w")
call writech(nm,x)
end
call close(msg)
call close(nm)
dedew:
call open(nm,TEMPDIR'TicTacFooz.temp',"r")
Do y=1 To 4
Do x=1 To 3
PoS.x.y=' '
End
End
Do Until Pos('* TicTacSpot',LINE)>0
If Eof(nm) Then Do
retqw=rtezrequest("Message contains no TicTacFoozle data!","_Quit|_Start New","You needed a FX430303 Scanner with a banana to do that ;).","rt_pubscrname=FOOZLE rt_reqpos=reqpos_centerscr rt_font=mfast.font/20")
if retqw=0 then do
Call Close(nm)
Signal David
End
Exit
end
If Exists('Ram:Plop') then Exit
LINE=ReadLn(nm)
End
Call Readln(nm)
LINE.1=Readln(nm)
Call Readln(nm)
Call Readln(nm)
LINE.2=Readln(nm)
Call Readln(nm)
Call Readln(nm)
LINE.3=Readln(nm)
deded=readln(nm)
edwdkwdokwk=readln(nm)
piece=readch(nm)
if piece="o" then pw="x"
if piece="x" then pw="o"
Call Close(nm)
piece=pw
Do y=1 To 3
Parse var LINE.y PoS1' | 'PoS2' | 'PoS3
PoS1=Right(PoS1,2)
PoS2=Left(PoS2,2)
PoS3=Left(PoS3,2)
If PoS1='/\' Then PoS.1.y='o'
If PoS1='\/' Then PoS.1.y='x'
If PoS2='/\' Then PoS.2.y='o'
If PoS2='\/' Then PoS.2.y='x'
If PoS3='/\' Then PoS.3.y='o'
If PoS3='\/' Then PoS.3.y='x'
End
signal playmove
david:
from=rtgetstring("","Enter name of person to play with ??","Who are you going to play with today ? (Not *HIM*)!","_Done","rt_pubscrname=FOOZLE rt_reqpos=reqpos_centerscr rt_font=brats.font/16",RCDE)
if upper(piece)="X" then signal ed
if upper(piece)="O" then signal ed
PlayMove:
if upper(piece)="X" then signal ed
if upper(piece)="O" then signal ed
retox=rtezrequest("Will you be Os or Xs?","_O|_X","Hard descision - the round one or the non-round one ?","rt_pubscrname=FOOZLE rt_reqpos=reqpos_centerscr rt_font=chex.font/26",RCDA)
If retox=0 Then PIECE='x'
If retox=1 Then PIECE='o'
call bob                                                                                             
ed:
reatox=rtezrequest("In case you forgot, you are '"upper(piece)"'s","cool!","Bad memory ?","rt_pubscrname=FOOZLE rt_reqpos=reqpos_centerscr rt_font=emerald.font/17",RCDAA)
bob:
done=0
Do Until DoNE=1
board=""upper(pos.1.1)" + "upper(pos.2.1)" + "upper(pos.3.1)" "
board2="++++++++++"
board3=""upper(pos.1.2)" + "upper(pos.2.2)" + "upper(pos.3.2)" "
board4="++++++++++"
board5=""upper(pos.1.3)" + "upper(pos.2.3)" + "upper(pos.3.3)" "
                                  
retawq=rtezrequest("Row 1  =  "board"    You are now on the top"||NL||,
                    "          "board2"    row, select where to"||NL||,
                    "Row 2  =  "board3"    place  piece or click"||NL||,
                    "          "board4"    on Middle Row to go  "||NL||,                   
                    "Row 3  =  "board5"    to the middle row. :)"||NL||NL||,
                    "Click on Big for the large tactics screen! ;)"||NL||,
                    "","_Left|_Mid|_Right|M_iddle Row|_Big|_Exit","The high chain of command informs you that this is the top row!","rt_pubscrname=FOOZLE rt_reqpos=reqpos_centerscr rt_font=ruby.font/15",DW)

if retawq=1 Then If PoS.1.1='x'|Pos.1.1='o' then do;call exista;signal bob;end
If retawq=1 Then do;If PoS.1.1=' ' Then DoNE=1;PoS.1.1=PIECE;signal ced;End
if retawq=2 Then If PoS.2.1='x'|Pos.2.1='o' then do;call exista;signal bob;end
IF retawq=2 Then If PoS.2.1=' ' Then Do;DoNE=1;PoS.2.1=PIECE;signal ced;End
if retawq=3 Then If PoS.3.1='x'|Pos.3.1='o' then do;call exista;signal bob;end
If retawq=3 Then If PoS.3.1=' ' Then Do;DoNE=1;pos.3.1=piece;signal ced;End
if retawq=5 then call big
if retawq=0 then exit 0
reta=rtezrequest("Row 1 = "board"    You are now in the middle"||NL||,
                    "        "board2"    row, select where to"||NL||,
                    "Row 2 = "board3"    place piece or click"||NL||,
                    "        "board4"    on Bottom Row to go :( "||NL||,                   
                    "Row 3 = "board5"    to the Bottom row :) "||NL||NL||,
                    "BIG will display a rather large board indeed!"||NL||,
                    "","_Left|_Mid|_Right|_Bottom Row|Bi_g|_Exit","Oi you! What you doing in the middle row, trying to cheat eh ? ","rt_pubscrname=FOOZLE rt_reqpos=reqpos_centerscr rt_font=ruby.font/15",DWSQ)
if reta=0 then exit 0
if reta=5 then call big
if reta=1 Then If PoS.1.2='x'|Pos.1.2='o' Then do;call exista;signal bob;end
If reta=1 Then If PoS.1.2=' ' Then Do;DoNE=1;PoS.1.2=PIECE;signal ced;End
if reta=2 Then If PoS.2.2='x'|Pos.2.2='o' then do;call exista;signal bob;end
If reta=2 Then If PoS.2.2=' ' Then Do;DoNE=1;PoS.2.2=PIECE;signal ced;End
say pos.3.1
if reta=3 Then If PoS.3.2='x'|Pos.3.2='o' then do;call exista;signal bob;end
If reta=3 Then If PoS.3.2=' ' Then Do;DoNE=1;PoS.3.2=PIECE;signal ced;End
retw=rtezrequest("Row 1 = "board"    You are now on the Bottom"||NL||,
                    "        "board2"    row, select where to"||NL||,
                    "Row 2 = "board3"    place piece or click"||NL||,
                    "        "board4"    on exit to go to back "||NL||,                   
                    "Row 3 = "board5"    to foozle."||NL||NL||,
                    "This time BIG will display the same as before!"||NL||,
                    "","_Left|_Mid|_Right|_Big|_Top Row!!|_Exit","lowest of the low, scum of the earth - well the bottom row!","rt_pubscrname=FOOZLE rt_reqpos=reqpos_centerscr rt_font=ruby.font/15",DWSA)


If retw=0 Then exit 0
if retw=4 then call big
if retw=1 Then If PoS.1.3='x'|Pos.1.3='o' then do;call exista;signal bob;end
If retw=1 Then If PoS.1.3=' ' Then Do;DoNE=1;PoS.1.3=PIECE;signal ced;End
if retw=2 Then If PoS.2.3='x'|Pos.2.3='o' then do;call exista;signal bob;end
If retw=2 Then If PoS.2.3=' ' Then Do;DoNE=1;PoS.2.3=PIECE;signal ced;End
if retw=3 Then If PoS.3.3='x'|Pos.3.3='o' then do;call exista;signal bob;end
If retw=3 Then If PoS.3.3=' ' Then Do;DoNE=1;PoS.3.3=PIECE;signal ced;End
if retw=5 then signal bob
End
End
End
ced:
Call open('oup',TEMPDIR'TicTacFooza.temp','w')
LINE1=' >  '
LINE2=' >  '
LINE3=' >  '
LINE4=' >  '
LINE5=' >  '
LINE6=' >  '
If PoS.1.1='x' Then Do
LINE1=LINE1||'\/ |'
LINE2=LINE2||'/\ |'
End
If PoS.1.1=' ' Then Do
LINE1=LINE1||'   |'
LINE2=LINE2||'   |'
End
If PoS.1.1='o' Then Do
LINE1=LINE1||'/\ |'
LINE2=LINE2||'\/ |'
End
If PoS.2.1='x' Then Do
LINE1=LINE1||' \/ |'
LINE2=LINE2||' /\ |'
End
If PoS.2.1='o' Then Do
LINE1=LINE1||' /\ |'
LINE2=LINE2||' \/ |'
End
If PoS.2.1=' ' Then Do
LINE1=LINE1||'    |'
LINE2=LINE2||'    |'
End
If PoS.3.1='x' Then Do
LINE1=LINE1||' \/'
LINE2=LINE2||' /\'
End
If PoS.3.1='o' Then Do
LINE1=LINE1||' /\'
LINE2=LINE2||' \/'
End
If PoS.3.1=' ' Then Do
LINE1=LINE1||'   '
LINE2=LINE2||'   '
End
If PoS.1.2='x' Then Do
LINE3=LINE3||'\/ |'
LINE4=LINE4||'/\ |'
End
If PoS.1.2='o' Then Do
LINE3=LINE3||'/\ |'
LINE4=LINE4||'\/ |'
End
If PoS.1.2=' ' Then Do
LINE3=LINE3||'   |'
LINE4=LINE4||'   |'
End
If PoS.2.2='x' Then Do
LINE3=LINE3||' \/ |'
LINE4=LINE4||' /\ |'
End
If PoS.2.2='o' Then Do
LINE3=LINE3||' /\ |'
LINE4=LINE4||' \/ |'
End
If PoS.2.2=' ' Then Do
LINE3=LINE3||'    |'
LINE4=LINE4||'    |'
End
If PoS.3.2='x' Then Do
LINE3=LINE3||' \/'
LINE4=LINE4||' /\'
End
If PoS.3.2='o' Then Do
LINE3=LINE3||' /\'
LINE4=LINE4||' \/'
End
If PoS.3.2=' ' Then Do
LINE3=LINE3||'   '
LINE4=LINE4||'   '
End
If PoS.1.3='x' Then Do
LINE5=LINE5||'\/ |'
LINE6=LINE6||'/\ |'
End
If PoS.1.3='o' Then Do
LINE5=LINE5||'/\ |'
LINE6=LINE6||'\/ |'
End
If PoS.1.3=' ' Then Do
LINE5=LINE5||'   |'
LINE6=LINE6||'   |'
End
If PoS.2.3='x' Then Do
LINE5=LINE5||' \/ |'
LINE6=LINE6||' /\ |'
End
If PoS.2.3='o' Then Do
LINE5=LINE5||' /\ |'
LINE6=LINE6||' \/ |'
End
If PoS.2.3=' ' Then Do
LINE5=LINE5||'    |'
LINE6=LINE6||'    |'
End
If PoS.3.3='x' Then Do
LINE5=LINE5||' \/'
LINE6=LINE6||' /\'
End
If PoS.3.3='o' Then Do
LINE5=LINE5||' /\'
LINE6=LINE6||' \/'
End
If PoS.3.3=' ' Then Do
LINE5=LINE5||'   '
LINE6=LINE6||'   '
End
Call Writeln('oup',' ')
Call Writeln('oup',' > * TicTacSpot v2.0 Updated By Creepy (Foozle Version)')
Call Writeln('oup',' >')
Call Writeln('oup',LINE1)
Call Writeln('oup',LINE2)
Call Writeln('oup',' > ----+----+----')
Call Writeln('oup',LINE3)
Call Writeln('oup',LINE4)
Call Writeln('oup',' > ----+----+----')
Call Writeln('oup',LINE5)
Call Writeln('oup',LINE6)
Call Writeln('oup',' ')
Call Writeln('oup',piece)
Call Close('oup')
origino=""""origin""""
from=""""from""""
name=""""name""""
area=""""area""""
add=""""add""""
rte=rtezrequest("Do you want to edit the message ?","_Yes|_No","Edit Message or eat it ?","rt_pubscrname=FOOZLE rt_reqpos=reqpos_centerscr rt_font=sapphire.font/19")
if rte=1 then address command editcmd" "tempdir"tictacFooza.temp"
address command "c:brun MAKEMAIL oRIGIN "origino" dir "AREA" subject  TicTacFoozle  FRoM "name" To "from" FRoMADR "ADD" FILE "tempdir"TicTacFooza.temp"
address command "delete "tempdir"TicTacFooza.temp"                                                                                   
exit 0                                           
                                           
exista:
retaa=rtezrequest("Sorry - Piece already there","_Return","And where is the brain today!!","rt_pubscrname=FOOZLE rt_reqpos=reqpos_centerscr rt_font=coop.font/24",re)
return

INFo:

retaa=rtezrequest("Welcome to Creepys TicTacToe whether you be a foozle owner    "||NL||,
       "or a spot one, I salute you ;) I hope you like this script  "||NL||,
       "as it took three of us a while to write (the other two being "||NL||,
       "Paul and John, who were respectivly responsible for the    "||NL||,
       "original code and for the message reading part in the Foozle  "||NL||,                                                                                    
       "code.) I also hope you like this new GUI interface and only   "||NL||,                                                                                    
       "appologise for the amount of fonts you had to download to    "||NL||,
       "use it! If you want a chat or just grab some files, then    "||NL||,
       "why not logon to Creepys Amiga BBS - +44(0)191 3832181 24Hrs  "||NL||,
       "its well worth a vist! Also if you use this proggy I would "||NL||,
       "be grateful for a hello note to one of the addresses below!    "||NL||,
       "okay dokay - Bye For Now!                    "||NL||,
       "                                                               "||NL||,
       "          ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿            "||NL||,
       "          ³ Regards, ÚÄ ÚÄ     ³ ³  2:256/503.0   ³            "||NL||,
       "          ³  ÚÄÄ Ú¿  ÃÄ ÃÄ ÚÄ¿ ÀÂÙ  69:101/11.0   ³            "||NL||,
       "          ³  ÀÄÄ ÃÁ¿ ÀÄ ÀÄ ÃÄÙ  ³   240:360/306   ³            "||NL||,
       "          ³                ³    ³   39:131/11.0   ³            "||NL||,
       "          ³ David.Lascelles@Creepys.nemesis.co.uk ³            "||NL||,
       "          ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ            ","And back please!|Can I see it again!","Creepys Amazing Info!","rt_pubscrname=FOOZLE rt_reqpos=reqpos_centerscr rt_font=cleanibm.font/8",re)
                                 
if retaa=1 then call begin
if retaa=0 then call info       

exit 0

big:
do g=1 to 3
do f=1 to 3
say g.f.1
if pos.g.f="o" then do
de.g.f.1=" oooo "
de.g.f.2="o    o"
de.g.f.3="o    o"
de.g.f.4=" oooo "
end
if pos.g.f="x" then do
de.g.f.1="\   / "
de.g.f.2=" \_/  "
de.g.f.3=" / \  "
de.g.f.4="/   \ "
end
if pos.g.f=' ' then do
de.g.f.1="      "
de.g.f.2="      "
de.g.f.3="      "
de.g.f.4="      "
end
end
end
board.1="                        #####          #####         "                       
board.2="               "de.1.1.1"   #####  "de.2.1.1"  #####  "de.3.1.1"           "
board.3="               "de.1.1.2"   #####  "de.2.1.2"  #####  "de.3.1.2"           "
board.4="               "de.1.1.3"   #####  "de.2.1.3"  #####  "de.3.1.3"           "
board.5="               "de.1.1.4"   #####  "de.2.1.4"  #####  "de.3.1.4"           "
board.6="                        #####          #####             "
board.7="            ###########################################   "
board.8="            ###########################################   "
board.9="                        #####          #####         "                       
board.10="               "de.1.2.1"   #####  "de.2.2.1"  #####  "de.1.3.1"           "
board.11="               "de.1.2.2"   #####  "de.2.2.2"  #####  "de.1.3.2"           "
board.12="               "de.1.2.3"   #####  "de.2.2.3"  #####  "de.1.3.3"           "
board.13="               "de.1.2.4"   #####  "de.2.2.4"  #####  "de.1.3.4"           "
board.14="                        #####          #####             "
board.15="            ###########################################   "
board.16="            ###########################################   "
board.17="                        #####          #####         "                       
board.18="               "de.1.3.1"   #####  "de.2.3.1"  #####  "de.3.3.1"           "
board.19="               "de.1.3.2"   #####  "de.2.3.2"  #####  "de.3.3.2"           "
board.20="               "de.1.3.3"   #####  "de.2.3.3"  #####  "de.3.3.3"           "
board.21="               "de.1.3.4"   #####  "de.2.3.4"  #####  "de.3.3.4"           "
board.22="                        #####          #####             "

fr=rtezrequest(""board.1||NL||,
               ""board.2||NL||,
               ""board.3||NL||,
               ""board.4||NL||,
               ""board.5||NL||,
               ""board.6||NL||,
               ""board.7||NL||,
               ""board.8||NL||,
               ""board.9||NL||,
               ""board.10||NL||,
               ""board.11||NL||,
               ""board.12||NL||,
               ""board.13||NL||,
               ""board.14||NL||,
               ""board.15||NL||,
               ""board.16||NL||,
               ""board.17||NL||,
               ""board.18||NL||,
               ""board.19||NL||,
               ""board.20||NL||,
               ""board.21||NL||,
               ""board.22||NL||,
               ""||NL||,
               ""||NL||,
               "","_Sooooo!|_What|_Tactics|_Are|_You|_Going|_To|_Employ ?","Nice screen dork ;)","rt_pubscrname=FOOZLE rt_reqpos=reqpos_centerscr rt_font=cleanibm.font/8")

call bob