Skip to content

Instantly share code, notes, and snippets.

@redblobgames
Last active March 20, 2019 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save redblobgames/7454d9e95b68c108392b62b0eb5779b8 to your computer and use it in GitHub Desktop.
Save redblobgames/7454d9e95b68c108392b62b0eb5779b8 to your computer and use it in GitHub Desktop.
Configuration script in SRE 0.992a (SRE.CFG) vs SRE 0.993a (INSTALL.CFG)
;SRE
;Solar Realms Elite
;0.993a
let GAME := SRE
tell $GAME " " 0.993a " setup:"
if $doorfile == "" goto Local
getcwd CWD
tell "The " $GAME " directory is `" $CWD "'."
let rI1 := "Install.BBSDirectory"
let rI2 := "Install.DoorFileDir"
let rI3 := "Install.BatchFile"
getres $rI1 BBSDir
getres $rI2 DoorFileDir
getres $rI3 BatchFile
display "Which directory is your BBS in? "
read BBSDir
if $BBSDir == "" let BBSDir := "."
fixpath BBSDir
if $DoorFileDir == "" let DoorFileDir := $BBSDir
display "Enter the full path to your BBS's door files: "
read DoorFileDir
if $DoorFileDir == "" let DoorFileDir := "."
fixpath DoorFileDir
if $BatchFile == "" let BatchFile := $BBSDir $GAME ".BAT"
display "Batch file to create: "
read BatchFile
setres $rI1 $BBSDir
setres $rI2 $DoorFileDir
setres $rI3 $BatchFile
let rFos := "System.Fossil"
getres $rFos Fossil
tell $GAME " can use the FOSSIL driver for communications."
if $Fossil != "" tell "Current setting for FOSSIL: " $Fossil
display "Do you want " $GAME " to use FOSSIL? (Y/N) "
ask Fossil
setres $rFos $Fossil
let rLB := "LockBaudRate"
getres $rLB LockedBaud
display "If you have locked baud rates, please enter the baud rate: "
read LockedBaud
setres $rLB $LockedBaud
let #cp := 0
let #br := 0
let #tl := 0
let #nl := 0
let #ll := 0
let #al := 0
let #cl := 0
let #pl := 0
let #rn := 0
fopen $BatchFile
fwrite "@ECHO OFF"
fcd $CWD
goto $doorfile
tell "Error. Unknown doorfile."
exit
Local:
tell "LOCAL.BAT will run the game locally."
fopen LOCAL.BAT
fwrite "SRDOOR LOCAL"
fwrite $GAME
fclose
setres System.LocalOnly yes
goto end
doorfile.sr:
fwrite "COPY " $DoorFileDir "DOORFILE.SR ."
fwrite $GAME
fcd $BBSDir
fclose
goto next
door.sys:
let #nl := 10
let #cl := 20
let #pl := 21
let #br := 2
let #cp := 1
let #tl := 19
goto std
dorinfo1.def:
let #nl := 7
let #ll := 8
let #br := 5
let #cp := 4
let #tl := 12
goto std
gtuser.bbs:
display "Which COM port are you using? (1-4) "
read comport
fwrite "SRDOOR GT " $comport
goto std2
tribbs.sys:
let #nl := 2
let #br := 13
let #cp := 12
let #tl := 7
goto std
chain.txt:
let #nl := 2
let #al := 14
let #pl := 10
let #br := 20
let #cp := 21
let #rn := 3
goto std
command-line:
fwrite "ECHO %1 >DOORFILE.SR"
fwrite "IF [%2]==[C] ECHO 1 >>DOORFILE.SR"
fwrite "IF NOT [%2]==[C] ECHO %2 >>DOORFILE.SR"
fwrite "ECHO -1 >>DOORFILE.SR"
fwrite "ECHO 25 >>DOORFILE.SR"
fwrite "ECHO %4 >>DOORFILE.SR"
fwrite "ECHO %5 >>DOORFILE.SR"
fwrite "ECHO %3 >>DOORFILE.SR"
fwrite "ECHO %1 >>DOORFILE.SR"
fwrite $GAME
fcd $BBSDir
fwrite EXIT
fclose
goto next
std:
fwrite SRDOOR
std2:
fwrite $GAME
fcd $BBSDir
fwrite EXIT
fclose
fopen SETUP.SR
fwrite $BBSDir $doorfile
let h := " <- Line # of "
fwrite $#nl $h "Username or First name"
fwrite $#ll $h "Last name (0 if prev line was full name)"
fwrite $#cl $h "IBM charaters (1/Y/G = yes)"
fwrite $#al $h "ANSI support (1/Y/G/C = yes)"
fwrite $#pl $h "number of lines on the screen"
fwrite $#br $h "baud rate"
fwrite $#cp $h "COM port"
fwrite $#tl $h "time left (minutes)"
fwrite $#rn $h "Real Name"
fwrite "Enter 0 for any value not supported."
fclose
next:
pause
cls
tell " Score File Setup"
let x := "You can leave any of these blank if you wish"
tell $x
let r := "Scores.File.ANSI"
getres $r S
display "ANSI Score file: "
read S
setres $r $S
let r := "Scores.File.Text"
getres $r S
display "Text Score file: "
read S
setres $r $S
pause
cls
end:
tell "þ Run UNPACK -y to unpack the rest of the files."
tell "þ Please run SRE RESET to reset the game if you haven't done so."
tell "þ See Docs\Resource.DOC for setup/customization information."
tell "þ See Docs\Sysop.DOC for more customization stuff."
tell "þ See Docs\Register.DOC if you'd like to register."
tell "þ See Flavors\Readme for instructions on turning SRE into "
tell " Trek Realms, Wild West, Medieval Realms, Dune Realms, or Fake-BRE!"
pause
exit
{
begin "SRE:II Installation"
------------------------
(set game "SRE")
(set version "0.99x")
(set 4-dos (4-dos?))
(set ResourceFile "RESOURCE.DAT")
(display (cc 14) game " " (cc 15) version (cc 7) " setup:\n\n")
(display "The " game " directory is `" (cc 14) (fix-path (get-cwd)) (cc 7) "'.\n\n")
(set BBSDirectory (read-string "Which directory is your BBS in?\n> "))
[ if (not BBSDirectory)
(set BBSDirectory ".")
]
(set BBSDirectory (fix-path BBSDirectory))
(set DoorFileDir BBSDirectory)
[ if (not (ask "Does your BBS produce door files in " (cc 14) DoorFileDir (cc 7) "? [Y/n] "))
(set DoorFileDir (read-string "Enter the full path for your BBS's door files:\n> "))
(set DoorFileDir (fix-path DoorFileDir))
]
(write-setup-sr)
(set BatchFile (concat BBSDirectory game ".BAT"))
[ if (not (ask "Write to " (cc 14) BatchFile (cc 7) "? [Y/n] "))
(set BatchFile (read-string "Enter the full filename for your batch file:\n> "))
]
(display (cc 12) " ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\n" (cc 7))
"Ask about special effects"
(display "Special effects are extra ANSI animations shown when the user is at a\n"
"prompt. They may slow down systems running under DESQview, MS-Windows,\n"
"or OS/2. They also may fill up your modem buffer if you use locked\n"
"baud rates. If you are running under a multitasking system or you\n"
"have a high-speed modem, I recommend not using special effects.\n")
(set SpecialEffects (ask "Do you want Special Effects? [Y/n] "))
[ if (not (error? SpecialEffects))
(if SpecialEffects (set SpecialEffects "TRUE"))
(if (not SpecialEffects) (set SpecialEffects "FALSE"))
(resource-edit ResourceFile "SpecialEffects" SpecialEffects)
]
"Ask about fossil"
(display "SRE can use the FOSSIL driver for communications.\n")
(set UseFossil (ask "Do you want SRE to use FOSSIL? [Y/n] "))
[ if (not (error? UseFossil))
(if UseFossil (set UseFossil "TRUE"))
(if (not UseFossil) (set UseFossil "FALSE"))
(resource-edit ResourceFile "System.Fossil" UseFossil)
]
(set LockedBaud (read-string "If you have locked baud rates, please enter the baud rate:\n> "))
(if LockedBaud (resource-edit ResourceFile "LockBaudRate" LockedBaud))
(if (not LockedBaud) (resource-edit ResourceFile "LockBaudRate" "none"))
(display (cc 12) " ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\n" (cc 7))
(set L-ansi-scores
(read-string "If you want an ANSI score file, enter the full filename:\n> "))
(if L-ansi-scores
(resource-edit ResourceFile "Scores.File.ANSI" L-ansi-scores))
(if (not L-ansi-scores)
(resource-edit ResourceFile "Scores.File.ANSI" "\"\""))
(set L-text-scores
(read-string "If you want a TEXT score file, enter the full filename:\n> "))
(if L-text-scores
(resource-edit ResourceFile "Scores.File.Text" L-text-scores))
(if (not L-text-scores)
(resource-edit ResourceFile "Scores.File.Text" "\"\""))
(display (cc 12) " ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\n" (cc 7))
(set L-ansi-news
(read-string "If you want an ANSI Today's news file, enter the full filename:\n> "))
(set L-text-news
(read-string "If you want a TEXT Today's news file, enter the full filename:\n> "))
(set L-ansi-ynews
(read-string "If you want an ANSI Yesterday's news file, enter the full filename:\n> "))
(set L-text-ynews
(read-string "If you want a TEXT Yesterday's news file, enter the full filename:\n> "))
(display (cc 12) "\n\n ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\n" (cc 7))
[ if (not BatchFile)
(display "Not creating a batch file.\n")
]
[ if BatchFile
(display "Writing to " (cc 14) BatchFile (cc 7) "\n")
"Write a batch file"
(rewrite BatchFile)
(write "@ECHO OFF\n")
[ if 4-dos
(write "REM 4-DOS version\n")
(write "PUSHD " (fix-path (get-cwd)) "\n")
]
(if (not 4-dos) (write (cd-cmd (fix-path (get-cwd)))))
(set Setup (setup-type))
(set done? #f)
[ if (= Setup "Searchlight")
" %1 is the username "
" %2 is ANSI: `C' means yes"
" %3 is Time left"
" %4 is Baud rate"
" %5 is COM port"
(set done? #t)
(write "ECHO %1 >DOORFILE.SR\n"
"IF [%2]==[C] ECHO 1 >>DOORFILE.SR\n"
"IF NOT [%2]==[C] ECHO 0 >>DOORFILE.SR\n"
"ECHO -1 >>DOORFILE.SR\n"
"ECHO 25 >>DOORFILE.SR\n")
[ if LockedBaud
(write "REM For non-locked, use ECHO %4 >>DOORFILE.SR\n"
"ECHO " LockedBaud " >>DOORFILE.SR\n")
]
[ if (not LockedBaud)
(write "ECHO %4 >>DOORFILE.SR\n")
]
(write "ECHO %5 >>DOORFILE.SR\n")
(write "ECHO %3 >>DOORFILE.SR\n")
]
[ if (= Setup "COPY")
(set done? #t)
(write "COPY " DoorFileDir "DOORFILE.SR DOORFILE.SR\n")
]
[ if (= Setup "PC-Board NEW")
(display "PC-Board 14.x support has not yet been added to SRDOOR.\n")
(set done? #t)
(set PCB-2-SR (ask "Do you have PCB-2-SRE? [Y/N] "))
[ if PCB-2-SR
(display "Which directory is PCB-2-SRE in (include drive and trailing '\\')?\n")
(set PCB-dir (read-string "> "))
(write PCB-dir "PCB2SRE /B=" DoorFileDir " /D=. /P /L=24\n")
]
[ if (not PCB-2-SR)
(write "ECHO PC-Board support is not working yet.")
(display "PC-Board 14.x support has not been added to SRDOOR. There "
"is a program called PCB-2-SRE that converts PC-Board 14.5 files "
"to the format that " game " requires. You might want to get "
"PCB-2-SRE or a door converter that converts to a format used "
"by another BBS. (You will have to run the installation "
"again.) PCB-2-SRE is available on the Solar Realm, and you can "
"contact the author at an287@cleveland.freenet.edu (through "
"Internet or CompuServe).\n")
]
]
[ if (= Setup "Maximus")
(display "The installation program assumes you are using Dennis Lozen's "
"Maximus installation setup. If you are not, and you prefer to "
"use DORINFO1.DEF for your setup, please re-run the installer "
"for the New RBBS setup.\n")
(set done? #t)
]
[ if (not done?)
(write "SRDOOR")
[ if (= Setup "GT")
(set ComPort (read-string "On what COM port do you run? [1-8]\n> "))
(write " GT " ComPort)
]
[ if (= Setup "PC-Board OLD")
(set ComPort (read-string "On what COM port do you run? [1-8]\n> "))
(write " PCBOARD2 " ComPort)
]
(write "\n")
]
(write game "\n")
(if L-ansi-news (write "COPY NEWS.ANS " L-ansi-news "\n"))
(if L-text-news (write "COPY NEWS.TXT " L-text-news "\n"))
(if L-ansi-ynews (write "COPY YESTNEWS.ANS " L-ansi-ynews "\n"))
(if L-text-ynews (write "COPY YESTNEWS.TXT " L-text-ynews "\n"))
(if 4-dos (write "POPD\n"))
(if (not 4-dos) (write (cd-cmd BBSDirectory)))
(write "REM take the EXIT line out if your BBS is not running")
(write "REM this batch file in a DOS shell")
(write "EXIT\n")
]
(display (cc 12) " ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\n" (cc 7))
(display (cc 15) "\nImportant: " (cc 7) "Run " (cc 14) "SRE RESET" (cc 7) " to set up a new game of SRE.\n\n")
(display "\nSee " (cc 14) "Docs/Resource.DOC" (cc 7) " for setup/customization information.\n")
(display "See " (cc 14) "Docs/Sysop.DOC" (cc 7) " for information on customizing SRE.\n")
(display "See " (cc 14) "Docs/Register.DOC" (cc 7) " for info on registration.\n")
(pause "\nPress any key to exit... ")
----------------------
end "SRE Installation"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment