Category : Communication (modem) tools and utilities
Archive   : MRUN200.ZIP
Filename : MRUN200C.WAS

 
Output of file : MRUN200C.WAS contained in archive : MRUN200.ZIP
;MailRun v2.00: Part C, changebbs
;1992 Gerald P. Sully, all rights reserved.

#define MRUN200C
#define MRUN200BC

#include "mrun200.h"

string ProtList, ArcList

#comment
********************************************************

MAIN()

Calls checkchild(), getfilenames(), makemaildoorlist()
makebbstypelist(), makeprotlist(), changeprompts(),
changeuserinfo(), changemaildoor(), menudim()

Dispatches the appropriate command based on the value
of FLAGS.

********************************************************
#endcomment

proc main
integer cmdstatus
menudim()
checkchild()
getfilenames()
findfirst MailRun
MailRunTrunc = $FILENAME
makeprotlist()
makebbstypelist()
makemaildoorlist()
profilerd MailRun "MailRun" "Archiver" Archiver
profilerd MailRun "MailRun" "QWKReader" QWKReader
profilerd MailRun "MailRun" "LogViewer" LogViewer
cmdstatus = FLAGS & (USR + PRMPT + QMD)
switch cmdstatus
case USR
changeuserinfo()
endcase
case PRMPT
changeprompts()

endcase
case QMD
changemaildoor()
endcase
endswitch
endproc


#comment
********************************************************

CHANGEUSERINFO()

Calls getbbsi(), makebbslist(), loadbbsinfo(),
loadprompts(), loadmaildoor(), writebbsinfo(),
writeprompts(), writemaildoor(), interfaceon(),
bbsbox(), addbbs(), defaultsprompts(), defaultsdoor(),
cfgprompts(), cfgmaildoor(), writenewbbs(), checkchanged(),
getbbscoord(), gettaskstring()

Puts up the BBS Information dialog box and allows the
user to change the values for the current BBS. If the
the DEFAULTS flag is set, changes the DEFAULT BBS
settings. If the NEW flag is set, calls addbbs().

********************************************************
#endcomment

proc changeuserinfo
string LastBBS, LastMRun
integer dialogstatus, i
i = getbbsi()
READNAME
LastBBS = BBS
LastMRun = MailRun
if FLAGS & DEFAULTS
BBSList = "DEFAULT"
BBS = "DEFAULT"
else
makebbslist()
endif
loadbbsinfo()
loadprompts()
loadmaildoor()
if FLAGS & DEFAULTS
findfirst MailRun
strfmt BBSName "BBS Info Defaults for %s" $FILENAME
endif
bbsbox()
interfaceon()
FLAGS &= UNCHANGED
if FLAGS & NEW
addbbs()
LastBBS = BBS
endif
while 1
dialogstatus = $DIALOG
switch dialogstatus
case 10
;User selected "Prompts"
if FLAGS & DEFAULTS
defaultsprompts()
else
cfgprompts()
endif
endcase
case 11
;User selected "Mail Door"
if FLAGS & DEFAULTS
defaultsdoor()
else
cfgmaildoor()
endif
endcase
case 12
;User selected "Save"
if NULLSTR BBSName
usermsg "You must enter the name of the BBS!"
loopwhile
elseif FLAGS & NEW
writenewbbs()
FLAGS &= OLD
endif
writebbsinfo()
writeprompts()
writemaildoor()
FLAGS &= UNCHANGED
endcase
case 13
;User selected "Done:
if checkchanged()
exit
endif
endcase
case 171
;User changed the BBS type
if FLAGS & DEFAULTS
loadprompts()
else
FLAGS |= DEFAULTS
loadprompts()
FLAGS &= (ALLFLAGS - DEFAULTS)
endif
FLAGS |= CHANGED
endcase
case 172
;User changed the mail door type
if FLAGS & DEFAULTS
loadmaildoor()
else
FLAGS |= DEFAULTS
loadmaildoor()
FLAGS &= (ALLFLAGS - DEFAULTS)
endif
FLAGS |= CHANGED
endcase
case 173
;User changed BBS ID with combobox
if checkchanged()
loadbbsinfo()
i = getbbscoord()
TaskItem = gettaskstring(i, 0)
FLAGS &= UNCHANGED
LastBBS = BBS
updatedlg -1
else
BBS = LastBBS
updatedlg 512
endif
endcase
case 70
case 170
case 230
case 231
case 232
case 233
case 234
case 235
case 236
case 237
case 238
FLAGS |= CHANGED
endcase
endswitch
endwhile
endproc


