@echo off
dtr on
at h1
if exist d:\start.flg start
if z%1 == zstart goto start
:begin
   cls
   echo               RunRA.Bat    - Boot Factory BBS
   echo                              FidoNET 1:264/19
   echo.
   echo                              Last Update:  16 Sep 90
   echo.


          cdd D:\qbbs
          tm /l >> d:\system.log
          echo *** Loading RA Mailer Shell *** >> d:\system.log

          qbsquote d:\qbbs\text\logoff
         :start
          if exist d:\seadog\file\nodediff.* call svc nodediff
          if exist d:\seadog\file\fnews*.* call svc fidonews
          if exist d:\xlat\nodediff.* call svc xlat
          if exist d:\seadog\file\*.tic call svc tick
          if exist d:\seadog\file\al.zip call svc importal
          if not exist d:\qmx\7443????.* goto skip_xrs
          copy d:\qmx\7443????.* d:\seadog\file
          del d:\qmx\7443????.*
          call svc toss

         :skip_xrs
          skip 2
          tm /l
          ramfree
          echo Loading RA and shelling to FD
          cdd d:\qbbs
          ra -m\fd\fd.exe*M -E20
          goto after_quick

         :after_msg
          ra -R -L -E20

         :after_quick
          if errorlevel 210 goto scanecho
          if errorlevel 200 goto tossnet
          if errorlevel 190 goto unpackmail
          if errorlevel 111 goto arcmail
          if errorlevel 102 goto qmx
          if errorlevel 101 goto validoor
          if errorlevel 100 goto localbbs
          if errorlevel  90 goto remote
          if errorlevel  73 boot
          if errorlevel  72 goto makenl
          if errorlevel  71 goto filedoor
          if errorlevel  49 goto Cleanup
          if errorlevel  48 goto weekend
          if errorlevel  20 goto begin
          if errorlevel  16 goto fossil
          if errorlevel  15 goto modeminit
          if errorlevel  14 goto modemresp
          if errorlevel  13 goto fulldisk
          if errorlevel  12 goto external
          if errorlevel  11 goto internal
          if errorlevel  10 goto end
          if errorlevel   5 goto net&echo
          if errorlevel   4 goto echo_only
          if errorlevel   3 goto net_only
          goto start


         :Localbbs
          cdd d:\qbbs
          ra -L -E20
          goto After_quick

         :remote
          xu watchcd:0:ON
          ctty com1
          4dos
          echo Returning to Remote Access
          ctty con
          cdd d:\qbbs
          xu watchcd:0:OFF
          goto After_Msg

         :loc_remote
          4dos
          goto after_msg

         :qmx
          raqmx286
          goto after_msg

         :validoor
          call validate.bat
          goto after_msg

         :net&echo
          cdd d:\qbbs
rem          ZMailQ NE
rem          mailscan
          mbutil export

         :echo_only
          cdd d:\qbbs
          ZMailQ EE EP PA NS
          goto begin

         :net_only
          cdd d:\qbbs
rem          ZMailQ NE
rem          mailscan
          mbutil export
          goto begin

         :unpackmail
          dtr on
          at h1
          tm /l >> d:\system.log
          timer >> d:\system.log
          echo *** Processing Incoming ARCmail >> d:\system.log
          cdd d:\seadog\file
          spaz -F -M264/19 D:\SEADOG\FILE
          cdd d:\qbbs
rem          areafix EC
          elvis
          ZMailQ PI PA EP EI NF NS FLtoss.log
          if not exist toss.log goto skiplink
          mbutil link -clean
          del toss.log
         :skiplink
          if not exist fastfwd.bat goto a2
          call fastfwd.bat
          ZMailQ PA EP EE NS FAfastfwd.bbs
          del fastfwd.bat
         :a2
          goto resume

          if errorlevel 255 goto Q255
          if errorlevel   5 goto Q5
          if errorlevel   4 goto Q4
          if errorlevel   3 goto Q3
          if errorlevel   2 goto Q2
          if errorlevel   1 goto Q1

         :resume
          cdd d:\qbbs
          timer >> d:\system.log
          goto start

         :tossnet
          cdd d:\qbbs
          ZMailQ NI
          goto start

         :scanecho
          cdd d:\qbbs
          ZMailQ EE EP PA NS
          goto start

         :ArcMail
          cdd d:\fd
          arcmail to 264/27 -0
          cdd d:\qbbs
          goto start

         :MAKENL
          call Node_Upd
          cdd d:\qbbs
          goto start

         :CLEANUP
          task 10 Execute Cleanup?
          if errorlevel 1 goto clean
          goto start

         :CLEAN
          call svc mkctrl cleanup movetemp mcfreq mcfram renum dskspace defrag reboot
          goto start

         :WEEKEND
          task 10 Execute Weekend?
          if errorlevel 1 goto wkend
          goto start

         :WKEND
          call svc weekend moderate scan virii
          goto start

         :FILEDOOR
          cdd d:\qbbs
          copy users.bbs e:\sysfiles
          fd_upd
          cdd d:\fd
          xr get software 27 /c
          xr get files 160 /c
          call svc fishing
          goto start

         :fossil
          Echo Wrong Fossil Version Error
          goto end

         :modeminit
          Echo Unable To Initialize Modem
          goto end

         :modemresp
          Echo Modem Not Responding
          goto end

         :fulldisk
          Echo Insufficient Disk Space To Proceed
          goto end

         :external
          Echo External Error - System File Missing
          goto end

         :internal
          Echo Internal Error
          goto end

         :Q255
          cls
          echo ZMailQ reports User Abort
          goto end

         :Q5
          cls
          echo ZMailQ reports Error 5
          goto end

         :Q4
          cls
          echo ZMailQ reports Error 4
          goto end

         :Q3
          cls
          echo ZMailQ reports Error 3
          goto end

         :Q2
          cls
          echo ZMailQ reports Error 2
          goto end

         :Q1
          cls
          echo ZMailQ reports Error 1
          goto end

         :end
          dtr on
          at h1

