 Rem File: Dndutil2 for Dndbbs Version v5.0a Release r2.0 Tweak t6.0a
 Rem $Include: 'dndutil.inc'
 Rem $Include: 'datim.bi'

Sub Edit.Password
 On Local Error Goto Error.Trap22
 Dim File.Byte As String*1
 Call Read.Dndutil.Cfg(VarX1,VarX2)
 Call Passwrd8(Var)
 If Var=False Then
    Exit Sub
 Endif
 Call Edit.Status.Line
 Do
    Color 15,0
    If Quiet.Mode Then
       Print "Executable password editor(quiet mode):"
    Else
       Print "Executable password editor:"
    Endif
    If Quiet.Mode Then Goto NextLoop
    Color 14,0
    Print "Filename selections:"
    Color 15,0
    Print "[1]Dndbbs";
    If Debug.Mode Then
       FileName=DND.Path+"DNDBBS.EXE"
       Gosub CheckPassword
       If Var Then Print " ("+Password$+")";
    Endif
    Print

    Print "[2]Dndcnfg";
    If Debug.Mode Then
       FileName=DND.Path+"DNDCNFG.EXE"
       Gosub CheckPassword
       If Var Then Print " ("+Password$+")";
    Endif
    Print

    Print "[3]Dndcnvt";
    If Debug.Mode Then
       FileName=DND.Path+"DNDCNVT.EXE"
       Gosub CheckPassword
       If Var Then Print " ("+Password$+")";
    Endif
    Print

    Print "[4]Dndcnvt2";
    If Debug.Mode Then
       FileName=DND.Path+"DNDCNVT2.EXE"
       Gosub CheckPassword
       If Var Then Print " ("+Password$+")";
    Endif
    Print

    Print "[5]Dndedit";
    If Debug.Mode Then
       FileName=DND.Path+"DNDEDIT.EXE"
       Gosub CheckPassword
       If Var Then Print " ("+Password$+")";
    Endif
    Print

    Print "[6]Dndinit";
    If Debug.Mode Then
       FileName=DND.Path+"DNDINIT.EXE"
       Gosub CheckPassword
       If Var Then Print " ("+Password$+")";
    Endif
    Print

    Print "[7]Dndutil";
    If Debug.Mode Then
       FileName=DND.Path+"DNDUTIL.EXE"
       Gosub CheckPassword
       If Var Then Print " ("+Password$+")";
    Endif
    Print

    Print "[8]Edit";
    If Debug.Mode Then
       FileName=DND.Path+"EDIT.EXE"
       Gosub CheckPassword
       If Var Then Print " ("+Password$+")";
    Endif
    Print

    Print "[9]Makecnfg";
    If Debug.Mode Then
       FileName=DND.Path+"MAKECNFG.EXE"
       Gosub CheckPassword
       If Var Then Print " ("+Password$+")";
    Endif
    Print

    Print "[10]Dndcnfg2";
    If Debug.Mode Then
       FileName=DND.Path+"DNDCNFG2.EXE"
       Gosub CheckPassword
       If Var Then Print " ("+Password$+")";
    Endif
    Print
NextLoop:
    Color 14,0
    If VarX1 And VarX2 Then
       Print "Enter selection(1-10, C to clearall, S to setall, Q to quit)? ";
    Else
       If VarX1 Then
          Print "Enter selection(1-10, C to clearall, Q to quit)? ";
       Else
          If VarX2 Then
             Print "Enter selection(1-10, S to setall, Q to quit)? ";
          Else
             Print "Enter selection(1-10, Q to quit)? ";
          Endif
       Endif
    Endif
    Var$ = KeyboardLine$
    If Var$ = Nul Then
       Print "Q"
       Exit Do
    Endif
    Print

    If Lcase$(Var$) = "c" Then
       If VarX1 Then
          Call Clear.Passwords
       Endif
       Var$=""
    Endif

    If Lcase$(Var$) = "q" Then
       Exit Do
    Endif
    If Var$ = Chr$(0) + Chr$(79) Then ' end
       Exit Do
    Endif
    Selection1 = INT(VAL(Var$)+.5)
    Selection2 = INT(VAL(Var$)+.5)

    If Lcase$(Var$) = "s" Then
       If VarX2 Then
          Selection1 = 1
          Selection2 = 10
       Endif
    Endif

    If Selection1>=1 And Selection1<=10 Then
       Print "Password?["+Space$(20)+"]";
       Call Password.Mask
       Locate ,,1
       Input.String$=Nul
       Do
          Input.Char$=Nul
          Do
             Input.Char$=Inkey$
             If Len(Input.Char$) Then
                Exit Do
             Endif
          Loop
          If Input.Char$=Chr$(0)+Chr$(0) Then ' ctrl-break
             Input.String$=Nul
             Print
             Goto Exit.Sub
             Exit Do
          Endif
          If Input.Char$=Chr$(3) Then ' ctrl-c
             Input.String$=Nul
             Print
             Goto Exit.Sub
             Exit Do
          Endif
          If Input.Char$=Chr$(13) Then
             Exit Do
          Endif
          If Input.Char$=Chr$(8) Then
             If Len(Input.String$)>0 Then
                Input.String$=Left$(Input.String$,Len(Input.String$)-1)
                Print Chr$(29)+" "+Chr$(29);
             Endif
          Else
             If Asc(Input.Char$)>=0 And Asc(Input.Char$)<=31 Then
                ' eat
             Else
                Input.String$=Input.String$+Input.Char$
                Print Mask$;
             Endif
          Endif
          If Len(Input.String$)=20 Then
             Exit Do
          Endif
       Loop
       Print
       Input.String$=Left$(Input.String$,20)
       Input.String$=Input.String$+Space$(20-Len(Input.String$))
       Call Crypto(Input.String$)
       Password$=Input.String$+Chr$(255)
       VarX5=0
       For Selection=Selection1 To Selection2
          Select Case Selection
          Case 1
             FileName=DND.Path+"dndbbs.exe"
             Gosub SetPasswrd
          Case 2
             FileName=DND.Path+"dndcnfg.exe"
             Gosub SetPasswrd
          Case 3
             FileName=DND.Path+"dndcnvt.exe"
             Gosub SetPasswrd
          Case 4
             FileName=DND.Path+"dndcnvt2.exe"
             Gosub SetPasswrd
          Case 5
             FileName=DND.Path+"dndedit.exe"
             Gosub SetPasswrd
             For Var2=1 To 12 ' A-L
                FileName=DND.Path+"dndedit"+Chr$(Var2+64)+".exe"
                Gosub SetPasswrd
             Next
          Case 6
             FileName=DND.Path+"dndinit.exe"
             Gosub SetPasswrd
          Case 7
              FileName=DND.Path+"dndutil.exe"
              Gosub SetPasswrd
          Case 8
              FileName=DND.Path+"edit.exe"
              Gosub SetPasswrd
              For Var2=1 To 15
                 FileName=DND.Path+"editcmd"+Hex$(Var2)+".exe"
                 Gosub SetPasswrd
              Next
              FileName=DND.Path+"editcmdg.exe"
              Gosub SetPasswrd
              FileName=DND.Path+"editedit.exe"
              Gosub SetPasswrd
          Case 9
             FileName=DND.Path+"makecnfg.exe"
             Gosub SetPasswrd
          Case 10
             FileName=DND.Path+"dndcnfg2.exe"
             Gosub SetPasswrd
          End Select
       Next
       If Quiet.Mode=0 Then
          Color 15,0
          Select Case VarX5
          Case 0
             Print "No executable file password set."
          Case 1
             Print "Total"+Str$(VarX5)+" executable file password set."
          Case Else
             Print "Total"+Str$(VarX5)+" executable file passwords set."
          End Select
          Print "-more-";
          Do
             If Len(Inkey$) Then print : exit do
          Loop
       Endif
    Endif
 Loop
Exit.Sub:
 Call Clear.Status.Line
 Exit Sub

SetPasswrd:
 Close #1
 If Dir$(FileName)=Nul Then
    Print "Filename "+FileName+" not found."
    Filename=Nul
    Return
 Endif
 VarX5=VarX5+1
 If Quiet.Mode=0 Then
    Print "Filename "+Filename+" set."
    If VarX5=20 Then
       Print "-more-";
       Do
          If Len(Inkey$) Then Print : Exit Do
       Loop
    Endif
 Endif
 Open FileName For Binary As #1
 File.Length!=Lof(1)
 Get 1,File.Length!,File.Byte
 Byte.Value=Asc(File.Byte)
 If Byte.Value=255 Then
    Password.Position=False
    For File.Position!=File.Length!-20! To File.Length!
       Password.Position=Password.Position+1
       File.Byte=Mid$(Password$,Password.Position,1)
       Put 1,File.Position!,File.Byte
    Next
 Else
    For Password.Position=1 To 21
       File.Length!=File.Length!+1!
       File.Byte=Mid$(Password$,Password.Position,1)
       Put 1,File.Length!,File.Byte
    Next
 EndIf
 Close #1
 Return

CheckPassword:
 Var=False
 Close #TempFile1
 OPEN FileName FOR BINARY AS #TempFile1
 File.Length! = LOF(TempFile1)
 GET #TempFile1, File.Length!, File.Byte
 Var2 = ASC(File.Byte)
 Password$ = Nul
 IF Var2 = 255 THEN
    Var=True
    FOR File.Position! = File.Length! - 20 TO File.Length! - 1
       GET #TempFile1, File.Position!, File.Byte
       Password$ = Password$ + File.Byte
    NEXT
    Call Crypto(Password$)
    Password$ = Rtrim$(Password$)
    If Password$=Nul Then
       Var=False
    Endif
 Endif
 Return
Error.Resume22:
 Exit Sub
Error.Trap22:
 Resume Error.Resume22
End Sub