#comment
********************************************************

CHANGEPROMPTS()

Called by main()

Calls getbbsi(), makebbslist(), promptbox(), loadprompts(),
writeprompts(), interfaceon(), defaultsbbs(), defaultsdoor(),
cfgbbs(), cfgmaildoor(), exportprompts(), checkchanged(),
getbbscoord(), gettaskstring()

Allows the user to change the prompts for a given BBS in
the *.MRN file. If DEFAULTS flag is set, changes default
prompts for the current BBS type.

********************************************************
#endcomment

proc changeprompts
string LastBBS, LastMRun
integer dialogstatus, i
i = getbbsi()
READNAME
LastBBS = BBS
LastMRun = MailRun
profilerd MailRun BBS "BBSType" BBSType
if FLAGS & DEFAULTS
if NULLSTR BBSType
profilerd MailRunIni "DEFAULT" "BBSType" BBSType
endif
BBSList = "DEFAULT"
BBS = "DEFAULT"
else
makebbslist()
endif
loadprompts()
promptbox()
FLAGS &= UNCHANGED
interfaceon()
while 1
dialogstatus = $DIALOG
switch dialogstatus
case 10
;User selected "BBS Info"
if FLAGS & DEFAULTS
defaultsbbs()
else
cfgbbs()
endif
endcase
case 11
;User selected "Mail Door"
if FLAGS & DEFAULTS
defaultsdoor()
else
cfgmaildoor()
endif
endcase
case 12
;User selected "Export"
exportprompts()
endcase
case 13
;User selected "Save"
if FLAGS & DEFAULTS
profilewr MailRunIni "DEFAULT" "BBSType" BBSType
else
profilewr MailRun BBS "BBSType" BBSType
endif
writeprompts()
FLAGS &= UNCHANGED
endcase
case 14
;User selected "Done"
if checkchanged()
exit
endif
endcase
case 170
;User changed BBS with the combobox
if checkchanged()
loadprompts()
i = getbbscoord()
TaskItem = gettaskstring(i, 0)
LastBBS = BBS
updatedlg 128
else
BBS = LastBBS
updatedlg 512
endif
endcase
case 171
;User changed BBS type
if FLAGS & DEFAULTS
loadprompts()
else
FLAGS |= DEFAULTS
loadprompts()
FLAGS &= (ALLFLAGS - DEFAULTS)
endif
updatedlg 128
FLAGS |= CHANGED
endcase
case 230
case 231
case 232
case 233
case 234
case 235
case 236
case 237
case 238
case 239
case 240
case 241
case 242
case 243
case 244
case 245
FLAGS |= CHANGED
endcase
endswitch
endwhile
endproc

#comment
********************************************************

CHANGEMAILDOOR()

Called by main()

Calls getbbsi(), makebbslist(), interfaceon(),
makemaildoorlist(), loadmaildoor(), writemaildoor(),
maildoorbox(), defaultsbbs(), defaultsprompts(),
cfgbbs(), cfgprompts(), exportmaildoor(), checkchanged(),
getbbscoord(), gettaskstring()

Allows the user to change the mail door prompts for a
given BBS in the *.MRN file.

********************************************************
#endcomment

