@echo off
if not exist CNFTEMP.EXE goto skpren
ren CNF.EXE BBSMTREE.EXE
ren CNFTEMP.EXE CNF.EXE
:skpren
bbsrmb
btrieve /p:2048 /e >nul
if not exist BBSRIDX.FLG goto skipfix
bbsridx
if errorlevel 11 goto dfwait
if not errorlevel 10 goto skpgk
copy galfilk.vir galfilk.dat >nul
galfilkw
:skpgk
del BBSRIDX.FLG
del BBSCATA.FLG
:skipfix
if "%1" == "GO" goto op50
if "%1" == "go" goto op50
BBSINTRO %1
goto mintret
:mintrcv
if not exist BBSRIDX.FLG goto mint0
bbsridx
if errorlevel 11 goto dfwait
if not errorlevel 10 goto skpgk3
copy galfilk.vir galfilk.dat >nul
galfilkw
:skpgk3
del BBSRIDX.FLG
del BBSCATA.FLG
:mint0
BBSINTRO 0
goto mintret
:mint5
BBSINTRO 5
goto mintret
:mint7
BBSINTRO 7
goto mintret
:mint9
BBSINTRO 9
:mintret
if errorlevel 200 goto gotodos
if errorlevel 90 goto op90
if errorlevel 70 goto op70
if errorlevel 60 goto op60
if errorlevel 50 goto op50
if errorlevel 40 goto op40
if errorlevel 30 goto op30
if errorlevel 20 goto op20
if errorlevel 10 goto op10
:gotodos
echo
echo Type "BBS"(Enter) to return to The Major BBS...
goto fin
:op10
bbsrmb
echo
if not exist cnfup.bat goto nocnfup1
call cnfup.bat 1
:nocnfup1
cnf -L1
if errorlevel 1 goto waitmi
bbsmsx
if not exist cnfdn.bat goto nocnfdn1
call cnfdn.bat 1
:nocnfdn1
:cnfret
btrieve /p:2048 /e >nul
goto mint5
:op20
echo
call bbsmtree.bat
if errorlevel 1 goto waitmi
goto mint5
:op30
bbsrmb
echo
if not exist cnfup.bat goto nocnfup3
call cnfup.bat 3
:nocnfup3
cnf -L3
if errorlevel 1 goto waitmi
bbsmsx
if not exist cnfdn.bat goto nocnfdn3
call cnfdn.bat 3
:nocnfdn3
goto cnfret
:op40
bbsrmb
echo
if not exist cnfup.bat goto nocnfup4
call cnfup.bat 4
:nocnfup4
cnf -L4
if errorlevel 1 goto waitmi
bbsmsx
if not exist cnfdn.bat goto nocnfdn4
call cnfdn.bat 4
:nocnfdn4
goto cnfret
:op50
if not exist BBSCATA.FLG goto op50int
bbsridx catastro
if errorlevel 11 goto dfwait
if not errorlevel 10 goto skpgk2
copy galfilk.vir galfilk.dat >nul
galfilkw
:skpgk2
del BBSCATA.FLG
:op50int
bbsint
bbsrmb
call bbsbtr
bbsmsx
echo BBSRIDX may be required... >BBSRIDX.FLG
echo BBSRIDX may be required (for CATASTRO fixup)... >BBSCATA.FLG
echo
if not exist bbsup.bat goto nobbsup
call bbsup.bat
if errorlevel 251 goto nobbsup
if errorlevel 250 goto delflag
:nobbsup
if exist MAJORBBS.EXP goto runergo
majorbbs
goto mbbsdone
:runergo
os286
galup majorbbs.exe
:mbbsdone
if errorlevel 80 goto finbbs
if errorlevel 50 goto dfwbbs
if errorlevel 49 goto delflag
if errorlevel 14 goto msh4
if errorlevel 13 goto msh3
if errorlevel 12 goto msh2
if errorlevel 11 goto msh1
if errorlevel 1 goto delflag
if not exist bbsdn.bat goto nobbsdn0
call bbsdn.bat
:nobbsdn0
bbsfndo Cleanup
if not exist BBSCLEAN.BAT goto nocbat
call BBSCLEAN.BAT
:nocbat
goto op50int
:delflag
if not exist bbsdn.bat goto nobbsdn1
call bbsdn.bat
:nobbsdn1
del BBSRIDX.FLG
del BBSCATA.FLG
goto mint0
:msh1
if not exist bbsdn.bat goto nobbsdn2
call bbsdn.bat
:nobbsdn2
bbsfndo Event-1
if not exist BBSEVT1.BAT goto noe1bat
call BBSEVT1.BAT
:noe1bat
goto op50int
:msh2
if not exist bbsdn.bat goto nobbsdn3
call bbsdn.bat
:nobbsdn3
bbsfndo Event-2
if not exist BBSEVT2.BAT goto noe2bat
call BBSEVT2.BAT
:noe2bat
goto op50int
:msh3
if not exist bbsdn.bat goto nobbsdn4
call bbsdn.bat
:nobbsdn4
bbsfndo Event-3
if not exist BBSEVT3.BAT goto noe3bat
call BBSEVT3.BAT
:noe3bat
goto op50int
:msh4
if not exist bbsdn.bat goto nobbsdn5
call bbsdn.bat
:nobbsdn5
bbsfndo Event-4
if not exist BBSEVT4.BAT goto noe4bat
call BBSEVT4.BAT
:noe4bat
goto op50int
:op60
bbsrmb
echo
if not exist cnfup.bat goto nocnfup6
call cnfup.bat 6
:nocnfup6
cnf -L6
if errorlevel 1 goto waitmi
bbsmsx
if not exist cnfdn.bat goto nocnfdn6
call cnfdn.bat 6
:nocnfdn6
goto cnfret
:op70
if errorlevel 83 goto op83
if errorlevel 82 goto op82
if errorlevel 81 goto op81
if errorlevel 80 goto op80
if errorlevel 79 goto op79
if errorlevel 78 goto op78
if errorlevel 77 goto op77
if errorlevel 76 goto op76
if errorlevel 75 goto op75
if errorlevel 74 goto op74
if errorlevel 73 goto op73
if errorlevel 72 goto op72
if errorlevel 71 goto op71
if not exist bbsaudit.old goto op70ren
del bbsaudit.old
:op70ren
rename bbsaudit.dat bbsaudit.old
copy bbsaudit.vir bbsaudit.dat >nul
goto mint7
:op71
bbscolor
if errorlevel 1 goto waitmi
goto mint7
:op72
bbsdmod
if errorlevel 1 goto waitmi
bbsint
goto mint7
:op73
bbslang
if errorlevel 1 goto waitmi
bbsint
bbsmsx
goto mint7
:op74
bbsmref
if errorlevel 1 goto waitmi
goto mint7
:op75
bbsridx *
if not exist GALFILK.DAT goto skpgkw
copy galfilk.vir galfilk.dat >nul
galfilkw
:skpgkw
copy bbsmajor.mcv junk.jnk >nul
del *.mcv
rename junk.jnk bbsmajor.mcv
bbsmsx bbsmajor
bbsmsx
del bbsint.ref
del mdf.ref
bbsrbt
copy bbsxrf.vir bbsxrf.dat >nul
bbsrbx
bbsrbk
goto mint7
:op76
bbssetcl
if errorlevel 1 goto waitmi
bbsmsx
goto mint7
:op77
bbsswtcl
if errorlevel 1 goto waitmi
goto mint7
:op78
bbszstat
if errorlevel 1 goto waitmi
goto mint7
:op79
galfilin
if errorlevel 1 goto waitmi
goto mint7
:op80
galfilkw
if errorlevel 1 goto waitmi
goto mint7
:op81
galp&qr
if errorlevel 1 goto waitmi
bbsint
goto mint7
:op82
galrfc
if errorlevel 1 goto waitmi
goto mint7
:op83
galsort
if errorlevel 1 goto waitmi
goto mint7
:op90
bbsrpt
if errorlevel 1 goto waitmi
goto mint9
:dfwbbs
if not exist bbsdn.bat goto nobbsdn6
call bbsdn.bat
:nobbsdn6
:dfwait
del BBSRIDX.FLG
:waitmi
bbsrmb
echo
echo Write down the error message in the box, then hit Ctrl-C to stop, or
pause
btrieve /p:2048 /e >nul
goto mintrcv
:finbbs
if not exist bbsdn.bat goto nobbsdn7
call bbsdn.bat
:nobbsdn7
:fin
bbsrmb
if exist MAJORBBS.EXP os286 remove >nul