Sub Clear.Passwords
 On Local Error Goto Error.Trap22a
 Dim File.Byte As String*1
 VarX5=0
 For Selection=1 To 10
    Input.String$=Space$(20)
    Call Crypto(Input.String$)
    Password$=Input.String$+Chr$(255)
    Select Case Selection
    Case 1
       FileName=DND.Path+"dndbbs.exe"
       Gosub SetPasswrd2
    Case 2
       FileName=DND.Path+"dndcnfg.exe"
       Gosub SetPasswrd2
    Case 3
       FileName=DND.Path+"dndcnvt.exe"
       Gosub SetPasswrd2
    Case 4
       FileName=DND.Path+"dndcnvt2.exe"
       Gosub SetPasswrd2
    Case 5
       FileName=DND.Path+"dndedit.exe"
       Gosub SetPasswrd2
       For Var2=1 To 12 ' A-L
          FileName=DND.Path+"dndedit"+Chr$(Var2+64)+".exe"
          Gosub SetPasswrd2
       Next
    Case 6
       FileName=DND.Path+"dndinit.exe"
       Gosub SetPasswrd2
    Case 7
       FileName=DND.Path+"dndutil.exe"
       Gosub SetPasswrd2
    Case 8
       FileName=DND.Path+"edit.exe"
       Gosub SetPasswrd2
       For Var2=1 To 15
          FileName=DND.Path+"editcmd"+Hex$(Var2)+".exe"
          Gosub SetPasswrd2
       Next
       FileName=DND.Path+"editcmdg.exe"
       Gosub SetPasswrd2
       FileName=DND.Path+"editedit.exe"
       Gosub SetPasswrd2
    Case 9
       FileName=DND.Path+"makecnfg.exe"
       Gosub SetPasswrd2
    Case 10
       FileName=DND.Path+"dndcnfg2.exe"
       Gosub SetPasswrd2
    End Select
 Next
 Color 15, 0
 If Quiet.Mode=0 Then
    If VarX5=1 Then
       Print "Total"+Str$(VarX5)+" executable file password cleared."
    Else
       Print "Total"+Str$(VarX5)+" executable file passwords cleared."
    Endif
    Print "-more-";
    Do
       If Len(Inkey$) Then print : exit do
    Loop
 Endif
 Exit Sub

SetPasswrd2:
 Close #1
 If Dir$(FileName)=Nul Then
    Return
 Endif
 VarX5=VarX5+1
 If Quiet.Mode=0 Then
    Color 14,0
    Print "Filename "+Filename+" reset."
    If VarX5=20 Then
       Color 15,0
       Print "-more-";
       Do
          If Len(Inkey$) Then Print : Exit Do
       Loop
    Endif
 Endif
 Open FileName For Binary As #1
 File.Length!=Lof(1)
 Get 1,File.Length!,File.Byte
 Byte.Value=Asc(File.Byte)
 If Byte.Value=255 Then
    Password.Position=False
    For File.Position!=File.Length!-20! To File.Length!
       Password.Position=Password.Position+1
       File.Byte=Mid$(Password$,Password.Position,1)
       Put 1,File.Position!,File.Byte
    Next
 Else
    For Password.Position=1 To 21
       File.Length!=File.Length!+1!
       File.Byte=Mid$(Password$,Password.Position,1)
       Put 1,File.Length!,File.Byte
    Next
 EndIf
 Close #1
 Return
Error.Resume22a:
 Exit Sub
Error.Trap22a:
 Resume Error.Resume22a
End Sub

' checks keyboard buffer
FUNCTION KeyIS
 InregsX.AX = &H0100
 CALL InterruptX(&H16, InregsX, OutregsX)
 IF (OutregsX.Flags AND &H40) = &H40 THEN
    KeyIS = False
 ELSE
    KeyIS = True
 END IF
END FUNCTION

' reads character directly from keyboard including extended keys.
FUNCTION KeyboardChar$
 InregsX.AX = &H0000
 CALL InterruptX(&H16, InregsX, OutregsX)
 Key1 = (OutregsX.AX AND &HFF)
 IF Key1 = False THEN ' extended key
    Key2 = (OutregsX.AX AND &HFF00) / 256
    KeyboardChar$ = CHR$(0) + CHR$(Key2)
 ELSE
    KeyboardChar$ = CHR$(Key1)
 END IF
END FUNCTION

' uses direct keyboard input to get an input line during redirected input.
FUNCTION KeyboardLine$
 T! = TIMER
 Var$ = Nul
 DO
    E! = TIMER - T!
    IF E! < 0! THEN E! = E! + 86400!
    IF E! >= 1! THEN
       GOSUB DisplayLine
       T! = TIMER
    END IF
    LOCATE ,,1
    IF KeyIS THEN ' check keyboard
       Var2$ = KeyboardChar$ ' get character
       Select Case Len(Var2$)
       Case 2
          SELECT CASE Var2$
          CASE CHR$(0) + CHR$(0) ' control-break
             Var$ = Chr$(0) + Chr$(79)
             EXIT DO
          CASE CHR$(0) + CHR$(79) ' end
             Var$ = Chr$(0) + Chr$(79)
             EXIT DO
          CASE CHR$(0) + CHR$(147) ' ctrl-del
             Var$ = Chr$(0) + Chr$(79)
             EXIT DO
          CASE CHR$(0) + CHR$(83) ' delete
             Debug = NOT Debug
             GOSUB DisplayLine ' toggle statusline
          CASE CHR$(0) + CHR$(82) ' insert
             GOSUB InsertChar
          END SELECT
       Case 1
          SELECT CASE Var2$
          CASE CHR$(3) ' control-c
             Var$ = Chr$(0) + Chr$(79)
             EXIT DO
          CASE CHR$(13) ' return
             EXIT DO
          CASE CHR$(27) ' escape
             FOR V% = LEN(Var$) TO 1 STEP -1
                IF POS(0) > 1 THEN ' check cursor location
                   LOCATE CSRLIN, POS(0) - 1, 0
                   PRINT " ";
                   LOCATE CSRLIN, POS(0) - 1, 1
                ELSE ' line-wrap
                   LOCATE CSRLIN - 1, 80, 0
                   PRINT " ";
                   LOCATE CSRLIN - 1, 80, 1
                END IF
             NEXT   
             Var$ = Nul
          CASE CHR$(8) ' backspace
             IF LEN(Var$) > 0 THEN
                Var$ = LEFT$(Var$, LEN(Var$) - 1)
                IF POS(0) > 1 THEN ' check cursor location
                   LOCATE CSRLIN, POS(0) - 1, 0
                   PRINT " ";
                   LOCATE CSRLIN, POS(0) - 1, 1
                ELSE ' line-wrap
                   LOCATE CSRLIN - 1, 80, 0
                   PRINT " ";
                   LOCATE CSRLIN - 1, 80, 1
                END IF
             END IF
          CASE ELSE ' store input
             PRINT Var2$;
             LOCATE , , 1
             Var$ = Var$ + Var2$
          END SELECT
       End Select
    END IF
 LOOP

 ' return input line
 KeyboardLine$ = Var$
 EXIT FUNCTION

