/***************************************************************************
*        ______ _______ ______ ______    _______ ______  ______ __  __     *
*       / __  //__  __// __  // __  /   /__  __// __  / / ____// / / /     *
*      ( ( /_/   / /  / /_/ // /_/ /      / /  / /_/ / / /__  / //¯/¯      *
*     __\_\_    / /  / __  //   __/      / /  /   __/ / __ / /  ¯/¯        *
*    / /_/ /   / /  / / / // /\ \       / /  / /\ \  / /___ / /\ \         *
*   /_____/   /_/  /_/ /_//_/  \_\     /_/  /_/  \_\/_____//_/  \_\        *
*                                                                          *
*                              COOKIE V 2.1                                *
*                                                                          *
*                    © 1994 By FRaNKy / Purple Turtle                      *
*                                                                          *
****************************************************************************
*                                                                          *
*                         This door is Postcardware !                      *
*                                                                          *
*     If you use it, sent a postcard of the area/town you live in to :     *
*        (I would like you to do this, since it will cost you shit)        *
*                                                                          *
*                            Smets P.                                      *
*                            Weldadigheidsstraat 45                        *
*                            3000 Leuven                                   *
*                            Belgium                                       *
*                                                                          *
*            You can also contact me on FidoNet : 2:292/603.8              *
*                                                                          *
*   You can try to contact me in these Star Trek Areas : Startrek.028      *
*                                                        Trek.UK           *
*                                                                          *
***************************************************************************/

parse arg node; options results; nodeid = "AERexxControl"node; address value nodeid
signal on syntax; signal on ioerr
bufferflush
MAX  = 99
tr = transmit   ;  hk = getchar ;  pm = prompt  ;  sendstring = sendmessage
ss = sendstring ;  gu = getuser ;  pu = putuser
NUL  = '0'X
OFF  = '[0m'
CLS  = D2C(12) || OFF
CR   = D2C(10)
TAB  = D2C(9)
RED='[31m';  GRN ='[32m'; YEL='[33m'; BLU='[34m'
MAG='[35m'; CYN='[36m';  REDYEL='[41;33m'; WHTRED='[47;31m';

TIME             = 144

/* Let's Go */

Start:
tr " "
tr MAG".-----------------------------------------------------------------------------."
tr MAG"|            "YEL"Star Trek Cookie v 2.1 © 1994 FRaNKy / Purple Turtle             "MAG"|"
tr MAG"`-----------------------------------------------------------------------------'"

ab=0
tel=-1
A=TIME('s')
b = value('a')
x= right(b,2)
xx=left(right(b,3),1)
if x>max then x=x-max
if ~exists('Doors:STCookie/Biscuit'xx) then call Buggy
call open('Bisc','Doors:STCookie/Biscuit'xx,'read')
do until eof('Bisc')
   tel=tel+1
   Bisca=readln('Bisc')
   if tel=x then do
      lang=(80-length(bisca))/2
      spatie=""
      do while ab < lang
        spatie = spatie || " "
        ab=ab+1
      end
      lijn = spatie||bisca
   end
end
tr CYN""lijn""cr
call dexit

Buggy:

tr ""
tr WHTRED"Couldn't Locate Cookie File Nr."xx" (Doors:STCookie/Biscuit"xx")"
tr ""
call dexit


/*==========================================================================*/
IOERR: tr "I/O Error: Missing File/Directory"
ERROR:
SYNTAX: tr "Error in Line.. #"sigl" Exiting.." ; tr errortext(sigl)

/*==========================================================================*/

DExit: bufferflush ; ShutDown ; Exit

prompt: procedure ; parse arg message,length ; RECEIVE length ; QUERY message ; return result
putvar: procedure ; parse arg string1,string2 ; PUTUSTR string1 ; PUTUSER string2 ; return 0
getvar: procedure ; parse arg string1 ; getuser string1 ; return result