proc changemaildoor
string LastBBS, LastMRun
integer dialogstatus, i
i = getbbsi()
READNAME
LastBBS = BBS
LastMRun = MailRun
profilerd MailRun BBS "MailDoorType" MailDoorType
if FLAGS & DEFAULTS
if NULLSTR MailDoorType
profilerd MailRunIni "DEFAULT" "MailDoorType" MailDoorType
endif
BBSList = "DEFAULT"
BBS = "DEFAULT"
else
makebbslist()
endif
loadmaildoor()
ArcList = "arj.exe,lha.exe,lharc.exe,pkunzip.exe,pkxarc.exe,zoo.exe"
maildoorbox()
interfaceon()
while 1
dialogstatus = $DIALOG
switch dialogstatus
case 10
;User selected "Prompts"
if FLAGS & DEFAULTS
defaultsprompts()
else
cfgprompts()
endif
endcase
case 11
;User selected "BBS Info"
if FLAGS & DEFAULTS
defaultsbbs()
else
cfgbbs()
endif
endcase
case 12
;User selected "Export"
exportmaildoor()
endcase
case 13
;User selected "Save"
writemaildoor()
FLAGS &= UNCHANGED
endcase
case 14
;User selected "Done"
if checkchanged()
exit
endif
endcase
case 170
;User changed mail door type
if FLAGS & DEFAULTS
loadmaildoor()
else
FLAGS |= DEFAULTS
loadmaildoor()
FLAGS &= (ALLFLAGS - DEFAULTS)
endif
FLAGS |= CHANGED
updatedlg 128
endcase
case 173
;User changed the current BBS
if checkchanged()
loadmaildoor()
i = getbbscoord()
TaskItem = gettaskstring(i, 0)
LastBBS = BBS
updatedlg 128
else
BBS = LastBBS
updatedlg 512
endif
endcase
case 230
case 231
case 232
case 233
case 234
FLAGS |= CHANGED
endcase
endswitch
endwhile
endproc


#comment
********************************************************

ADDBBS()

Called by changeuserinfo()

Calls fverify(), makebbslist(), loadbbsinfo(),
loadprompts(), loadmaildoor(),

Adds a BBS to the *.MRN file, assigning default info
and prompts.

********************************************************
#endcomment

proc addbbs
string NewBBS
while 1
sdlginput "BBS ID" "Enter the ID of the BBS:" NewBBS
if FAILURE
exit
endif
strlwr NewBBS
if not fverify(NewBBS)
usermsg "A bulletin board's BBS ID is the same as the \
name of it's QWK packet. It must be a valid DOS \
file name without the extension."
elseif strfind BBSList NewBBS
errormsg "That BBS is already in the MailRun!"
else
exitwhile
endif
endwhile

;If there is no previously existing information for the new BBS,
;assign the defaults, otherwise, use the old info.
;Any previously entered BBS will have a name.

BBS = NewBBS
READNAME
if NULLSTR BBSName
;Load defaults
FLAGS |= DEFAULTS
loadbbsinfo()
BBSName = ""
loadprompts()
loadmaildoor()
FLAGS &= (ALLFLAGS - DEFAULTS)
else
loadbbsinfo()
endif
FLAGS |= CHANGED
;Add the new BBS to the BBS list
if not NULLSTR BBSList
strfmt BBSList "%s,%s" BBSList BBS
else
BBSList = BBS
endif
updatedlg -1
endproc


#comment
********************************************************

EXPORTPROMPTS()

Called by changeprompts()

Calls findstring(), writeprompts(), makebbstypelist()

Creates a new BBS type with current prompt set.

********************************************************
#endcomment