DisplayLine:
IF Debug THEN
   X = CSRLIN
   Y = POS(0)
   LOCATE Max.Row, 1, 1
   COLOR 15, 1
   Var2#=Fre(-1)+Fre("A") ' far+near
   Var2$=Format$(Var2#,"#,##0.00;;")
   S$ = "Dndutil utility - Free RAM: " + Var2$ + " bytes."
   S$ = S$ + SPACE$(80 - LEN(S$))
   PRINT S$;
   COLOR 15, 0
   LOCATE X, Y, 1
ELSE
   X = CSRLIN
   Y = POS(0)
   LOCATE Max.Row, 1, 1
   COLOR 15, 1
   S$ = "Dndutil utility v" + Version$ + " r" + Release$ + " t" + Tweak$ + " " + Format$(Now, "mm-dd-yyyy") + " " + Format$(Now, "hh:mm:ss")
   S$ = S$ + SPACE$(80 - LEN(S$))
   PRINT S$;
   COLOR 15, 0
   LOCATE X, Y, 1
END IF
RETURN

InsertChar:
 X2 = CSRLIN
 Y2 = POS(0)
 COLOR 15, 1
 LOCATE Max.Row, 1, 1
 Var2$ = "Enter 3-digit ascii code:"
 Var2$ = Var2$ + SPACE$(80 - LEN(Var2$))
 PRINT Var2$;
 Ascii$ = Nul
 DO
    LOCATE ,,1
    Var3$ = INKEY$
    IF Var3$ = CHR$(13) THEN ' return
       IF LEN(Ascii$) = 3 THEN
          EXIT DO
       END IF
    END IF
    IF Var3$ = CHR$(27) THEN ' escape
        Var3$ = Nul
        IF LEN(Ascii$) THEN
           Ascii$ = Nul
           COLOR 15, 1
           LOCATE Max.Row, 1, 1
           Var2$ = "Enter 3-digit ascii code: "
           Var2$ = Var2$ + SPACE$(80 - LEN(Var2$))
           PRINT Var2$;
        END IF
     END IF
     IF Var3$ = CHR$(8) THEN ' backspace
        Var3$ = Nul
        IF LEN(Ascii$) THEN
           Ascii$ = LEFT$(Ascii$, LEN(Ascii$) - 1)
           COLOR 15, 1
           LOCATE Max.Row, 1, 1
           Var2$ = "Enter 3-digit ascii code: " + Ascii$
           Var2$ = Var2$ + SPACE$(80 - LEN(Var2$))
           PRINT Var2$;
        END IF
     END IF
     IF Var3$ >= "0" AND Var3$ <= "9" THEN
        IF LEN(Ascii$) < 3 THEN
           Ascii$ = Ascii$ + Var3$
           LOCATE Max.Row, 1, 1
           Var2$ = "Enter 3-digit ascii code: " + Ascii$
           Var2$ = Var2$ + SPACE$(80 - LEN(Var2$))
           PRINT Var2$;
        END IF
     END IF
  LOOP
  GOSUB DisplayLine
  COLOR 15, 0
  LOCATE X2, Y2, 1
  IF VAL(Ascii$) >= 0 AND VAL(Ascii$) <= 255 THEN
     Var$ = Var$ + CHR$(VAL(Ascii$))
     PRINT CHR$(VAL(Ascii$));
  END IF
  RETURN
END FUNCTION

' make mask area for teletypes
Sub PassWord.Mask
 On Local Error Goto ErrorTrp6z
 Call Back.Space2(21)
 Strng=String$(20,"*")
 Print Strng;
 Call Back.Space2(20)
 Strng=String$(20,"X")
 Print Strng;
 Call Back.Space2(20)
 Strng=String$(20,"|")
 Print Strng;
 Call Back.Space2(20)
 Strng=String$(20,"#")
 Print Strng;
 Call Back.Space2(20)
 Strng=String$(20,32)
 Print Strng;
 Call Back.Space2(20)
 Exit Sub
ErrorRsm6z:
 Exit Sub
ErrorTrp6z:
 Security.Guard=False
 Resume ErrorRsm6z
End Sub

' non-destructive backspace
Sub Back.Space2(Var)
 On Local Error Goto Error.Trap27z
 For Var2=1 To Var
    Locate Csrlin,Pos(0)-1,1
 Next
Error.Resume27z:
 Exit Sub
Error.Trap27z:
 Resume Error.Resume27z
End Sub

Sub Edit.Status.Line
 On Local Error Goto Error.Trap58
 Var$="Dndutil utility v" + Version$ + " r" + Release$ + " t" + Tweak$ + " " + Format$(Now, "mm-dd-yyyy") + " " + Format$(Now, "hh:mm:ss")
 Var$=Left$(Var$,79)
 Var$=Var$+Space$(79-Len(Var$))
 Call Display.Status.Line(True,Var$)
Error.Resume58:
 Exit Sub
Error.Trap58:
 Resume Error.Resume58
End Sub

Sub Clear.Status.Line
 On Local Error Goto Error.Trap58a
 Var$=Space$(79)
 Call Display.Status.Line(False,Var$)
Error.Resume58a:
 Exit Sub
Error.Trap58a:
 Resume Error.Resume58a
End Sub

Sub Display.Status.Line(Var,Var$)
 On Local Error Goto Error.Trap29
 Call Cursor(False)
 If Var Then
    Color 14,1
 Else
    Color 15,0
 Endif
 Locate Max.Row,1,0
 Print Var$;
 If Var Then
    Color 0, 1
 Else
    Color 7, 0
 Endif
 Locate Max.Row,80
 Print " ";
 Locate Max.Row-1,1,1
 Graphics.Off=False
 Call Restore.Color
 Call Cursor(True)
Error.Resume29:
 Exit Sub
Error.Trap29:
 Resume Error.Resume29
End Sub

Sub Cursor(Var)
 On Local Error Goto Error.Trap42
 If Local.ANSI.Color Or Local.Avatar.Color Then
    Select Case Var
    Case False
       Call VideoInt(3,0)
       Cursor.Position=OutregsX.DX
    Case True
       Call VideoInt(2,Cursor.Position)
    End Select
 Else
    Select Case Var
    Case False
       CursorX=Csrlin
       CursorY=Pos(0)
    Case True
       Locate CursorX,CursorY,1
    End Select
 Endif
Error.Resume42:
 Exit Sub
Error.Trap42:
 Resume Error.Resume42
End Sub

Sub Restore.Color
 On Local Error Goto Error.Trap43
 Call ScreenANSI(1,37,15)
 If Graphics.Off Then
    Call ScreenANSI(4,37,15)
 Else
    Call ScreenANSI(4,Color.Code,Avatar.Code)
 Endif
Error.Resume43:
 Exit Sub
Error.Trap43:
 Resume Error.Resume43
End Sub

Sub ScreenANSI(Var1,Var2,Var3)
 On Local Error Goto ErrMain19
 Call Local.ANSI(Var1,Var2,Var3)
 If TempD$<>Nul Then
    Call Scrn(TempD$)
 Endif
MainExit19:
 Exit Sub
ErrMain19:
 Resume MainExit19
End Sub

Sub Local.ANSI(Var1,Var2,Var3)
 On Local Error Goto ErrMain18
 If Local.ANSI.Color Then
    Call ANSI(Var1,Var2,Var3)
    Exit Sub
 Endif
 If Local.Avatar.Color Then
    Call Avatar(Var1,Var2,Var3)
    Exit Sub
 Endif
 TempD$=Nul
 Select Case Var1
 Case 1
    Call Convert.Color(Var2,True)
 Case 2
    Locate Var2,Var3,1
 Case 3
    Cls
 Case 4
    Call Convert.Color(Var2,False)
 Case 5
    Call Convert.Color(Var2,False)
 End Select
MainExit18:
 Exit Sub
ErrMain18:
 Resume MainExit18
End Sub

Sub Scrn(Var$)
 On Local Error Goto ErrMain15
 Dim Scrn.Row As Integer
 Scrn.Row=Max.Row-2
 If Local.ANSI.Color Or Local.Avatar.Color Then
    Call VideoInt(3,0)
    VarR=Int(OutregsX.DX/&HFF)
    VarC=(OutregsX.DX And &HFF)+1
 Else
    VarR=Csrlin-1
    VarC=Pos(0)
 Endif
 Select Case VarR
 Case Is>Scrn.Row
    Call Scroll.Screen
 Case Scrn.Row
    If VarC>User.LineLength Then
       Call Put.Screen(Chr$(13))
       If User.Linefeeds=False Then
          Call Put.Screen(Chr$(10))
       Endif
       Call Scroll.Screen
       If Var$=Chr$(13) Then
	  Exit Sub
       Endif
    Endif
    If Var$=Chr$(13) Then
       Call Scroll.Screen
       Exit Sub
    Endif
 End Select
 Call Put.Screen(Var$)
MainExit15:
 Exit Sub
ErrMain15:
 Resume MainExit15
End Sub

Sub Scroll.Screen
 On Local Error Goto ErrMain16
 Dim Scroll.Row As Integer
 Scroll.Row=Max.Row-2
 Call VideoInt(6,Scroll.Row*256+&H4F)
 Call VideoInt(2,Scroll.Row*256)
 Locate Max.Row-1,1,1
MainExit16:
 Exit Sub
ErrMain16:
 Resume MainExit16
End Sub

Sub ANSI(VarX,VarY,VarZ)
 On Local Error Goto ErrMain21
 TempD$=Nul
 Select Case VarX
 Case 1
    TempD$=Chr$(27)+"[0;"+Mid$(Str$(VarY),2)+"m"
 Case 2
    TempD$=Chr$(27)+"["+Mid$(Str$(VarY),2)+";"+Mid$(Str$(VarZ),2)+"H"
 Case 3
    TempD$=Chr$(27)+"[2J"
 Case 4
    TempD$=Chr$(27)+"[1;"+Mid$(Str$(VarY),2)+"m"
 Case 5
    TempD$=Chr$(27)+"["+Mid$(Str$(VarY),2)+"m"
 End Select
MainExit21:
 Exit Sub
ErrMain21:
 Resume MainExit21
End Sub

Sub Avatar(VarX,VarY,VarZ)
 On Local Error Goto ErrMain22
 TempD$=Nul
 Select Case VarX
 Case 1, 4, 5
    TempD$=Chr$(22)+Chr$(1)+Chr$(VarZ)
 Case 2
    TempD$=Chr$(22)+Chr$(8)+Chr$(VarY)+Chr$(VarZ)
 Case 3
    TempD$=Chr$(12)
 End Select
MainExit22:
 Exit Sub
ErrMain22:
 Resume MainExit22
End Sub

Sub Convert.Color(VarX,VarY)
 On Local Error Goto ErrMain23
 VarF=False
 VarB=False
 Select Case VarX
 Case 30
    VarF=8
 Case 31
    VarF=12
 Case 32
    VarF=10
 Case 33
    VarF=14
 Case 34
    VarF=9
 Case 35
    VarF=13
 Case 36
    VarF=11
 Case 37
    VarF=15
 Case 40
    VarB=8
 Case 41
    VarB=12
 Case 42
    VarB=10
 Case 43
    VarB=14
 Case 44
    VarB=9
 Case 45
    VarB=13
 Case 46
    VarB=11
 Case 47
    VarB=15
 End Select
 If VarF Then
    If VarY Then
       VarF=VarF-8
    Endif
    Color VarF, 0
 Else
    If VarB Then
       VarB=VarB-8
       Color ,VarB
    Endif
 Endif
MainExit23:
 Exit Sub
ErrMain23:
 Resume MainExit23
End Sub

Sub Put.Screen(Var1$)
 On Local Error Goto ErrMain17
 If Local.ANSI.Color Or Local.Avatar.Color Then
    For VarX=1 To Len(Var1$)
       VarY=Asc(Mid$(Var1$,VarX,1))
       If VarY=255 Then
          VarY=32
       Endif
       Call StdinInt(6,VarY)
    Next
 Else
    For VarX=1 To Len(Var1$)
       Var2=Asc(Mid$(Var1$,VarX,1))
       Select Case Var2
       Case 10
	  Print
       Case 13
	  Print;
       Case 255
          Print " ";
       Case Else
	  Print Chr$(Var2);
       End Select
    Next
 Endif
MainExit17:
 Exit Sub
ErrMain17:
 Resume MainExit17
End Sub

' reads in config file for dndutil utility.
Sub Read.Dndutil.Cfg(VarX1,VarX2)
 On Local Error Goto ErrResume13x
 VarX1=True
 VarX2=True
 Filename=DND.Path+"DNDPASS.CFG"
 If Dir$(Filename)=Nul Then Exit Sub
 Close #TempFile1
 Open Filename For Input As #TempFile1
 Do
    If Eof(TempFile1) Then
       Exit Do
    Endif
    Line Input #TempFile1,Data.Line$
    Data.Line$=Rtrim$(Ltrim$(Ucase$(Data.Line$)))
    If Len(Data.Line$) Then
       If Left$(Data.Line$,1)<>";" Then
          VarX=Instr(Data.Line$,"=")
          If VarX Then
             Var1$=Left$(Data.Line$,VarX-1)
             Var2$=Mid$(Data.Line$,VarX+1)
             Var1$=Rtrim$(Ltrim$(Var1$))
             Var2$=Rtrim$(Ltrim$(Var2$))
             If Var1$="QUIETMODE" Then
                Select Case Lcase$(Var2$)
                Case "-1", "true", "on"
                   Quiet.Mode=-1
                Case "0", "false", "off"
                   Quiet.Mode=0
                End Select
             Endif
             If Var1$="DEBUGMODE" Then
                Select Case Lcase$(Var2$)
                Case "-1", "true", "on"
                   Debug.Mode=-1
                Case "0", "false", "off"
                   Debug.Mode=0
                End Select
             Endif
             If Var1$="CLEARALL" Then
                Select Case Lcase$(Var2$)
                Case "0", "false", "off"
                   VarX1=0
                End Select
             Endif
             If Var1$="SETALL" Then
                Select Case Lcase$(Var2$)
                Case "0", "false", "off"
                   VarX2=0
                End Select
             Endif
          Endif
       Endif
    Endif
 Loop
ErrExit13x:
 Exit Sub
ErrResume13x:
 Resume ErrExit13x
End Sub

Sub Write.Options
 On Local Error Goto Error.Trap22x
 DIM Quote2 AS STRING * 1
 Quote2 = CHR$(34)
 DND.Path=Environ$("DNDBBS")
 If DND.Path<>Nul Then
    If Right$(DND.Path,1)<>"\" Then
       DND.Path=DND.Path+"\"
    Endif
 Endif
 Close #TempFile1
 Open DND.Path+"option"+NodeX+".cfg" For Output As TempFile1
 If NodeX=Nul Then
    Print #Tempfile1, ";options data blocks for node <nul>"
 Else
    Print #Tempfile1, ";options data blocks for node "+NodeX
 Endif
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD999]"
 Print #Tempfile1, "Main.Loop.Update=4"
 Print #Tempfile1, "bank.count=16"
 Print #Tempfile1, "mail.count=32"
 Print #Tempfile1, "fill.count=2"
 Print #Tempfile1, "persist.count1=1"
 Print #Tempfile1, "persist.count2=1"
 Print #Tempfile1, "persist.count3=1"
 Print #Tempfile1, "display.bank.interest=-1"
 Print #Tempfile1, "display.new.mail=-1"
 Print #Tempfile1, "display.bank.once=-1"
 Print #Tempfile1, "display.mail.once=-1"
 Print #Tempfile1, "check.inventory=64"
 Print #Tempfile1, "check.room=64"
 Print #Tempfile1, "check.user=64"
 Print #Tempfile1, ";allow.look.repair=0"
 Print #Tempfile1, ";allow.look.repair.user=0"
 Print #Tempfile1, ";allow.look.repair.room=0"
 Print #Tempfile1, ";allow.look.repair.container=0"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[RAMDRIVE]"
 Print #Tempfile1, ";specifies location of cmd*.exe modules"
 Print #Tempfile1, ";CMD999=-1"
 Print #Tempfile1, ";CMD998=-1"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[DNDBBS]"

 For V2=1 to 10
    Print #Tempfile1, "menu"+ltrim$(str$(V2))+"=-1"
 Next
 Print #Tempfile1, Nul
 For V2=1 to 26
    Print #Tempfile1, "alt-"+chr$(V2+96)+"=-1"
 Next
 Print #Tempfile1, Nul
 For V2=0 to 9
    Print #Tempfile1, "alt-"+ltrim$(str$(V2))+"=-1"
 Next
 Print #Tempfile1, Nul

 Print #Tempfile1, "loop.count=16"
 Print #Tempfile1, "loop.message={FENothing happens [1]!"
 Print #Tempfile1, Nul
 Print #Tempfile1, ";disable border characters"
 Print #Tempfile1, ";border=0"
 Print #Tempfile1, Nul
 Print #Tempfile1, ";disable high ascii border characters"
 Print #Tempfile1, ";borderchar=0"
 Print #Tempfile1, Nul
 Print #Tempfile1, ";override copyright screen count"
 Print #Tempfile1, ";copyscrn.count=10"
 Print #Tempfile1, Nul
 Print #Tempfile1, ";override opening screen initial menu selection"
 Print #Tempfile1, ";init.field=1"
 Print #Tempfile1, Nul
 Print #Tempfile1, ";disable.reserved.words=0"
 Print #Tempfile1, ";disable.reserved.words.data=0"
 Print #Tempfile1, Nul
 Print #Tempfile1, ";override main screen date and time"
 Print #Tempfile1, ";date.display=dd mm"
 Print #Tempfile1, ";time.display=hh:mm"
 Print #Tempfile1, Nul
 Print #Tempfile1, ";override statusline color"
 Print #Tempfile1, "debug.color="+Quote2+"{FE"+Quote2
 Print #Tempfile1, "debug.color2="+Quote2+"{B1{FE"+Quote2
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CHAT]"
 Print #Tempfile1, "; Alt keys for chat strings"
 Print #Tempfile1, "Alt-1=Hi [1]!"
 Print #Tempfile1, "Alt-2=It's now [3]."
 Print #Tempfile1, "Alt-3=Hehehe"
 Print #Tempfile1, "Alt-4=<SPLAT>"
 Print #Tempfile1, "Alt-5="
 Print #Tempfile1, "Alt-6="
 Print #Tempfile1, "Alt-7="
 Print #Tempfile1, "Alt-8="
 Print #Tempfile1, "Alt-9="
 Print #Tempfile1, "Alt-0="
 Print #Tempfile1, "Alt--="
 Print #Tempfile1, "Alt-+="
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[EQUATE]"
 Print #Tempfile1, "Playwav=-1"
 Print #Tempfile1, "Volume=10"
 Print #Tempfile1, "Baseport=220"
 Print #Tempfile1, "DmaChannel=1"
 Print #Tempfile1, "Wavepause=2"
 Print #Tempfile1, "sound.frequency=900"
 Print #Tempfile1, "sound.duration=6"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[LOGIN]"
 Print #Tempfile1, "Allow.Display.Users=-1"
 Print #Tempfile1, "Allow.Display.Special.Users=-1"
 Print #Tempfile1, "Allow.Sysop.List=-1"
 Print #Tempfile1, "Allow.Sysop.Search=-1"
 Print #Tempfile1, "Allow.Search.Specs=-1"
 Print #Tempfile1, "Allow.Password.Display=-1"
 Print #Tempfile1, "Make.Codename.Input=0"
 Print #Tempfile1, "Wishs.Left=3"
 Print #Tempfile1, "Newuser.Inventory=3"
 Print #Tempfile1, "Inventory1=222"
 Print #Tempfile1, "Start.Hidden=-1"
 Print #Tempfile1, "Newuser.Level=2"
 Print #Tempfile1, "Newuser.Room=51"
 Print #Tempfile1, "Newuser.Gold=10000"
 Print #Tempfile1, ";Action.Prompt=" + Quote2 + "Next? " + Quote2
 Print #Tempfile1, "Allow.Login.Chars=-"
 Print #Tempfile1, "Additional.Login.Chars=@"
 Print #Tempfile1, Nul
 Print #Tempfile1, ";login disable"
 Print #Tempfile1, ";Disable.Self=0"
 Print #Tempfile1, ";Disable.The=0"
 Print #Tempfile1, ";Disable.God=0"
 Print #Tempfile1, ";Disable.Numeric=0"
 Print #Tempfile1, ";Disable.Reserved.Words=0"
 Print #Tempfile1, ";Disable.Reserved.Words.Data=0"
 Print #Tempfile1, Nul
 Print #Tempfile1, ";disable codenames from login"
 Print #Tempfile1, ";Disable.Codename1=girl_cat"
 Print #Tempfile1, Nul
 Print #Tempfile1, "Login.Tries=10"
 Print #Tempfile1, "Login.Tries2=5"
 Print #Tempfile1, "Login.Tries3=5"
 Print #Tempfile1, Nul
 Print #Tempfile1, ";Check.Remote.Ansi=0"
 Print #Tempfile1, ";Check.Remote.Avatar=0"
 Print #Tempfile1, Nul
 Print #Tempfile1, ";Bypass.Relogin.Disabled=0"
 Print #Tempfile1, ";Always.Allow.DM.Relogin=0"
 Print #Tempfile1, Nul
 Print #Tempfile1, ";Read.System.News=0"
 Print #Tempfile1, ";Check.New.Mail=0"
 Print #Tempfile1, Nul
 Print #Tempfile1, ";required intelligence to suicide"
 Print #Tempfile1, "required.intelligence=3"
 Print #Tempfile1, ";required level to suicide"
 Print #Tempfile1, "required.level=3"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[REBOOT]"
 Print #Tempfile1, "Allow.Abort=-1"
 Print #Tempfile1, "Allow.Abortall=-1"
 Print #Tempfile1, "Allow.Listnets=-1"
 Print #Tempfile1, "Allow.Restart=-1"
 Print #Tempfile1, "Allow.Shutdown=-1"
 Print #Tempfile1, "Allow.Restartall=-1"
 Print #Tempfile1, "Allow.Shutdownall=-1"
 Print #Tempfile1, "Allow.Dos.Coldboot=0"
 Print #Tempfile1, "Allow.Dos.Warmboot=0"
 Print #Tempfile1, "Allow.Dos.Fossil.Coldboot=-1"
 Print #Tempfile1, "Allow.Dos.Fossil.Warmboot=-1"
 Print #Tempfile1, "Allow.Local.Reboot=-1"
 Print #Tempfile1, "Allow.Remote.Reboot=-1"
 Print #Tempfile1, "Restart.Time=1"
 Print #Tempfile1, "Restart.Message=Dndbbs restart"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CONTAIN]"
 Print #Tempfile1, "Only.Thieves.Can.Search.Online.User=True"
 Print #Tempfile1, "Search.Container.Level.Online.User=10"
 Print #Tempfile1, "Only.Thieves.Can.Search.Offline.User=True"
 Print #Tempfile1, "Search.Container.Level.Offline.User=10"
 Print #Tempfile1, "Only.Thieves.Can.Search.Container.Of.Online.User=True"
 Print #Tempfile1, "Search.Container.Level.Item.Online.User=10"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[MODEM]"
 Print #Tempfile1, "Also.Allow.Data.Pack=-1"
 Print #Tempfile1, "Max.Ring.Count=10"
 Print #Tempfile1, "Display.Menu.Timer=30"
 Print #Tempfile1, Nul
 Print #Tempfile1, ";only pack if no users online"
 Print #Tempfile1, ";Only.No.Pack=-1"
 Print #Tempfile1, Nul
 Print #Tempfile1, ";only pack if less than 16 users online"
 Print #Tempfile1, ";Only.No.Pack=16"
 Print #Tempfile1, ";default baud rate setting"
 Print #Tempfile1, "Default.Baud=9600"
 Print #Tempfile1, ";Ignore.Baud=<anything>"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[TELNET]"
 Print #Tempfile1, "Bbs.Name=DNDBBS"
 Print #Tempfile1, "Door.Name=JOE UZERNAME"
 Print #Tempfile1, "Door.Time=30"
 Print #Tempfile1, "ansi.color=-1"
 Print #Tempfile1, ";Fossil.Mode=-1"
 Print #Tempfile1, ";base.address=3f8"
 Print #Tempfile1, ";baud.rate=9600"
 Print #Tempfile1, ";port.number=1"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD000]"
 Print #Tempfile1, "kill.self=-1"
 Print #Tempfile1, "kill.self.level=2"
 Print #Tempfile1, "required.intelligence=8"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD004]"
 Print #Tempfile1, "Allow.Resurrect.Room=-1"
 Print #Tempfile1, "Allow.Appeal.Page=-1"
 Print #Tempfile1, "Page.Count=10"
 Print #Tempfile1, "Psi.Value=0"
 Print #Tempfile1, "Decrease.Psi.Value=1"
 Print #Tempfile1, "Wav.Sound=-1"
 Print #Tempfile1, "Beep.Sound=-1"
 Print #Tempfile1, ";Sysop.Page.Time1=10:00-12:00"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD005]"
 Print #Tempfile1, "Maximum.Rounds.Counter=-1"
 Print #Tempfile1, "Round.Time.Delay=-1"
 Print #Tempfile1, ";Break.Switch=0"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD008]"
 Print #Tempfile1, "Rob.Success.Equation=" + Quote2 + "RND>.99" + Quote2
 Print #Tempfile1, "Rob.Success.Level=1"
 Print #Tempfile1, "Rob.Success.Gold=1000"
 Print #Tempfile1, "Rob.Lose.Equation=" + Quote2 + "RND<.75" + Quote2
 Print #Tempfile1, "Rob.Lose.Level=1"
 Print #Tempfile1, "Required.Intelligence=10"
 Print #Tempfile1, "Stats.Point.Loss.Equation=" + Quote2 + "RND*7+1" + Quote2
 Print #Tempfile1, "Stats.Point.Loss=1"
 Print #Tempfile1, "Max.Gold=1d308"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD016]"
 Print #Tempfile1, "Bless.Times=100"
 Print #Tempfile1, "Bless.Online.User=" + Quote2 + "RND>.75" + Quote2
 Print #Tempfile1, "Bless.Offline.User=" + Quote2 + "RND>.75" + Quote2
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD017]"
 Print #Tempfile1, "Smash.Open1=" + Quote2 + "RND*INT+1<CONFIG2(33)" + Quote2
 Print #Tempfile1, "Smash.Open2=" + Quote2 + "RND*STR+1<CONFIG2(34)" + Quote2
 Print #Tempfile1, "Smash.Open3=" + Quote2 + "RND<CONFIG1(21)" + Quote2
 Print #Tempfile1, "Smash.Container.Open1=" + Quote2 + "RND*INT+1<CONFIG2(33)" + Quote2
 Print #Tempfile1, "Smash.Container.Open2=" + Quote2 + "RND*STR+1<CONFIG2(34)" + Quote2
 Print #Tempfile1, "Smash.Container.Open3=" + Quote2 + "RND<CONFIG1(21)" + Quote2
 Print #Tempfile1, "Smash.Container=" + Quote2 + "STR<10" + Quote2
 Print #Tempfile1, "Shatter.Container=" + Quote2 + "STR<5" + Quote2
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD018]"
 Print #Tempfile1, "allow.offer.all=0"
 Print #Tempfile1, "maximum.gold.offer=1d300"
 Print #Tempfile1, "allow.add.inv.nonplayer=0"
 Print #Tempfile1, "allow.offer.permanent=0"
 Print #Tempfile1, "offer.gold.value="+Quote2+"config1(15)*mlvl"+Quote2
 Print #Tempfile1, "offer.maximum.gold.value="+Quote2+"config1(15)*mlvl"+Quote2
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD022]"
 Print #Tempfile1, "allow.point.purchase=-1"
 Print #Tempfile1, "point.cost=1000000"
 Print #Tempfile1, "max.points=10"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD110]"
 Print #Tempfile1, "allow.reroll=0"
 Print #Tempfile1, "allow.guest.reroll=0"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD117]"
 Print #Tempfile1, "allow.point.sell=-1"
 Print #Tempfile1, "point.cost=1000000"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD023]"
 Print #Tempfile1, "slot.machine.max.win=1"
 Print #Tempfile1, "slot.machine=on"
 Print #Tempfile1, "poison.bottles=on"
 Print #Tempfile1, "russian.roulette=on"
 Print #Tempfile1, "craps.dice.game=on"
 Print #Tempfile1, "hazard.dice.game=on"
 Print #Tempfile1, "graffiti.wall=on"
 Print #Tempfile1, "hangman.game=on"
 Print #Tempfile1, "rob.casino=on"
 Print #Tempfile1, Nul
 Print #Tempfile1, "Rob.Success.Equation=" + Quote2 + "RND>.99" + Quote2
 Print #Tempfile1, "Rob.Success.Level=1"
 Print #Tempfile1, "Rob.Success.Gold=1000"
 Print #Tempfile1, "Rob.Lose.Equation="+Quote2+"RND<.75"+Quote2
 Print #Tempfile1, "Rob.Lose.Level=1"
 Print #Tempfile1, "Required.Intelligence=10"
 Print #Tempfile1, "Stats.Point.Loss.Equation="+Quote2+"RND*7+1"+Quote2
 Print #Tempfile1, "Stats.Point.Loss=1"
 Print #Tempfile1, Nul
 Print #Tempfile1, "slot.wheel.ghoul=" + Quote2 + "RND<.75" + Quote2
 Print #Tempfile1, "slot.wheel.ghost=" + Quote2 + "RND<.75" + Quote2
 Print #Tempfile1, "slot.wheel.ghast=" + Quote2 + "RND<.75" + Quote2
 Print #Tempfile1, "slot.wheel.demon=" + Quote2 + "RND<.5" + Quote2
 Print #Tempfile1, "slot.wheel.devil=" + Quote2 + "RND<.5" + Quote2
 Print #Tempfile1, "slot.wheel.satan=" + Quote2 + "RND<.5" + Quote2
 Print #Tempfile1, "slot.wheel.death=" + Quote2 + "RND<.25" + Quote2
 Print #Tempfile1, "maximum.slot.machine=20000"
 Print #Tempfile1, Nul
 Print #Tempfile1, "poison.bottle.win.amount=" + Quote2 + "BET+1000*ABS(BOTTLE-CHOICE)+RND*100+1" + Quote2
 Print #Tempfile1, "russian.roulette.win.amount=" + Quote2 + "BET+1000+RND*100+1" + Quote2
 Print #Tempfile1, Nul
 Print #Tempfile1, "graffiti.wall.cost=10000"
 Print #Tempfile1, "hangman.game.cost=2000"
 Print #Tempfile1, "hangman.win.amount=10000"
 Print #Tempfile1, Nul
 Print #Tempfile1, "time.delay=1"
 Print #Tempfile1, "allow.bell=-1"
 Print #Tempfile1, Nul
 Print #Tempfile1, "bottle.bet=2500"
 Print #Tempfile1, "craps.bet=2500"
 Print #Tempfile1, "russian.bet=3000"
 Print #Tempfile1, "dice.bet=3000"
 Print #Tempfile1, "bottle.display=1"
 Print #Tempfile1, "bottle.count=3"
 Print #Tempfile1, "sound.frequency=900"
 Print #Tempfile1, "sound.duration=6"
 Print #Tempfile1, Nul
 Print #Tempfile1, "read.graffiti.wall=-1"
 Print #Tempfile1, "write.graffiti.wall=-1"
 Print #Tempfile1, "search.graffiti.wall=-1"
 Print #Tempfile1, Nul
 Print #Tempfile1, "graffiti.read.cost=1000"
 Print #Tempfile1, "graffiti.search.cost=1000"
 Print #Tempfile1, Nul
 Print #Tempfile1, ";disable.graffiti.text=test;line"
 Print #Tempfile1, "disable.graffiti.char=<"
 Print #Tempfile1, Nul
 Print #Tempfile1, ";toggle.sound=0"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD033]"
 Print #Tempfile1, "Shortcut.keys=on"
 Print #Tempfile1, "ANSI.Prefixes=on"
 Print #Tempfile1, "Function.keys=on"
 Print #Tempfile1, "ANSI.keys=on"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD035]"
 Print #Tempfile1, ";Bless.Self=" + Quote2 + "RND>.75" + Quote2
 Print #Tempfile1, ";Curse.Self=" + Quote2 + "RND>.8" + Quote2
 Print #Tempfile1, "Bless.Self=" + Quote2 + "-1" + Quote2
 Print #Tempfile1, "Curse.Self=" + Quote2 + "-1" + Quote2
 Print #Tempfile1, "Bless.Amount=10"
 Print #Tempfile1, "Curse.Amount=10"
 Print #Tempfile1, "Normal.User=-1"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD036]"
 Print #Tempfile1, "Curse.Times=100"
 Print #Tempfile1, "Curse.Online.User=" + Quote2 + "RND>.8" + Quote2
 Print #Tempfile1, "Curse.Offline.User=" + Quote2 + "RND>.8" + Quote2
 Print #Tempfile1, "Curse.Multiplier=" + Quote2 + "PIE/2" + Quote2
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD037]"
 Print #Tempfile1, "allow.read.oldfiles=-1"
 Print #Tempfile1, "allow.search.substring=-1"
 Print #Tempfile1, "default.start.date=01-01-1980"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD024]"
 Print #Tempfile1, "Trigger.Magical.Trap=" + Quote2 + "INT<RND*6+10" + Quote2
 Print #Tempfile1, "Magical.Trap.Hits=" + Quote2 + "Rnd*10+LVL+C6" + Quote2
 Print #Tempfile1, "Bless.Online.User=" + Quote2 + "RND>.75" + Quote2
 Print #Tempfile1, "Bless.Offline.User=" + Quote2 + "RND>.75" + Quote2
 Print #Tempfile1, "Bless.Self=" + Quote2 + "RND>.75" + Quote2
 Print #Tempfile1, "Curse.Multiplier=" + Quote2 + "RND*3+2" + Quote2
 Print #Tempfile1, "Curse.Online.User=" + Quote2 + "RND>.8" + Quote2
 Print #Tempfile1, "Curse.Offline.User=" + Quote2 + "RND>.8" + Quote2
 Print #Tempfile1, "Curse.Self=" + Quote2 + "RND>.8" + Quote2
 Print #Tempfile1, "Set.Trap.Equation=" + Quote2 + "INT<RND*5+5" + Quote2
 Print #Tempfile1, "Trap.Explodes=" + Quote2 + "INT+WIS<RND*10+5" + Quote2
 Print #Tempfile1, "Trap.Explode.Hits=" + Quote2 + "(RND*10+2)*LVL" + Quote2
 Print #Tempfile1, "Magically.Hide.Object=" + Quote2 + "INT<RND*5+4" + Quote2
 Print #Tempfile1, "required.level=10"
 Print #Tempfile1, "strength.required.equation=" + Quote2 + "STR>=20" + Quote2
 Print #Tempfile1, "intelligence.required.equation=" + Quote2 + "INT>=20" + Quote2
 Print #Tempfile1, "invisible.equation=" + Quote2 + "RND>.2" + Quote2
 Print #Tempfile1, "invisible.count=" + Quote2 + "10" + Quote2
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD042]"
 Print #Tempfile1, "Trigger.Magical.Trap=" + Quote2 + "INT<RND*6+10" + Quote2
 Print #Tempfile1, "Magical.Trap.Hits=" + Quote2 + "Rnd*10+LVL+C6" + Quote2
 Print #Tempfile1, "Bless.Equation=" + Quote2 + "RND>.75" + Quote2
 Print #Tempfile1, "Curse.Equation=" + Quote2 + "RND>.8" + Quote2
 Print #Tempfile1, "Set.Trap.Equation=" + Quote2 + "INT<RND*5+5" + Quote2
 Print #Tempfile1, "Trap.Explodes=" + Quote2 + "INT+WIS<RND*10+5" + Quote2
 Print #Tempfile1, "Trap.Explode.Hits=" + Quote2 + "(RND*10+2)*LVL" + Quote2
 Print #Tempfile1, "required.level=10"
 Print #Tempfile1, "strength.required.equation=" + Quote2 + "STR>=20" + Quote2
 Print #Tempfile1, "intelligence.required.equation=" + Quote2 + "INT>=20" + Quote2
 Print #Tempfile1, "invisible.equation=" + Quote2 + "RND>.2" + Quote2
 Print #Tempfile1, "invisible.count=" + Quote2 + "10" + Quote2
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD044]"
 Print #Tempfile1, "Trigger.Magical.Trap=" + Quote2 + "INT<RND*6+10" + Quote2
 Print #Tempfile1, "Magical.Trap.Hits=" + Quote2 + "Rnd*10+LVL+C6" + Quote2
 Print #Tempfile1, "Bless.Equation=" + Quote2 + "RND>.75" + Quote2
 Print #Tempfile1, "Curse.Equation=" + Quote2 + "RND>.8" + Quote2
 Print #Tempfile1, "Set.Trap.Equation=" + Quote2 + "INT<RND*5+5" + Quote2
 Print #Tempfile1, "Trap.Explodes=" + Quote2 + "INT+WIS<RND*10+5" + Quote2
 Print #Tempfile1, "Trap.Explode.Hits=" + Quote2 + "(RND*10+2)*LVL" + Quote2
 Print #Tempfile1, "required.level=10"
 Print #Tempfile1, "strength.required.equation=" + Quote2 + "STR>=20" + Quote2
 Print #Tempfile1, "intelligence.required.equation=" + Quote2 + "INT>=20" + Quote2
 Print #Tempfile1, "invisible.equation=" + Quote2 + "RND>.2" + Quote2
 Print #Tempfile1, "invisible.count=" + Quote2 + "10" + Quote2
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD049]"
 Print #Tempfile1, ";fire.at.self=0"
 Print #Tempfile1, ";override.check.explodes=0"
 Print #Tempfile1, ";override.discharges.harmless=0"
 Print #Tempfile1, ";override.bang.message=0"
 Print #Tempfile1, ";override.click.message=0"
 Print #Tempfile1, "device.explodes=" + Quote2 + "RND<CONFIG1(12)" + Quote2
 Print #Tempfile1, "device.misfires=" + Quote2 + "RND<CONFIG1(13)" + Quote2
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD050]"
 Print #Tempfile1, "fix.object=" + Quote2 + "RND<CONFIG1(16)" + Quote2
 Print #Tempfile1, "fix.container=" + Quote2 + "RND<CONFIG1(16)" + Quote2
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD052]"
 Print #Tempfile1, "maximum.rounds.counter=-1"
 Print #Tempfile1, "round.time.delay=-1"
 Print #Tempfile1, "Main.Loop.Update=4"
 Print #Tempfile1, ";Break.Switch=0"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD054]"
 Print #Tempfile1, "accept.object=" + Quote2 + "RND>.9" + Quote2
 Print #Tempfile1, "allow.give.all=-1"
 Print #Tempfile1, "maximum.gold.give=1d300"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD062]"
 Print #Tempfile1, "Hide.Gold.Maximum=1d100"
 Print #Tempfile1, "Hide.Equation=" + Quote2 + "RND>.66" + Quote2
 Print #Tempfile1, "Hide.Failure=" + Quote2 + "CHA<=5" + Quote2
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD063]"
 Print #Tempfile1, "drop.gold.maximum=1d300"
 Print #Tempfile1, "drop.all.gold=true"
 Print #Tempfile1, "drop.all.gold.level=1"
 Print #Tempfile1, "hide.gold.maximum=1d300"
 Print #Tempfile1, "hide.all.gold=true"
 Print #Tempfile1, "hide.all.gold.level=1"
 Print #Tempfile1, "drop.silver.maximum=1d308"
 Print #Tempfile1, "hide.silver.maximum=1d308"
 Print #Tempfile1, "drop.copper.maximum=1d308"
 Print #Tempfile1, "hide.copper.maximum=1d308"
 Print #Tempfile1, "drop.bronze.maximum=1d308"
 Print #Tempfile1, "hide.bronze.maximum=1d308"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD073]"
 Print #Tempfile1, "maximum.launch.items=10"
 Print #Tempfile1, "smash.lock.equation=" + Quote2 + "RND>.66" + Quote2
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD075]"
 Print #Tempfile1, ";restrict.level=10"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD080]"
 Print #Tempfile1, "Allow.Lock.Override=True"
 Print #Tempfile1, "Allow.Keynumber.Override=False"
 Print #Tempfile1, "Allow.Container.Lock.Override=True"
 Print #Tempfile1, "Allow.Container.Keynumber.Override=False"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD083]"

 Print #Tempfile1, ";allow user to look in direction/room number"
 Print #Tempfile1, "Allow.User.Look=True"
 Print #Tempfile1, Nul

 Print #Tempfile1, ";disable environment list"
 Print #Tempfile1, ";Allow.User.Look0=False"
 Print #Tempfile1, Nul

 Print #Tempfile1, ";disable guestlines list"
 Print #Tempfile1, ";Allow.User.Look1=False"
 Print #Tempfile1, Nul

 Print #Tempfile1, ";disable create list"
 Print #Tempfile1, ";Allow.User.Look2=False"
 Print #Tempfile1, Nul

 Print #Tempfile1, ";disable wishs list"
 Print #Tempfile1, ";Allow.User.Look3=False"
 Print #Tempfile1, Nul

 Print #Tempfile1, ";disable classnames list"
 Print #Tempfile1, ";Allow.User.Look4=False"
 Print #Tempfile1, Nul

 Print #Tempfile1, ";disable pagetimes list"
 Print #Tempfile1, ";Allow.User.Look5=False"
 Print #Tempfile1, Nul

 Print #Tempfile1, ";disable roomnumber list"
 Print #Tempfile1, ";Allow.User.Look6=False"
 Print #Tempfile1, Nul

 Print #Tempfile1, ";disable maxroomnumber list"
 Print #Tempfile1, ";Allow.User.Look7=False"
 Print #Tempfile1, Nul

 Print #Tempfile1, ";disable monclass list"
 Print #Tempfile1, ";Allow.User.Look8=False"
 Print #Tempfile1, Nul

 Print #Tempfile1, ";disable roomaction list"
 Print #Tempfile1, ";Allow.User.Look9=False"
 Print #Tempfile1, Nul

 Print #Tempfile1, ";disable filename display"
 Print #Tempfile1, ";Allow.User.Look10=False"
 Print #Tempfile1, Nul

 Print #Tempfile1, ";disable ansikeys list"
 Print #Tempfile1, ";Allow.User.Look11=False"
 Print #Tempfile1, Nul

 Print #Tempfile1, ";disable modem list"
 Print #Tempfile1, ";Allow.User.Look12=False"
 Print #Tempfile1, Nul

 Print #Tempfile1, ";disable options list"
 Print #Tempfile1, ";Allow.User.Look13=False"
 Print #Tempfile1, Nul

 Print #Tempfile1, ";disable blaster list"
 Print #Tempfile1, ";Allow.User.Look14=False"
 Print #Tempfile1, Nul

 Print #Tempfile1, ";disable sysop for specialusers/deletedusers list"
 Print #Tempfile1, ";Allow.Sysop.Look=False"
 Print #Tempfile1, Nul

 Print #Tempfile1, ";filename exclusion list"
 Print #Tempfile1, ";ExcludeFileList=dnd;edit;sysop"

 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD084]"
 Print #Tempfile1, "lose.player.equation=" + Quote2 + "RND*5+5>INT/2" + Quote2
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD086]"
 Print #Tempfile1, "allow.extended.functions=0"
 Print #Tempfile1, "allow.create.base=0"
 Print #Tempfile1, "only.sysops.create.base=0"
 Print #Tempfile1, "sysops.can.undelete.message=0"
 Print #Tempfile1, "sysops.can.delete.messbase=0"
 Print #Tempfile1, "sysops.can.undelete.messbase=0"
 Print #Tempfile1, "sysops.can.edit.messbase=0"
 Print #Tempfile1, "user.can.undelete.message=0"
 Print #Tempfile1, "user.can.delete.messbase=0"
 Print #Tempfile1, "user.can.undelete.messbase=0"
 Print #Tempfile1, "user.can.edit.messbase=0"

 Print #Tempfile1, "Create.Base.Level=0"
 Print #Tempfile1, "Create.Base.Logon=0"
 Print #Tempfile1, "Delete.Base.Level=0"
 Print #Tempfile1, "Delete.Base.Logon=0"
 Print #Tempfile1, "Edit.Base.Level=0"
 Print #Tempfile1, "Edit.Base.Logon=0"
 Print #Tempfile1, "Undelete.Base.Level=0"
 Print #Tempfile1, "Undelete.Base.Logon=0"
 Print #Tempfile1, "Undelete.Message.Level=0"
 Print #Tempfile1, "Undelete.Message.Logon=0"
 Print #Tempfile1, "Search.Message.Level=0"
 Print #Tempfile1, "Search.Message.Logon=0"
 Print #Tempfile1, "Search.Base.Level=0"
 Print #Tempfile1, "Search.Base.Logon=0"
 Print #Tempfile1, "Display.Base.Level=0"
 Print #Tempfile1, "Display.Base.Logon=0"

 Print #Tempfile1, ";for following options:"
 Print #Tempfile1, ";  = 0 ' disable"
 Print #Tempfile1, ";  = -1 ' enable"
 Print #Tempfile1, ";  > 0 ' user level restriction"

 Print #Tempfile1, Nul
 Print #Tempfile1, ";[E]nter message"
 Print #Tempfile1, ";Option1=0"
 Print #Tempfile1, "; enter.mess=0"
 Print #Tempfile1, Nul
 Print #Tempfile1, ";[K]ill message"
 Print #Tempfile1, ";Option2=0"
 Print #Tempfile1, "; kill.mess=0"
 Print #Tempfile1, Nul
 Print #Tempfile1, ";[L]ock mailbox"
 Print #Tempfile1, "; lock.mailbox=0"
 Print #Tempfile1, ";Option3=0"
 Print #Tempfile1, Nul
 Print #Tempfile1, ";[N]new messages"
 Print #Tempfile1, ";Option4=0"
 Print #Tempfile1, "; new.mess=0"
 Print #Tempfile1, Nul
 Print #Tempfile1, ";[R]ead messages"
 Print #Tempfile1, ";Option5=0"
 Print #Tempfile1, "; read.mess=0"
 Print #Tempfile1, Nul
 Print #Tempfile1, ";[U]nlock mailbox"
 Print #Tempfile1, ";Option6=0"
 Print #Tempfile1, "; unlock.mailbox=0"
 Print #Tempfile1, Nul
 Print #Tempfile1, ";[V]iew messages"
 Print #Tempfile1, ";Option7=0"
 Print #Tempfile1, "; view.mess=0"
 Print #Tempfile1, Nul
 Print #Tempfile1, "Always.Allow.Sysop=-1"
 Print #Tempfile1, "Always.Allow.AsstDM=-1"
 Print #Tempfile1, "Always.Allow.DM=-1"
 Print #Tempfile1, Nul
 Print #Tempfile1, "Always.Allow.TownMayor=-1"
 Print #Tempfile1, "Always.Allow.Governor=-1"
 Print #Tempfile1, "Always.Allow.GuildMaster=-1"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD097]"
 Print #Tempfile1, "Only.Thieves.Can.Picklock=True"
 Print #Tempfile1, "Strength.To.Picklock=" + Quote2 + "RND*STR+5<7" + Quote2
 Print #Tempfile1, "Intelligence.To.Picklock=" + Quote2 + "RND*INT+5<7" + Quote2
 Print #Tempfile1, "Random.Picklock.Failure=" + Quote2 + "RND<.2" + Quote2
 Print #Tempfile1, "Cant.Picklock.Hidden.Doors=True"
 Print #Tempfile1, "Only.Thieves.Can.Picklock.Container=-1"
 Print #Tempfile1, "Strength.To.Picklock.Container=" + Quote2 + "RND*STR+5<7" + Quote2
 Print #Tempfile1, "Intelligence.To.Picklock.Container=" + Quote2 + "RND*INT+5<7" + Quote2
 Print #Tempfile1, "Random.Picklock.Failure.Container=" + Quote2 + "RND<.2" + Quote2
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD103]"
 Print #Tempfile1, "Allow.Display.Offline.Users=-1"
 Print #Tempfile1, "Allow.Display.Online.Users=-1"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD109]"
 Print #Tempfile1, "allow.repair1=-1"
 Print #Tempfile1, "allow.repair2=-1"
 Print #Tempfile1, "allow.repair3=-1"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD120]"
 Print #Tempfile1, "Only.Thieves.Can.Steal.Item.From.Online.User.Container=True"
 Print #Tempfile1, "Steal.Container.Level.Item.Online.User.Container=10"
 Print #Tempfile1, "Thief.Steal.Failure.Item.Online.User.Container=" + Quote2 + "RND*5+5>DEX/2" + Quote2
 Print #Tempfile1, Nul
 Print #Tempfile1, "Only.Thieves.Can.Steal.Container.From.Online.User.Container=True"
 Print #Tempfile1, "Steal.Container.Level.Container.Online.User.Container=10"
 Print #Tempfile1, "Thief.Steal.Failure.Container.Online.User.Container=" + Quote2 + "RND*5+5>DEX/2" + Quote2
 Print #Tempfile1, Nul
 Print #Tempfile1, "Only.Thieves.Can.Steal.Item.From.Offline.User.Container=True"
 Print #Tempfile1, "Steal.Container.Level.Item.Offline.User.Container=10"
 Print #Tempfile1, "Thief.Steal.Failure.Item.Offline.User.Container=" + Quote2 + "RND*5+5>DEX/2" + Quote2
 Print #Tempfile1, Nul
 Print #Tempfile1, "Only.Thieves.Can.Steal.Container.From.Offline.User.Container=True"
 Print #Tempfile1, "Steal.Container.Level.Container.Offline.User.Container=10"
 Print #Tempfile1, "Thief.Steal.Failure.Container.Offline.User.Container=" + Quote2 + "RND*5+5>DEX/2" + Quote2
 Print #Tempfile1, Nul
 Print #Tempfile1, "only.thieves.can.steal.from.monster=true"
 Print #Tempfile1, "thief.steal.failure.monster=" + Quote2 + "RND*5+5>DEX/2" + Quote2
 Print #Tempfile1, Nul
 Print #Tempfile1, "only.thieves.can.steal.gold.from.monster=-1"
 Print #Tempfile1, "thief.steal.failure.gold.monster=" + Quote2 + "RND*5+5>DEX/2" + Quote2
 Print #Tempfile1, "maximum.gold.steal.from.monster=1d100"
 Print #Tempfile1, Nul
 Print #Tempfile1, "only.thieves.can.steal.object.from.online.user=true"
 Print #Tempfile1, "thief.steal.failure.object.online.user=" + Quote2 + "RND*5+5>DEX/2" + Quote2
 Print #Tempfile1, Nul
 Print #Tempfile1, "only.thieves.can.steal.treasure.from.online.user=true"
 Print #Tempfile1, "thief.steal.failure.treasure.online.user=" + Quote2 + "RND*5+5>DEX/2" + Quote2
 Print #Tempfile1, Nul
 Print #Tempfile1, "only.thieves.can.steal.container.from.online.user=true"
 Print #Tempfile1, "steal.container.level.item.online.user=10"
 Print #Tempfile1, "thief.steal.failure.container.online.user=" + Quote2 + "RND*5+5>DEX/2" + Quote2
 Print #Tempfile1, Nul
 Print #Tempfile1, "only.thieves.can.steal.object.from.offline.user=true"
 Print #Tempfile1, "thief.steal.failure.object.offline.user=" + Quote2 + "RND*5+5>DEX/2" + Quote2
 Print #Tempfile1, Nul
 Print #Tempfile1, "only.thieves.can.steal.treasure.from.offline.user=true"
 Print #Tempfile1, "thief.steal.failure.treasure.offline.user=" + Quote2 + "RND*5+5>DEX/2" + Quote2
 Print #Tempfile1, Nul
 Print #Tempfile1, "only.thieves.can.steal.container.from.offline.user=true"
 Print #Tempfile1, "steal.container.level.item.offline.user=10"
 Print #Tempfile1, "thief.steal.failure.container.offline.user=" + Quote2 + "RND*5+5>DEX/2" + Quote2
 Print #Tempfile1, "maximum.gold.steal.from.offline.user=1d100"
 Print #Tempfile1, Nul
 Print #Tempfile1, "only.thieves.can.steal.container.from.online.user=true"
 Print #Tempfile1, "steal.container.level.item.online.user=10"
 Print #Tempfile1, "thief.steal.failure.container.online.user=" + Quote2 + "RND*5+5>DEX/2" + Quote2
 Print #Tempfile1, "maximum.gold.steal.from.online.user=1d100"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD123]"
 Print #Tempfile1, ";restrict.level=10"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD124]"
 Print #Tempfile1, "take.maximum.coins=1d308"
 Print #Tempfile1, "take.maximum.gold=1d308"
 Print #Tempfile1, "take.maximum.silver=1d308"
 Print #Tempfile1, "take.maximum.copper=1d308"
 Print #Tempfile1, "take.maximum.bronze=1d308"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD125]"
 Print #Tempfile1, "Take.All.Coins=-1"
 Print #Tempfile1, "Take.All.Coins.Level=1"
 Print #Tempfile1, "Take.All.Gold=-1"
 Print #Tempfile1, "Take.All.Gold.Level=1"
 Print #Tempfile1, "Take.All.Silver=-1"
 Print #Tempfile1, "Take.All.Silver.Level=1"
 Print #Tempfile1, "Take.All.Copper=-1"
 Print #Tempfile1, "Take.All.Copper.Level=1"
 Print #Tempfile1, "Take.All.Bronze=-1"
 Print #Tempfile1, "Take.All.Bronze.Level=1"
 Print #Tempfile1, "Take.All.Container=-1"
 Print #Tempfile1, "Take.All.Container.Level=1"
 Print #Tempfile1, "Take.All.Container.From.Container=-1"
 Print #Tempfile1, "Take.All.Container.From.Container.Level=1"
 Print #Tempfile1, "Take.All.Maximum.Coins=1d308"
 Print #Tempfile1, "Take.All.Maximum.Gold=1d308"
 Print #Tempfile1, "Take.All.Maximum.Silver=1d308"
 Print #Tempfile1, "Take.All.Maximum.Copper=1d308"
 Print #Tempfile1, "Take.All.Maximum.Bronze=1d308"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul

 Print #Tempfile1, "[CMD126]"
 Print #Tempfile1, "create.team=-1"
 Print #Tempfile1, "deposit.Gold=-1"
 Print #Tempfile1, "inventory=-1"
 Print #Tempfile1, "join.team=-1"
 Print #Tempfile1, "list.teams=-1"
 Print #Tempfile1, "offline.fights=-1"
 Print #Tempfile1, "prefixed.ANSI=-1"
 Print #Tempfile1, "resign.from.team=-1"
 Print #Tempfile1, "show.your.team=-1"
 Print #Tempfile1, "top.team.list=-1"
 Print #Tempfile1, "withdraw.Gold=-1"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD127]"
 Print #Tempfile1, "throw.item.equation=" + Quote2 + "RND*5+2>DEX/2" + Quote2
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD135]"
 Print #Tempfile1, "Allow.Master.Key=True"
 Print #Tempfile1, "Allow.Matching.Key=True"
 Print #Tempfile1, "Allow.Container.Master.Key=True"
 Print #Tempfile1, "Allow.Container.Matching.Key=True"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD139]"
 Print #Tempfile1, "maximum.rounds.counter=-1"
 Print #Tempfile1, "round.time.delay=-1"
 Print #Tempfile1, ";Break.Switch=0"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD142]"
 Print #Tempfile1, "Allow.Whatis1=-1"
 Print #Tempfile1, "Allow.Whatis2=-1"
 Print #Tempfile1, "Allow.Whatis3=-1"
 Print #Tempfile1, "Allow.Whatis4=-1"
 Print #Tempfile1, "Allow.Whatis5=-1"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD143]"
 Print #Tempfile1, "Alarm.Beep=-1"
 Print #Tempfile1, ";Alarm.Color=5"
 Print #Tempfile1, ";Alarm.Type=0"
 Print #Tempfile1, "Sound.Frequency=900"
 Print #Tempfile1, "Sound.Duration=6"
 Print #Tempfile1, "Maximum.Rounds.Counter=-1"
 Print #Tempfile1, "Round.Time.Delay=-1"
 Print #Tempfile1, "Maximum.Alarms=9"
 Print #Tempfile1, ";Break.Switch=0"
 Print #Tempfile1, ";Debug.Switch=-1"
 Print #Tempfile1, ";Escape.Switch=0"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD144]"
 Print #Tempfile1, "Maximum.Rounds.Counter=10"
 Print #Tempfile1, "Round.Time.Delay=1"
 Print #Tempfile1, "Main.Loop.Update=4"
 Print #Tempfile1, ";Break.Switch=0"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD151]"
 Print #Tempfile1, "Allow.Scroll.Write=-1"
 Print #Tempfile1, ";Disable.Scroll.Text=text;scroll"
 Print #Tempfile1, ";Disable.Scroll.Char=;"
 Print #Tempfile1, "Disable.Item1=0"
 Print #Tempfile1, "Disable.Item2=0"
 Print #Tempfile1, "Disable.Item3=0"
 Print #Tempfile1, "Disable.Item4=0"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD152]"
 Print #Tempfile1, ";Force.Comspec=" + Quote2 + "c:\command.com" + Quote2
 Print #Tempfile1, ";Force.Comspec=" + Quote2 + "c:\windows\system32\cmd.exe" + Quote2
 Print #Tempfile1, ";Comspec.Switches=" + Quote2 + "/C" + Quote2
 Print #Tempfile1, ";also.use.watchdog=-1"
 Print #Tempfile1, ";disable.watchcat=-1"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD153]"
 Print #Tempfile1, "Psi.Value=0"
 Print #Tempfile1, "Decrease.Psi.Value=1"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD155]"
 Print #Tempfile1, "Allow.Catalog=-1"
 Print #Tempfile1, "Allow.Logoff=-1"
 Print #Tempfile1, "Allow.Notice=-1"
 Print #Tempfile1, "Allow.Prelog=-1"
 Print #Tempfile1, "Allow.Welcome=-1"
 Print #Tempfile1, "Allow.Other=-1"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD157]"
 Print #Tempfile1, "Required.Level=10"
 Print #Tempfile1, "Strength.Required.Equation=" + Quote2 + "STR>=5" + Quote2
 Print #Tempfile1, "Intelligence.Required.Equation=" + Quote2 + "INT>=5" + Quote2
 Print #Tempfile1, "Invisible.Equation=" + Quote2 + "RND>.2" + Quote2
 Print #Tempfile1, "Invisible.Count=" + Quote2 + "10" + Quote2
 Print #Tempfile1, "Curepoison=" + Quote2 + "RND>.5" + Quote2
 Print #Tempfile1, "allow.asstdm.wish.levels=-1"
 Print #Tempfile1, "allow.dm.wish.levels=-1"
 Print #Tempfile1, "maximum.raise.level=10"
 Print #Tempfile1, "maximum.asstdm.raise.level=10"
 Print #Tempfile1, "maximum.dm.raise.level=10"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD187]"
 Print #Tempfile1, "Imbue.Self=" + Quote2 + "RND>.75" + Quote2
 Print #Tempfile1, "Imbue.Online.User=" + Quote2 + "RND>.75" + Quote2
 Print #Tempfile1, "Imbue.Offline.User=" + Quote2 + "RND>.75" + Quote2
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD188]"
 Print #Tempfile1, "Zap.Self=" + Quote2 + "RND>.75" + Quote2
 Print #Tempfile1, "Zap.Online.User=" + Quote2 + "RND>.75" + Quote2
 Print #Tempfile1, "Zap.Offline.User=" + Quote2 + "RND>.75" + Quote2
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD193]"
 Print #Tempfile1, "Allow.Subject.Search=-1"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD200]"
 Print #Tempfile1, ";foreground1=30"
 Print #Tempfile1, ";foreground2=31"
 Print #Tempfile1, ";foreground3=32"
 Print #Tempfile1, ";foreground4=37"
 Print #Tempfile1, ";foreground5=37"
 Print #Tempfile1, ";foreground6=35"
 Print #Tempfile1, ";foreground7=36"
 Print #Tempfile1, ";foreground8=34"
 Print #Tempfile1, ";background1=40"
 Print #Tempfile1, ";background2=41"
 Print #Tempfile1, ";background3=42"
 Print #Tempfile1, ";background4=43"
 Print #Tempfile1, ";background5=46"
 Print #Tempfile1, ";background6=45"
 Print #Tempfile1, ";background7=44"
 Print #Tempfile1, ";background8=47"
 Print #Tempfile1, ";blind=-1"
 Print #Tempfile1, ";blindchar=-1"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD201]"
 Print #Tempfile1, "Xcoor=1"
 Print #Tempfile1, "Ycoor=1"
 Print #Tempfile1, "Insert=0"
 Print #Tempfile1, "Background1=0"
 Print #Tempfile1, "Background2=1"
 Print #Tempfile1, "Foreground1=14"
 Print #Tempfile1, "Foreground2=15"
 Print #Tempfile1, "Xcoor2=1"
 Print #Tempfile1, "Ycoor2=1"
 Print #Tempfile1, "HBackground1=0"
 Print #Tempfile1, "HBackground2=1"
 Print #Tempfile1, "HForeground1=14"
 Print #Tempfile1, "HForeground2=15"
 Print #Tempfile1, ";blind=-1"
 Print #Tempfile1, ";blindchar=-1"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD202]"
 Print #Tempfile1, ";display.file.system=0"
 Print #Tempfile1, ";display.system.resources=0"
 Print #Tempfile1, ";display.system.settings=0"
 Print #Tempfile1, ";display.comm.info=0"
 Print #Tempfile1, ";display.blaster.info=0"
 Print #Tempfile1, ";display.environment.info=0"
 Print #Tempfile1, ";display.debug.info=0"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD205]"
 Print #Tempfile1, "Allow.Display.Users=-1"
 Print #Tempfile1, "Allow.Display.Special.Users=-1"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[CMD210]"
 Print #Tempfile1, ";Disable.Mailbox.Lock=-1"
 Print #Tempfile1, ";Allow.Vote.Self=-1"
 Print #Tempfile1, ";Allow.Adm.Vote.Self=-1"
 Print #Tempfile1, ";Allow.Dm.Vote.Self=-1"
 Print #Tempfile1, "Allow.Adm.Vote.Edit=-1"
 Print #Tempfile1, "Allow.Dm.Vote.Edit=-1"
 Print #Tempfile1, "Required.Level.To.Vote=2"
 Print #Tempfile1, "Required.Intelligence.To.Vote=5"
 Print #Tempfile1, "Voting.Reward=100"
 Print #Tempfile1, "Allow.Guest.Vote=0"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[ROOM]"
 Print #Tempfile1, "edit.action=-1"
 Print #Tempfile1, "edit.container=-1"
 Print #Tempfile1, "edit.descrip=-1"
 Print #Tempfile1, "edit.monclass=-1"
 Print #Tempfile1, "edit.objects=-1"
 Print #Tempfile1, "edit.treasure=-1"
 Print #Tempfile1, "display.desc=-1"
 Print #Tempfile1, "edit.long.desc=-1"
 Print #Tempfile1, "edit.short.desc=-1"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[SPELL]"
 Print #Tempfile1, "poison.equation=" + Quote2 + "RND>.5" + Quote2
 Print #Tempfile1, "level.drain.equation=" + Quote2 + "RND>.5" + Quote2
 Print #Tempfile1, "befuddle.spell.equation=" + Quote2 + "RND>.5" + Quote2
 Print #Tempfile1, "intoxicate.equation=" + Quote2 + "RND>.5" + Quote2
 Print #Tempfile1, "befuddle.attack.equation=" + Quote2 + "WIS+DEX>RND*10+MLVL/2" + Quote2
 Print #Tempfile1, "charm.attack.equation=" + Quote2 + "RND*10+4>BEA" + Quote2
 Print #Tempfile1, "beguile.attack.equation=" + Quote2 + "RND*12+5>BEA+GLA" + Quote2
 Print #Tempfile1, "bemuse.attack.equation=" + Quote2 + "RND*8+5>GLA" + Quote2
 Print #Tempfile1, "sense.encounter=" + Quote2 + "RND>.75" + Quote2
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, "[TRAIN]"
 Print #Tempfile1, "lose.point.equation=" + Quote2 + "RND>.5" + Quote2
 Print #Tempfile1, "lose.point=" + Quote2 + "RND*4+1" + Quote2
 Print #Tempfile1, "trap.equation=" + Quote2 + "RND<.5" + Quote2
 Print #Tempfile1, "monster.hit.drain=" + Quote2 + "LVL*CHA/MLVL" + Quote2
 Print #Tempfile1, "team.lose.point.equation=" + Quote2 + "RND>.5" + Quote2
 Print #Tempfile1, "team.lose.point=" + Quote2 + "RND*4+1" + Quote2
 Print #Tempfile1, "team.roll.lost=" + Quote2 + "(RND*10+10+CON2/2)>20" + Quote2
 Print #Tempfile1, "vehicle.hit.equation=" + Quote2 + "RND>.75" + Quote2
 Print #Tempfile1, "team.hit.monster=" + Quote2 + "(RND*STR2+LVL2/2)*(XXX+(PROF2/100))-BO2/2-HE2/2+CL2" + Quote2
 Print #Tempfile1, "offline.user.miss.equation=" + Quote2 + "(DEX2/10)>(RND*10+LVL2*2)" + Quote2
 Print #Tempfile1, "offline.user.hits=" + Quote2 + "RND*10+(HP2/10-(AR1+BO2+HE2+SH2+TW2+AM2)/2)*XXX" + Quote2
 Print #Tempfile1, "offline.user.hit.points=" + Quote2 + "(FAT2+VIT2+MAG2)*LVL2+STR2" + Quote2
 Print #Tempfile1, "offline.poison.hits=" + Quote2 + "LVL2*CHA2/MLVL" + Quote2
 Print #Tempfile1, "monster.miss.offline.user=" + Quote2 + "(DEX2/10)>(RND*10+MLVL*2)" + Quote2
 Print #Tempfile1, "monster.hits.offline.user=" + Quote2 + "RND*10+(MHP/10-((AR2+BO2+HE2+SH2+TW2+AM2)/2)+MW/2)*XXX" + Quote2
 Print #Tempfile1, "monster.psi.hits.offline.user=" + Quote2 + "RND*(MHP/10-PSID)*MPSI" + Quote2
 Print #Tempfile1, "override.classtype=false"
 Print #Tempfile1, "override.saferoom=false"
 Print #Tempfile1, "also.follow=true"
 Print #Tempfile1, "offline.sense.encounter=.75"
 Print #Tempfile1, "times.died.counter=10"
 Print #Tempfile1, "times.died.reward=1000"
 Print #Tempfile1, "times.logon.counter=1000000"
 Print #Tempfile1, "times.logon.reward=10000"
 Print #Tempfile1, "max.room.recurse=4"
 Print #Tempfile1, ";allow.perm.inv=-1"
 Print #Tempfile1, "[END]"
 Print #Tempfile1, Nul
 Print #Tempfile1, ";end-of-blocks"
Error.Resume22x:
 Exit Sub
Error.Trap22x:
 Resume Error.Resume22x
End Sub