proc exportprompts
string NewBBSType, BBSType_X
integer i
while 1
NewBBSType = BBSType
sdlginput "Export Prompts" "Name the new prompt set:" \
NewBBSType DEFAULT
if FAILURE
return
endif
if strfind BBSTypeList NewBBSType
usermsg "There is already a prompt set for %s!" NewBBSType
loopwhile
endif
if !(findstring(NewBBSType "PCBoard") || \
findstring(NewBBSType, "WildCat") || \
findstring(NewBBSType, "Auntie"))
usermsg "The name of the prompt set must contain a \
keyword indicating the type of BBS. Valid keywords are `"PCBoard,`" \
`"WildCat`" and `"Auntie.`""
loopwhile
endif
exitwhile
endwhile
i = 1
strfmt BBSType_X "BBSType_%d" i
profilerd MailRunIni "BBSTypes" BBSType_X BBSType
while not NULLSTR BBSType
i++
strfmt BBSType_X "BBSType_%d" i
profilerd MailRunIni "BBSTypes" BBSType_X BBSType
endwhile
profilewr MailRunIni "BBSTypes" BBSType_X NewBBSType
if FLAGS & DEFAULTS
writeprompts()
else
FLAGS |= DEFAULTS
writeprompts()
FLAGS &= (ALLFLAGS - DEFAULTS)
endif
makebbstypelist()
BBSType = NewBBSType
updatedlg 512
endproc


#comment
********************************************************

EXPORTMAILDOOR()

Called by changemaildoor()

Calls fverify(), makebbslist(), loadbbsinfo(),
loadprompts(), loadmaildoor(),

Adds a BBS to the *.MRN file, assigning default info
and prompts.

********************************************************
#endcomment

proc exportmaildoor
string NewMailDoorType, MailDoor_X
integer i
while 1
NewMailDoorType = MailDoorType
sdlginput "Export Prompts" "Name the new mail door:" \
NewMailDoorType DEFAULT
if FAILURE
return
endif
if strfind MailDoorList NewMailDoorType
usermsg "There is already a prompt set for %s!" \
NewMailDoorType
loopwhile
endif
exitwhile
endwhile
i = 1
strfmt MailDoor_X "MailDoor_%d" i
profilerd MailRunIni "MailDoors" MailDoor_X MailDoorType
while not NULLSTR MailDoorType
i++
strfmt MailDoor_X "MailDoor_%d" i
profilerd MailRunIni "MailDoors" MailDoor_X MailDoorType
endwhile
profilewr MailRunIni "MailDoors" MailDoor_X NewMailDoorType
MailDoorType = NewMailDoorType
if FLAGS & DEFAULTS
writemaildoor()
else
FLAGS |= DEFAULTS
writemaildoor()
FLAGS &= (ALLFLAGS - DEFAULTS)
endif
makemaildoortypelist()
updatedlg 512
endproc


#comment
********************************************************

BBSBOX()

Called by main()

Displays the BBS Information dialog box.

********************************************************
#endcomment

proc bbsbox
destroydlg
HelpPage = 5
dialogbox 24 36 320 206 15 "BBS Information" HELPID HelpPage
text 142 10 40 8 right "BBS Name:"
editbox 186 8 121 12 BBSName
groupbox 11 28 137 146 "BBS Info" shadow
text 19 47 56 8 right "User ID:"
text 19 65 56 8 right "Password:"
text 19 83 56 8 right "XFer Protocol:"
text 19 101 56 8 right "Confirmation (1):"
text 19 119 56 8 right "Confirmation (2):"
text 26 137 92 8 right "Language/Prompt Scheme:"
editbox 79 45 60 12 UserName
editbox 79 63 60 12 PWord
combobox 79 81 60 42 ProtList XFerProt sort
editbox 79 99 60 12 Confirm1
editbox 79 117 60 12 Confirm2
editbox 122 135 16 12 LangNumber
checkbox 38 152 90 12 "Display ANSI Graphics " GraphicsOn
groupbox 158 29 150 79 "Phone Numbers" shadow
text 162 49 35 8 right "Node 1:"
text 162 69 35 8 right "Node 2:"
text 162 89 35 8 right "Node 3:"
editbox 201 47 100 12 Number_1
editbox 201 67 100 12 Number_2
editbox 201 87 100 12 Number_3
groupbox 158 116 150 58 shadow
text 160 132 39 8 right "BBS Type:"
text 172 153 39 8 right "Mail Door:"
combobox 203 130 98 42 BBSTypeList BBSType sort
combobox 215 151 76 42 MailDoorList MailDoorType sort
pushbutton 42 184 52 14 "&Prompts" normal
pushbutton 106 184 52 14 "&Mail Door" normal
pushbutton 170 184 52 14 "&Save" normal default
pushbutton 234 184 52 14 "&Done" normal
text 28 10 36 8 right "BBS ID:"
combobox 68 8 66 42 BBSList BBS sort
enddialog
endproc


#comment
********************************************************

PROMPTBOX()

Called by changeprompts()

Displays the BBS Prompts dialog box.

********************************************************
#endcomment

proc promptbox
destroydlg
HelpPage = 6
dialogbox 14 36 324 209 15 "BBS Prompts" HELPID HelpPage
groupbox 13 30 297 147 shadow
text 18 44 56 8 right "Language:"
text 18 60 56 8 right "ANSI Graphics:"
text 18 76 56 8 right "Name:"
text 18 92 56 8 right "Password:"
text 18 108 56 8 right "Confirmation (1):"
text 18 124 56 8 right "Confirmation (2):"
text 18 140 56 8 right "View:"
text 18 156 56 8 right "Scan Msg Base:"
editbox 78 42 76 12 LangPrompt
editbox 78 58 76 12 GraphicsPrompt
editbox 78 74 76 12 NamePrompt
editbox 78 90 76 12 PWordPrompt
editbox 78 106 76 12 Confirm1Prompt
editbox 78 122 76 12 Confirm2Prompt
editbox 78 138 76 12 ViewPrompt
editbox 78 154 76 12 ScanPrompt
text 160 44 56 8 right "File Prompt:"
text 160 60 56 8 right "More:"
text 160 76 56 8 right "Continue:"
text 160 92 56 8 right "Command:"
text 160 108 56 8 right "File Unavailable:"
text 160 124 56 8 right "File Description:"
text 160 140 56 8 right "Start File D/L:"
text 160 156 56 8 right "Start File U/L:"
editbox 220 42 76 12 FilePrompt
editbox 220 58 76 12 MorePrompt
editbox 220 74 76 12 ContinuePrompt
editbox 220 90 76 12 CommandPrompt
editbox 220 106 76 12 DLUnavPrompt
editbox 220 122 76 12 ULDescPrompt
editbox 220 138 76 12 DLPrompt
editbox 220 154 76 12 ULPrompt
pushbutton 22 187 48 14 "&BBS Info" normal
pushbutton 80 187 48 14 "&Mail Door" normal
pushbutton 138 187 48 14 "&Export" normal
pushbutton 196 187 48 14 "&Save" normal default
pushbutton 254 187 48 14 "&Done" normal
text 12 14 42 8 right "Prompts for:"
combobox 58 12 72 42 BBSList BBS sort
text 134 14 68 8 right "Prompts based on:"
combobox 206 12 100 42 BBSTypeList BBSType sort
enddialog
endproc


#comment
********************************************************

MAILDOORBOX()

Called by changemaildoor()

Displays the Mail Door dialog box.

********************************************************
#endcomment

proc maildoorbox
destroydlg
HelpPage = 7
dialogbox 8 36 342 165 15 "Mail Door" HELPID HelpPage
groupbox 12 33 156 93 shadow
text 20 48 62 8 right "Start Mail Door:"
text 20 68 62 8 right "Prompts Based on:"
text 20 88 62 8 right "QWK Archiver:"
text 20 108 62 8 right "Transfer Protocol:"
editbox 86 46 70 12 MailDoor
combobox 86 66 70 42 MailDoorList MailDoorType sort
combobox 86 86 70 42 ArcList QWKArchiver sort
combobox 86 106 70 42 ProtList MailXferProt sort
groupbox 180 33 150 94 "Prompts" shadow
text 190 48 56 8 right "Mail Command:"
text 190 68 56 8 right "Receive Packet:"
text 190 88 56 8 right "Start Mail U/L:"
text 190 108 56 8 right "Start Mail D/L:"
editbox 250 46 70 12 MailPrompt
editbox 250 66 70 12 ReceiveQWKPrompt
editbox 250 86 70 12 MailULPrompt
editbox 250 106 70 12 MailDLPrompt
text 117 12 53 8 right "Mail Door for:"
combobox 174 10 77 42 BBSList BBS sort
pushbutton 22 139 50 14 "&Prompts" normal
pushbutton 84 139 50 14 "&BBS Info" normal
pushbutton 146 139 50 14 "&Export" normal
pushbutton 208 139 50 14 "&Save" normal default
pushbutton 270 139 50 14 "&Done" normal
enddialog
endproc


#comment
********************************************************

MAKEPROTLIST()

Called by main()

Creates a list of transfer protocols for display in the
bbsbox() dialog box protocol combobox.

********************************************************
#endcomment

proc makeprotlist
string ProtName
integer i
i = 0
ProtList = ""
getitem PROTOCOL i ProtName
while not NULLSTR ProtName
strfmt ProtList "%s,%s" ProtList ProtName
i++
getitem PROTOCOL i ProtName
endwhile
strdelete ProtList 0 1
endproc


#comment
********************************************************

MAKEMAILDOORLIST()

Called by main(), changemaildoor()

Creates a list of mail doors for display the mail door
combobox of the BBS info and Mail Door dialog boxes.

********************************************************
#endcomment

proc makemaildoorlist
string MailDoor_X, DoorType
integer i
MailDoorList = ""
i = 1
profilerd MailRunIni "MailDoors" "MailDoor_1" DoorType
while not NULLSTR DoorType
strfmt MailDoorList "%s,%s" MailDoorList DoorType
i++
strfmt MailDoor_X "MailDoor_%d" i
profilerd MailRunIni "MailDoors" MailDoor_X DoorType
endwhile
if i > 1
strdelete MailDoorList 0 1
endif
endproc


#comment
********************************************************

MAKEBBSTYPELIST()

Called by main(), exportprompts()

Creates a list of BBS types for display the BBS type
combobox of the BBS info and BBS prompt dialog boxes.

********************************************************
#endcomment

proc makebbstypelist
string BBSType_X, BoardType
integer i
BBSTypeList = ""
i = 1
profilerd MailRunIni "BBSTypes" "BBSType_1" BoardType
while not NULLSTR BoardType
strfmt BBSTypeList "%s,%s" BBSTypeList BoardType
i++
strfmt BBSType_X "BBSType_%d" i
profilerd MailRunIni "BBSTypes" BBSType_X BoardType
endwhile
if i > 1
strdelete BBSTypeList 0 1
endif
endproc


#comment
********************************************************

WRITENEWBBS()

Called by changeuserinfo()

Calls readbbs(), writebbs()

If the NEW flag is set, writes the information for the
new BBS to the *.MRN file.

********************************************************
#endcomment

proc writenewbbs
string char, BBSi
integer i, j, k
;Determine the insertion point and renumber all following BBSs
if not NULLSTR TaskItem
strextract char TaskItem "`t" 3
;i is the BBS coordinate
atoi char i
j = i + 1
BBSi = readbbs(j)
;Go to the last BBS
while not NULLSTR BBSi
j++
BBSi = readbbs(j)
endwhile
k = j - 1
;Count back down, renumbering on the way
while k > i
BBSi = readbbs(k)
writebbs(j, BBSi)
j--
k--
endwhile
else
j = 1
endif

;Write in the new BBS
writebbs(j, BBS)
strfmt TaskItem "%s`t`t`t%d`t0" BBSName j
endproc


  3 Responses to “Category : Communication (modem) tools and utilities
Archive   : MRUN200.ZIP
Filename : MRUN200C.WAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/