 Rem File: Cmd083.bas
 Rem Sub: Display.Information
 Rem $Include: 'dndbbs.inc'
 On Error Goto Main.Error
 If Chained<>-2 Then
    Color 15,0
    Print "DNDBBS Command 083 -- Display.Information."
    Color 7,0
    End
 Endif
 Call Display.Information
Main.Resume:
 Chain DND.Path+"DNDBBS.EXE"
 End
Main.Error:
 Resume Main.Resume

Sub Display.Information
 On Local Error Goto ErrorTrp33
 Gosub Get.Config3
 Select Case Last.Command.Number
 Case 69, 70 ' identify
    If Normal.User Then
       Var=Config2(59)
       If Var>0 Then
          If UserRecord.Level<Var Then
             Strng="You are not high enough level!"
             Call IO.O
             Strng="You must wait until level "
             If Var<=10 Then
                Strng=Strng+Numeral(Var)
             Else
                Strng=Strng+Form$(Cdbl(Var))
             Endif
             Strng=Strng+".."
             Call IO.O
             Exit Sub
          Endif
       Endif
    Endif
 End Select
 VarA$=Parsed.Command1
 VarB$=Parsed.Command2
 ' commands with two parameters.
 If Instr(Parsed.Command2," ") Then
    ' look item user
    Call ParseX
    ' parsed.command1=user
    ' parsed.command2=item
    Call Numeric
    ' online users
    Call Search.Mess(SFalse)
    If Temp! Then
       Call Read.Record(UserFile2,MessWorkRecord1.UserIndex)
       Out3=Rtrim$(Lcase$(MessWorkRecord1.UserName))
       If Len(Out3) Then
          Mid$(Out3,1,1)=Ucase$(Mid$(Out3,1,1))
       Endif
    Endif
    ' get room number of online user.
    If Lcase$(Parsed.Command2)="roomnumber" Then
       If Temp!>SFalse Then
          If UserRecord2.Block1 Then
             Strng=Out3+" blocks your read!"
             Call IO.O
          Else
             Strng=Out3+" is in room"+Str$(Temp!)+"."
             Call IO.O
          Endif
          Exit Sub
       Endif
    Endif
    ' get level of online user.
    If Lcase$(Parsed.Command2)="level" Then
       If Temp!>SFalse Then
          If UserRecord2.Block1 Then
             Strng=Out3+" blocks your read!"
             Call IO.O
          Else
             Select Case MessWorkRecord1.Level
             Case Is>=32000
                Strng=Out3+" is a Ghod"
             Case Is>9999
                Strng=Out3+" is a Dungeon Master"
             Case Is>999
                Strng=Out3+" is an Assistant Dungeon Mastwr"
             Case 0
                Strng=Out3+" is dead"
             Case 1 To 10
                Strng=Out3+" is level "+Rtrim$(Numeral(MessWorkRecord1.Level))
             Case Else
                Strng=Out3+" is level "+Form$(Cdbl(MessWorkRecord1.Level))
             End Select
             Strng=Strng+"."
             Call IO.O
          Endif
          Exit Sub
       Endif
    Endif
    ' get classname of online user.
    If Lcase$(Parsed.Command2)="classname" Then
       If Temp!>SFalse Then
          If UserRecord2.Block1 Then
             Strng=Out3+" blocks your read!"
             Call IO.O
          Else
             Out2=Rtrim$(Lcase$(MessWorkRecord1.Classname))
             Call Capitalize(Out2)
             Strng=Out3+"'s classname is "+Out2+"."
             Call IO.O
          Endif
          Exit Sub
       Endif
    Endif
    ' look objects/treasure of online user.
    If Temp!=Room Then
       VarY=TempC ' node
       VarB!=TempB!
       Out2=MessWorkRecord1.UserName
       Out2=Rtrim$(Out2)
       Out2=Lcase$(Out2)
       Var3$=Out2
       Parsed.Command1=Parsed.Command2
       Call Numeric
       Temp4=False
       Temp6=False
       Temp7!=SFalse
       TempC=False
       If Parsed.Command1<>Nul Then
          For Temp5!=1! To Lof(MessWorkFile6)/MessWorkRecLen6
             Call Read.Record(MessWorkFile6,Temp5!)
             If MessWorkRecord6.User=TempB! Then
                TempA!=MessWorkRecord6.Index
                If TempA!<SFalse Then
                   VarQ!=Abs(TempA!)
                   If VarQ!>SFalse And VarQ!<=Lof(ObjectFile)/ObjectRecLen Then
                      Call Read.Record(ObjectFile,VarQ!)
                      Out3=ObjectRecord.ShortName
                      Out3=Left$(Out3,Len(Parsed.Command1))
                      If Out3=Parsed.Command1 Then
                         TempC=TempC+1
                         If Parse.Temp=False Or TempC=Parse.Temp Then
                            Out3=ObjectRecord.ObjectName
                            Out3=Rtrim$(Out3)
                            Temp7!=TempA!
                            Temp6=MessWorkRecord6.Charges
                            Exit For
                         Endif
                      Endif
                   Endif
                Endif
                If TempA!>SFalse Then
                   VarQ!=TempA!
                   If VarQ!>SFalse And VarQ!<=Lof(TreasureFile)/TreasureRecLen Then
                      Call Read.Record(TreasureFile,VarQ!)
                      Out3=TreasureRecord.ShortName
                      Out3=Left$(Out3,Len(Parsed.Command1))
                      If Out3=Parsed.Command1 Then
                         TempC=TempC+1
                         If Parse.Temp=False Or TempC=Parse.Temp Then
                            Out3=TreasureRecord.TreasureName
                            Out3=Rtrim$(Out3)
                            Temp7!=TempA!
                            Temp6=MessWorkRecord6.Charges
                            Exit For
                         Endif
                      Endif
                   Endif
                Endif
             Endif
          Next
          If Temp7! Then
             Call He.She
             Prefix1=Prefix1+"'s carrying "
             TempX=-1
             Goto Display.Item
             Exit Sub
          Endif
       Endif
       ' look in container of online user.
       VarY=TempC ' node
       VarB!=TempB!
       Out2=MessWorkRecord1.UserName
       Out2=Rtrim$(Out2)
       Out2=Lcase$(Out2)
       Var3$=Out2
       Parsed.Command1=Parsed.Command2
       Call Numeric
       Call Search.User.Container2
       If TempA!<>SFalse Then
          Temp4=False
          Call Look.In.Container(Var3$)
          Exit Sub
       Endif
       Strng="You can't search that!"
       Call IO.O
       Exit Sub
    Endif
    ' online user is self
    If Temp!=Room And TempB!=User.Index Then
       Strng="You can't search that!"
       Call IO.O
       Exit Sub
    Endif
    Parsed.Command1=VarA$
    Parsed.Command2=VarB$
    If Instr(Parsed.Command1, " ") Then
       Parsed.Command1 = Left$(Parsed.Command1, Instr(Parsed.Command1, " ") - 1)
    Endif
    If Instr(Parsed.Command2, " ") Then
       Parsed.Command2 = Mid$(Parsed.Command2, Instr(Parsed.Command2, " ") + 1)
    Endif
    ' look item user
    Call ParseX
    ' parsed.command1=user
    ' parsed.command2=item
    Call Numeric
    ' offline users
    Call Check.User
    If User.Temp Then
       Out3=Rtrim$(Lcase$(UserRecord2.CodeName))
       If Len(Out3) Then
          Mid$(Out3,1,1)=Ucase$(Mid$(Out3,1,1))
       Endif
       Var3$=Out3
    Endif
    ' get room number of offline user.
    If Lcase$(Parsed.Command2)="roomnumber" Then
       If User.Temp>SFalse Then
          If UserRecord2.Block1 Then
             Strng=Out3+" blocks your read!"
             Call IO.O
          Else
             Strng=Out3+" is in room"+Str$(UserRecord2.Room)+"."
             Call IO.O
          Endif
          Exit Sub
       Endif
       Strng="User not found."
       Call IO.O
       Exit Sub
    Endif
    ' get level of offline user.
    If Lcase$(Parsed.Command2)="level" Then
       If User.Temp>SFalse Then
          If UserRecord2.Block1 Then
             Strng=Out3+" blocks your read!"
             Call IO.O
          Else
             Select Case UserRecord2.Level
             Case Is>=32000
                Strng=Out3+" is a Ghod"
             Case Is>9999
                Strng=Out3+" is a Dungeon Master"
             Case Is>999
                Strng=Out3+" is an Assistant Dungeon Mastwr"
             Case 0
                Strng=Out3+" is dead"
             Case 1 To 10
                Strng=Out3+" is level "+Rtrim$(Numeral(UserRecord2.Level))
             Case Else
                Strng=Out3+" is level "+Form$(Cdbl(UserRecord2.Level))
             End Select
             Strng=Strng+"."
             Call IO.O
          Endif
          Exit Sub
       Endif
       Strng="User not found."
       Call IO.O
       Exit Sub
    Endif
    ' get classname of offline user.
    If Lcase$(Parsed.Command2)="classname" Then
       If User.Temp>SFalse Then
          If UserRecord2.Block1 Then
             Strng=Out3+" blocks your read!"
             Call IO.O
          Else
             Out2=Rtrim$(Lcase$(UserRecord2.Classname))
             Call Capitalize(Out2)
             Strng=Out3+"'s classname is "+Out2+"."
             Call IO.O
          Endif
          Exit Sub
       Endif
       Strng="User not found."
       Call IO.O
       Exit Sub
    Endif
    ' look objects/treasure of offline user.
    If User.Temp Then
       Parsed.Command1=Parsed.Command2
       Call Numeric
       TempB!=MessWorkRecord4.Index
       Call Read.Record(UserFile2,TempB!)
       Call Search.User.Inventory2
       If Temp7! Then
          Call He.She
          Prefix1=Prefix1+"'s carrying "
          TempX=-1
          Goto Display.Item
          Exit Sub
       Endif
    Endif
    ' look in container of offline user.
    If User.Temp Then
       Parsed.Command1=Parsed.Command2
       Call Numeric
       TempB!=MessWorkRecord4.Index
       Call Search.User.Container2
       If TempA!<>SFalse Then
          Temp4=False
          Call Look.In.Container(Var3$)
          Exit Sub
       Endif
    Endif
 Else ' commands with one parameter.
    ' display room direction/number
    If Normal.User=False Or OptionZ Then
       Var!=0!
       Var$=Nul
       ' custom direction from datafile
       Call Find.Custom2(VarX,Var0!,Var$)
       If VarX Then
          Var!=Var0!
       Endif
       ' room direction
       If Var!=0! Then
          For TempA=1 To MaxDirections
             Out3=Direction(TempA)
             Out3=Rtrim$(Out3)
             Out3=Lcase$(Out3)
             If Lcase$(Parsed.Command1)=Out3 Then
                Var!=RoomRecord.Direct(TempA)
                Var$=Out3
                Exit For
             Endif
          Next
       Endif
       If Var!=0! Then
          Out3=RoomRecord.Custom1
          Out3=Rtrim$(Out3)
          Out3=Lcase$(Out3)
          If Len(Out3) Then
             If Lcase$(Parsed.Command1)=Out3 Then
                Var!=RoomRecord.Direct(13)
                Var$=Out3
             Endif
          Endif
       Endif
       If Var!=0! Then
          Out3=RoomRecord.Custom2
          Out3=Rtrim$(Out3)
          Out3=Lcase$(Out3)
          If Len(Out3) Then
             If Lcase$(Parsed.Command1)=Out3 Then
                Var!=RoomRecord.Direct(14)
                Var$=Out3
             Endif
          Endif
       Endif
       ' room number
       If Var!=0! Then
          If Left$(Stored.Parsed.Command1,1)="#" Then
             Var!=Int(Val(Mid$(Stored.Parsed.Command1,2))+.5)
          Else
             Var!=Int(Val(Parsed.Command1)+.5)
          Endif
       Endif
       If Var!>SFalse And Var!<=Lof(RoomFile)/RoomRecLen Then
          Graphics.Off=False
          If Len(Var$) Then
             Strng="You look "+Lcase$(Var$)+"."
             Call IO.O
          Endif
          Strng="Displaying room #"+Mid$(Str$(Var!),2)+":"
          Call IO.O
          Swap Var!,Room
          Call Read.Record(RoomFile,Room)
          If Room.Toggle Then
             Call Display.Sorted.Room
          Else
             Call Show.Room
          Endif
          Swap Var!,Room
          Call Read.Record(RoomFile,Room)
          Exit Sub
       Endif
    Endif
    ' online users.
    TempC=False
    Call Search.Mess(SFalse)
    If Temp!=Room Then
       If MessWorkRecord1.Monitor Then
          Strng="I can't examine that!"
          Call IO.O
          Exit Sub
       Endif
       If TempB!=User.Index Then
          Call Display.Stats
          Exit Sub
       Endif
       Call Read.Record(UserFile2,TempB!)
       Out2=MessWorkRecord1.UserName
       Out2=Rtrim$(Out2)
       Out2=Lcase$(Out2)
       Mid$(Out2,1,1)=Ucase$(Mid$(Out2,1,1))
       Strng=Rtrim$(UserRecord2.Prefix1)+Out2
       Call Convert.ANSI(True,VarQ,VarR)
       Carriage.Return=True
       Graphics.On=True
       Call IO.O
       Graphics.On=False
       Var6=MessWorkRecord1.Level
       If Var6=0 Then
          Strng=" (dead)"
       Else
          Select Case Var6
          Case 1 To 10
             Strng=" (level "+Rtrim$(Numeral(Var6))+")"
          Case Else
             Strng=" (level "+Form$(Cdbl(Var6))+")"
          End Select
          If MessWorkRecord1.Hidden Then
             Strng=Strng+" [hidden]"
          Endif
          If MessWorkRecord1.Invisible Then
             Strng=Strng+" [inv]"
          Endif
       Endif
       Strng=Strng+"."
       Call IO.O
       If MessWorkRecord1.Level=0 Then
          Exit Sub
       Endif
       Graphics.Off=True
       ' search vehicles
       Temp5!=RoomRecord.First
       If Temp5! Then
          Do While Lost.Carrier=False
             Call Read.Record(RoomInvFile,Temp5!)
             If MessWorkRecord6.Room=SFalse Then
                Exit Do
             Endif
             Temp6!=MessWorkRecord6.Next
             Temp2!=MessWorkRecord6.Index
             ' treasure
             If Temp2!>SFalse And Temp2!<=Lof(TreasureFile)/TreasureRecLen Then
                TempZ=False
                TempZ2=False
                If MessWorkRecord6.Plus>=Hidden.Object Then
                   TempZ2=True
                   If Normal.User Then
                      TempZ=True
                   Endif
                Endif
                Call Read.Record(TreasureFile,Temp2!)
                If TreasureRecord.Invisible Then
                   TempZ2=True
                   If Normal.User Then
                      TempZ=True
                   Endif
                Endif
                ' online vehicle
                If TempZ=False Then
                   If TreasureRecord.Vehicle Then
                      Var2!=MessWorkRecord6.User
                      If Var2!=TempB! Then
                         If MessWorkRecord1.ClassType=Lady Then
                            Strng="She"
                         Else
                            Strng="He"
                         Endif
                         Strng=Strng+" is using "
                         Out3=TreasureRecord.TreasureName
                         Out3=Rtrim$(Out3)
                         Out3=Lcase$(Out3)
                         Strng=Strng+Out3
                         Var2=TreasureRecord.Plus
                         If Var2>False Then
                            Strng=Strng+" (+"+Mid$(Str$(Var2),2)+")"
                         Endif
                         If TempZ2 Then
                            Strng=Strng+" [inv]"
                         Endif
                         Strng=Strng+"."
                         Call IO.O
                         If TreasureRecord.Occupants>False Then
                            Carriage.Return=True
                            Strng="Passengers: "
                            Call IO.O
                            Var=False
                            For Var2=1 To 4
                               Var2!=MessWorkRecord6.Temp(Var2)
                               If Var2!>SFalse And Var2!<=Lof(UserFile)/UserRecLen Then
                                  Call Read.Record(UserFile2,Var2!)
                                  Carriage.Return=True
                                  Strng=UserRecord2.CodeName
                                  Strng=Rtrim$(Strng)
                                  Strng=Lcase$(Strng)
                                  Mid$(Strng,1,1)=UCase$(Mid$(Strng,1,1))
                                  Call IO.O
                                  If Var Then
                                     Strng=", "+Strng
                                  Endif
                                  Var=True
                               Endif
                            Next
                            If Var Then
                               Strng="."
                            Else
                               Strng="<none>"
                            Endif
                            Call IO.O
                         Endif
                         Exit Do
                      Endif
                   Endif
                Endif
             Endif
             If Temp6!=SFalse Then
                Exit Do
             Endif
             Temp5!=Temp6!
          Loop
       Endif
       If Last.Command.Number=Identify.Command Then
          Call Read.Record(UserFile2,TempB!)
          If MessWorkRecord1.ClassType=Lady Then
             Out3="She "
          Else
             Out3="He "
          Endif
          If UserRecord2.Poison Then
             Strng=Out3+" is poisoned."
             Call IO.O
          Endif
          Strng=Out3+"is a "+Rtrim$(Race(UserRecord2.Race))+" "+_
          Rtrim$(Class.Name(UserRecord2.ClassType))+"."
          Call IO.O
          Strng="Vitals: Fat "+Form$(Cdbl(UserRecord2.Fatigue))+"/"+_
          Form$(Cdbl(UserRecord2.FatigueMax))+_
          " Vit "+Form$(Cdbl(UserRecord2.Vitality))+"/"+_
          Form$(Cdbl(UserRecord2.VitalityMax))+_
          " Mag "+Form$(Cdbl(UserRecord2.Magic))+"/"+_
          Form$(Cdbl(UserRecord2.MagicMax))+_
          " Psi "+Form$(Cdbl(UserRecord2.Psionic))+"/"+_
          Form$(Cdbl(UserRecord2.PsionicMax))
          Call IO.O
          Strng="Stats:"
          For Temp2=1 To MaxStats
             Strng=Strng+" "+Left$(Stat(Temp2),3)+" "+ _
             Form$(Cdbl(UserRecord2.Stats(Temp2)))
          Next
          Call IO.O
          Strng="Weapons: "
          For Temp2=1 To MaxWeapons
             Strng=Strng+Rtrim$(Weapon.Type.Name(Temp2))+">"+_
             Str$(UserRecord2.Weapons(Temp2))+"% "
          Next
          Call IO.O
          Strng=Out3+"is aligned "+_
          Rtrim$(Alignment.Name1(UserRecord2.Align1+2))+" "+_
          Rtrim$(Alignment.Name2(UserRecord2.Align2+2))+"."
          Call IO.O
          Call Amount(UserRecord2.Gold,VarQ$)
          Call Amount(UserRecord2.Experience,VarQ2$)
          Strng=Out3+"has"+VarQ$+" gold and"+VarQ2$+" experience."
          Call IO.O
          Strng2=Nul
          Strng=Out3+"is carrying the following items:"
          Call IO.O
          Allow.Break=True
          Break=False
          Temp9!=SFalse
          For Temp1!=1! To Lof(MessWorkFile6)/MessWorkRecLen6
             Call Read.Record(MessWorkFile6,Temp1!)
             If MessWorkRecord6.User=TempB! Then
                Temp6=False
                Temp7!=MessWorkRecord6.Index
                If Temp7!>SFalse And Temp7!<=Lof(TreasureFile)/TreasureRecLen Then
                   Temp6=True
                   Call Read.Record(TreasureFile,Temp7!)
                   If TreasureRecord.Invisible Then
                      Temp6=False
                      If Normal.User=False Then
                         Temp6=True
                      Endif
                   Endif
                Else
                   If Temp7!<SFalse Then
                      Temp8!=Abs(Temp7!)
                      If Temp8!>SFalse And Temp8!<=Lof(ObjectFile)/ObjectRecLen Then
                         Temp6=True
                         Call Read.Record(ObjectFile,Temp8!)
                      Endif
                   Endif
                Endif   
                If Break Then
                   Allow.Break=False
                   Break=False
                   Graphics.On=False
                   Graphics.Off=False
                   Call IO.O
                   Exit Sub
                Endif
                If Temp6 Then
                   Call Convert.ANSI(True,VarQ,VarR)
                   Carriage.Return=True
                   Graphics.On=True
                   Call IO.O
                   Graphics.On=False
                   If Len(Strng2) Then
                      Carriage.Return=True
                      Strng=Strng2
                      Call IO.O
                   Endif
                   If Temp7!>SFalse Then
                      Strng=Rtrim$(TreasureRecord.TreasureName)
                      If TreasureRecord.Invisible Then
                         Strng=Strng+" [inv]"
                      Endif
                      Out3=Rtrim$(TreasureRecord.Prefix1)
                   Else
                      Strng=Rtrim$(ObjectRecord.ObjectName)
                      Out3=Rtrim$(ObjectRecord.Prefix1)
                   Endif
                   Temp9!=Temp9!+1!
                   If Temp9!=1! Then
                      Mid$(Strng,1,1)=Ucase$(Mid$(Strng,1,1))
                   Endif
                   Strng=Out3+Strng
                   Strng2=", "
                Endif
             Endif
          Next
          Temp5!=UserRecord2.First2
          If Temp5! Then
             Do While Lost.Carrier=False
                Call Read.Record(ContainerFile,Temp5!)
                Var6!=ContainerRecord.Next
                If ContainerRecord.WithinContainer=SFalse Then
                   If ContainerRecord.DeletedContainer=False Then
                      If Break Then
                         Allow.Break=False
                         Break=False
                         Graphics.On=False
                         Graphics.Off=False
                         Call IO.O
                         Exit Sub
                      Endif
                      Temp6=True
                      If ContainerRecord.InvisibleContainer Then
                         Temp6=False
                         If Normal.User=False Then
                            Temp6=True
                         Endif
                      Endif
                      If Temp6 Then
                         Call Convert.ANSI(True,VarQ,VarR)
                         Carriage.Return=True
                         Graphics.On=True
                         Call IO.O
                         Graphics.On=False
                         If Len(Strng2) Then
                            Carriage.Return=True
                            Strng=Strng2
                            Call IO.O
                         Endif
                         Strng=Lcase$(Rtrim$(ContainerRecord.ContainerName))
                         If ContainerRecord.InvisibleContainer Then
                            Strng=Strng+" [inv]"
                         Endif
                         If ContainerRecord.Damaged=True Then
                            Strng=Strng+" [damaged]"
                         Else
                            If ContainerRecord.Locked=True Then
                               Strng=Strng+" [locked]"
                            Endif
                            If ContainerRecord.Locked=1 Then
                               If ContainerRecord.Closed Then
                                  Strng=Strng+" [closed]"
                               Endif
                            Endif
                         Endif
                         Temp9!=Temp9!+1!
                         If Temp9!=1! Then
                            Mid$(Strng,1,1)=Ucase$(Mid$(Strng,1,1))
                         Endif
                         Strng=Rtrim$(ContainerRecord.Prefix1)+Strng
                         Strng2=", "
                      Endif
                   Endif
                Endif
                If Var6!=SFalse Then
                   Exit Do
                Endif
                Temp5!=Var6!
             Loop
          Endif
          Allow.Break=False
          Break=False
          If Temp9!=SFalse Then
             Strng="Nothing at all."
          Else
             If Temp9!>1! Then
                Strng="and "+Strng
             Endif
          Endif
          Call Convert.ANSI(True,VarQ,VarR)
          Carriage.Return=True
          Graphics.On=True
          Call IO.O
          Graphics.On=False
          If Len(Strng2) Then
             Strng=Left$(Strng2,Len(Strng2)-2)+"."
          Else
             Strng="."
          Endif
          Call IO.O
       Endif
       Graphics.On=False
       Call More.Prompt
       Exit Sub
    Endif
    ' offline users.
    Call Num2
    Call Check.User
    If User.Temp Then
       Call He.She
       Graphics.Off=True
       Carriage.Return=True
       Strng=Prefix1+"'s "
       Call IO.O
       Strng=UserRecord2.CodeName
       Strng=Rtrim$(Strng)
       Strng=Lcase$(Strng)
       Mid$(Strng,1,1)=UCase$(Mid$(Strng,1,1))
       Strng=Left$(Strng,30)
       Strng=Rtrim$(UserRecord2.Prefix1)+Strng
       Call Convert.ANSI(True,VarQ,VarR)
       Carriage.Return=True
       Graphics.On=True
       Call IO.O
       Graphics.On=False
       For Var!=1! To Lof(TeamFile)/TeamRecLen
          Call Read.Record(TeamFile,Var!)
          If TeamRecord.Deleted=False Then
             For VarY=1 To MaxTeamMembers
                Var2!=TeamRecord.UserIndex(VarY)
                If Var2!=User.Index Then
                   For VarZ=1 To MaxTeamMembers
                      Var2!=TeamRecord.UserIndex(VarZ)
                      If Var2!=MessWorkRecord4.Index Then
                         Var4=True
                         Var5=TeamRecord.Activated(VarZ)
                         Exit For
                      Endif
                   Next
                   If Var4 Then
                      Exit For
                   Endif
                Endif
             Next
             If Var4 Then
                Exit For
             Endif
          Endif
       Next
       If Var4 Then
          Strng=Strng+" (team)"
       Endif
       Var6=UserRecord2.Level
       If Var6=0 Then
          Strng=Strng+" (dead)"
       Else
          Select Case Var6
          Case 1 To 10
             Strng2=Rtrim$(Numeral(Var6))
          Case Else
             Strng2=Form$(Cdbl(Var6))
          End Select
          Strng=Strng+" (level "+Strng2+")"
          If Userrecord2.Hidden Then
             Strng=Strng+" [hidden]"
          Endif
          If Userrecord2.Invisible Then
             Strng=Strng+" [inv]"
          Endif
       Endif
       Strng=Strng+"."
       Call IO.O
       If Var6=0 Then
          Exit Sub
       Endif
       If Var4 Then
          If Var5 Then
             Strng=Prefix1+"'s an active team member."
          Else
             Strng=Prefix1+"'s not active."
          Endif
          Call IO.O
       Endif
       If Last.Command.Number=Identify.Command Then
          If MessWorkRecord4.Align1+MessWorkRecord4.Align2<=False Then
             Strng=Prefix1+" looks friendly."
          Else
             Strng=Prefix1+" looks hostile."
          Endif
          Call IO.O
          If UserRecord2.Poison Then
             Strng=Prefix1+" is poisoned."
             Call IO.O
          Endif
          Strng="Vitals: Fat "+Form$(Cdbl(UserRecord2.Fatigue))+"/"+_
          Form$(Cdbl(UserRecord2.FatigueMax))+_
          " Vit "+Form$(Cdbl(UserRecord2.Vitality))+"/"+_
          Form$(Cdbl(UserRecord2.VitalityMax))+_
          " Mag "+Form$(Cdbl(UserRecord2.Magic))+"/"+_
          Form$(Cdbl(UserRecord2.MagicMax))+_
          " Psi "+Form$(Cdbl(UserRecord2.Psionic))+"/"+_
          Form$(Cdbl(UserRecord2.PsionicMax))
          Call IO.O
          Strng="Stats:"
          For Temp2=1 To MaxStats
             Strng=Strng+" "+Left$(Stat(Temp2),3)+" "+ _
             Form$(Cdbl(UserRecord2.Stats(Temp2)))
          Next
          Call IO.O
          Strng="Weapons: "
          For Temp2=1 To MaxWeapons
             Strng=Strng+Rtrim$(Weapon.Type.Name(Temp2))+">"+_
             Str$(UserRecord2.Weapons(Temp2))+"% "
          Next
          Call IO.O
          Var#=MessWorkRecord4.Hits
          If Var#<0# Then
             Var#=0#
          Endif
          Call Amount(UserRecord2.Gold,VarQ$)
          Call Amount(MessWorkRecord4.Exp,VarQ2$)
          Strng=Prefix1+" has "+Form$(Var#)+" hits,"+VarQ2$+" experience, and"+VarQ$+" gold."
          Call IO.O
          Strng2=Nul
          Strng=Prefix1+" carries the following treasure:"
          Call IO.O
          Temp9!=SFalse
          Temp4!=UserRecord2.First
          If Temp4! Then
             Do While Lost.Carrier=False
                Call Read.Record(UserInvFile,Temp4!)
                Temp6!=MessWorkRecord6.Next
                Temp2!=MessWorkRecord6.Index
                If Temp2!<SFalse Then
                   Temp2!=Abs(Temp2!)
                   Call Convert.ANSI(True,VarQ,VarR)
                   Carriage.Return=True
                   Graphics.On=True
                   Call IO.O
                   Graphics.On=False
                   If Len(Strng2) Then
                      Carriage.Return=True
                      Strng=Strng2
                      Call IO.O
                   Endif
                   Call Read.Record(ObjectFile,Temp2!)
                   Strng=Rtrim$(ObjectRecord.ObjectName)
                   Temp9!=Temp9!+1!
                   If Temp9!=1! Then
                      Mid$(Strng,1,1)=Ucase$(Mid$(Strng,1,1))
                   Endif
                   Strng=Rtrim$(ObjectRecord.Prefix1)+Strng
                   Strng2=", "
                Else
                   If Temp2!>SFalse Then
                      Call Convert.ANSI(True,VarQ,VarR)
                      Carriage.Return=True
                      Graphics.On=True
                      Call IO.O
                      Graphics.On=False
                      If Len(Strng2) Then
                         Carriage.Return=True
                         Strng=Strng2
                         Call IO.O
                      Endif
                      Call Read.Record(TreasureFile,Temp2!)
                      Strng=Rtrim$(TreasureRecord.TreasureName)
                      Temp9!=Temp9!+1!
                      If Temp9!=1! Then
                         Mid$(Strng,1,1)=Ucase$(Mid$(Strng,1,1))
                      Endif
                      Strng=Rtrim$(TreasureRecord.Prefix1)+Strng
                      Strng2=", "
                   Endif
                Endif
                If Temp6!=SFalse Then
                   Exit Do
                Endif
                Temp4!=Temp6!
             Loop
          Endif
          Temp5!=UserRecord2.First2
          If Temp5! Then
             Do While Lost.Carrier=False
                Call Read.Record(ContainerFile,Temp5!)
                Var6!=ContainerRecord.Next
                If ContainerRecord.WithinContainer=SFalse Then
                   If ContainerRecord.DeletedContainer=False Then
                      Carriage.Return=True
                      Temp6=True
                      If ContainerRecord.InvisibleContainer Then
                         Temp6=False
                         If Normal.User=False Then
                            Temp6=True
                         Endif
                      Endif
                      If Temp6 Then
                         Call Convert.ANSI(True,VarQ,VarR)
                         Carriage.Return=True
                         Graphics.On=True
                         Call IO.O
                         Graphics.On=False
                         If Len(Strng2) Then
                            Carriage.Return=True
                            Strng=Strng2
                            Call IO.O
                         Endif
                         Strng=Lcase$(Rtrim$(ContainerRecord.ContainerName))
                         If ContainerRecord.InvisibleContainer Then
                            Strng=Strng+" [inv]"
                         Endif
                         If ContainerRecord.Damaged=True Then
                            Strng=Strng+" [damaged]"
                         Else
                            If ContainerRecord.Locked=True Then
                               Strng=Strng+" [locked]"
                            Endif
                            If ContainerRecord.Locked=1 Then
                               If ContainerRecord.Closed Then
                                  Strng=Strng+" [closed]"
                               Endif
                            Endif
                         Endif
                         Temp9!=Temp9!+1!
                         If Temp9!=1! Then
                            Mid$(Strng,1,1)=Ucase$(Mid$(Strng,1,1))
                         Endif
                         Strng=Rtrim$(ContainerRecord.Prefix1)+Strng
                         Strng2=", "
                      Endif
                   Endif
                Endif
                If Var6!=SFalse Then
                   Exit Do
                Endif
                Temp5!=Var6!
             Loop
          Endif
          If Temp9!=SFalse Then
             Strng="Nothing at all."
          Else
             If Temp9!>1! Then
                Strng="and "+Strng
             Endif
          Endif
          Call Convert.ANSI(True,VarQ,VarR)
          Carriage.Return=True
          Graphics.On=True
          Call IO.O
          Graphics.On=False
          If Len(Strng2) Then
             Strng=Left$(Strng2,Len(Strng2)-2)+"."
          Else
             Strng="."
          Endif
          Call IO.O
       Endif
       Graphics.On=False
       Call More.Prompt
       Exit Sub
    Endif
    ' online monsters.
    Call Num
    Call Check.Monster
    If Monster.Temp Then
       Call The.Or.An
       Strng="It's "+Prefix1+Rtrim$(MessWorkRecord3.Monster.Prefix1)+Out3
       Call Convert.ANSI(True,VarQ,VarR)
       Carriage.Return=True
       Graphics.On=True
       Call IO.O
       Graphics.On=False
       Temp4=MessWorkRecord3.Monster.Level
       Strng=Strng+" (level "+Form$(Cdbl((Temp4-1)*2+1))+" to "+Form$(Cdbl(Temp4*2))+")"
       If MessWorkRecord3.Monster.Permanent=-2 Then
          Strng=Strng+" [perm]"
       Endif
       If MessWorkRecord3.Monster.Invisible Then
          Strng=Strng+" [inv]"
       Endif
       If Last.Command.Number=Identify.Command Then
          If Debug.Mode Then
             If MessWorkRecord3.Monster.RemainsInRoom Then
                Strng=Strng+" [static]"
             Endif
             If MessWorkRecord3.IsAutomaton Then
                Strng=Strng+" [automaton]"
             Endif
             Var#=0#
             If MonsterRecord.Buffer15 Then
                Var#=1000000 * MonsterRecord.Buffer15
             Endif
             Var#=Var#+MonsterRecord.Buffer16
             Strng=Strng+" [killed "+Form$(Var#)+"]"
          Endif
       Endif
       Strng=Strng+"."
       Call IO.O
       If Last.Command.Number=Identify.Command Then
          Strng="It has "+Form$(Cdbl(MessWorkRecord3.Monster.Hits))+" hits,"
          Call Amount(MessWorkRecord3.Monster.Experience,Var$)
          Strng=Strng+Var$+" experience,"
          Call Amount(MessWorkRecord3.Monster.Gold,Var$)
          Strng=Strng+Var$+" gold."
          Call IO.O
          Var1!=MessWorkRecord3.Weapon(1).Index ' weapon
          If MessWorkRecord3.Weapon(1).Charges=0 Then
             Var1!=0!
          Endif
          Var2!=MessWorkRecord3.Weapon(2).Index ' shield
          If MessWorkRecord3.Weapon(2).Charges=0 Then
             Var2!=0!
          Endif
          If Var1!>0! Or Var2!>0! Then
             If Var1!>0! Then
                Strng="It's holding "
                Carriage.Return=True
                Graphics.Off=True
                Call IO.O
                Call Read.Record(TreasureFile,Var1!)
                Strng=Rtrim$(TreasureRecord.Prefix1)
                Strng2=Rtrim$(TreasureRecord.TreasureName)
                Strng=Strng+Strng2
                Call Convert.ANSI(True,VarQ,VarR)
                Graphics.On=True
                Carriage.Return=True
                Call IO.O
                Graphics.On=False
                Strng=" (+"+Mid$(Str$(MessWorkRecord3.Weapon(1).Plus),2)+")"
                Carriage.Return=True
                Call IO.O
                If Var2!>0! Then
                   Strng=Strng+" and "
                   Carriage.Return=True
                   Call IO.O
                Endif
             Endif
             If Var2!>0! Then
                If Var1!=0! Then
                   Strng="It's holding "
                   Carriage.Return=True
                   Graphics.Off=True
                   Call IO.O
                Endif
                Call Read.Record(TreasureFile,Var2!)
                Strng=Rtrim$(TreasureRecord.Prefix1)
                Strng2=Rtrim$(TreasureRecord.TreasureName)
                Strng=Strng+Strng2
                Call Convert.ANSI(True,VarQ,VarR)
                Graphics.On=True
                Carriage.Return=True
                Call IO.O
                Graphics.On=False
                Strng=" (+"+Mid$(Str$(MessWorkRecord3.Weapon(2).Plus),2)+")"
                Carriage.Return=True
                Call IO.O
             Endif
             Strng=Strng+"."
             Call IO.O
          Endif
          Var1!=MessWorkRecord3.Weapon(3).Index ' armor
          If MessWorkRecord3.Weapon(3).Charges=0 Then
             Var1!=0!
          Endif
          If Var1!>0! Then
             Strng="It's wearing "
             Carriage.Return=True
             Graphics.Off=True
             Call IO.O
             Call Read.Record(TreasureFile,Var1!)
             Strng=Rtrim$(TreasureRecord.Prefix1)
             Strng2=Rtrim$(TreasureRecord.TreasureName)
             Strng=Strng+Strng2
             Call Convert.ANSI(True,VarQ,VarR)
             Graphics.On=True
             Carriage.Return=True
             Call IO.O
             Graphics.On=False
             Strng=" (+"+Mid$(Str$(MessWorkRecord3.Weapon(3).Plus),2)+")."
             Call IO.O
          Endif
          Strng="It carries the following treasure:"
          Call IO.O
          Temp9!=SFalse
          If MessWorkRecord3.Monster.Permanent=-2 Then
             VarX=True
          Else
             VarX=False
          Endif
          Strng2=Nul
          For Temp4!=1! To Lof(MessWorkFile5)/MessWorkRecLen5
             Call Read.Record(MessWorkFile5,Temp4!)
             Temp2!=MessWorkRecord5.Index
             Temp8=False
             If VarX Then
                If Temp2!=-Choice Then
                   Temp8=True
                Endif
             Else
                If Temp2!=Choice Then
                   Temp8=True
                Endif
             Endif
             If MessWorkRecord5.Room<>Room Then
                Temp8=False
             Endif
             If MessWorkRecord5.Monster<>Monster.Temp Then
                Temp8=False
             Endif
             If Temp8 Then
                Temp2!=MessWorkRecord5.Inv
                If Temp2!<SFalse Then
                   Temp2!=Abs(Temp2!)
                   If Temp2!>SFalse And Temp2!<=Lof(ObjectFile)/ObjectRecLen Then
                      Call Convert.ANSI(True,VarQ,VarR)
                      Carriage.Return=True
                      Graphics.On=True
                      Call IO.O
                      Graphics.On=False
                      If Len(Strng2) Then
                         Carriage.Return=True
                         Strng=Strng2
                         Call IO.O
                      Endif
                      Call Read.Record(ObjectFile,Temp2!)
                      Strng=Rtrim$(ObjectRecord.ObjectName)
                      Temp9!=Temp9!+1!
                      If Temp9!=1! Then
                         Mid$(Strng,1,1)=Ucase$(Mid$(Strng,1,1))
                      Endif
                      Strng=Rtrim$(ObjectRecord.Prefix1)+Strng
                      Strng2=", "
                   Endif
                Else
                   If Temp2!>SFalse And Temp2!<=Lof(TreasureFile)/TreasureRecLen Then
                      Call Convert.ANSI(True,VarQ,VarR)
                      Carriage.Return=True
                      Graphics.On=True
                      Call IO.O
                      Graphics.On=False
                      If Len(Strng2) Then
                         Carriage.Return=True
                         Strng=Strng2
                         Call IO.O
                      Endif
                      Call Read.Record(TreasureFile,Temp2!)
                      Strng=Rtrim$(TreasureRecord.TreasureName)
                      Temp9!=Temp9!+1!
                      If Temp9!=1! Then
                         Mid$(Strng,1,1)=Ucase$(Mid$(Strng,1,1))
                      Endif
                      Strng=Rtrim$(TreasureRecord.Prefix1)+Strng
                      Strng2=", "
                   Endif
                Endif
             Endif
          Next
          If Temp9!=SFalse Then
             Strng="Nothing at all."
          Else
             If Temp9!>1! Then
                Strng="and "+Strng
             Endif
          Endif
          Call Convert.ANSI(True,VarQ,VarR)
          Carriage.Return=True
          Graphics.On=True
          Call IO.O
          Graphics.On=False
          If Len(Strng2) Then
             Strng=Left$(Strng2,Len(Strng2)-2)+"."
          Else
             Strng="."
          Endif
          Call IO.O
          Temp4!=MessWorkRecord3.Monster.Spell
          If Temp4!>SFalse And Temp4!<=Lof(SpellFile)/SpellRecLen Then
             Call Read.Record(SpellFile,Temp4!)
             Strng=Rtrim$(SpellRecord.Prefix1)
             Strng="It can cast "+Strng+Rtrim$(SpellRecord.SpellName)
             Call Convert.ANSI(True,VarQ,VarR)
             Carriage.Return=True
             Graphics.On=True
             Call IO.O
             Graphics.On=False
             Strng=" spells!"
             Graphics.Off=True
             Call IO.O
          Endif
          If MessWorkRecord3.Monster.Poison=True Then
             Strng="It can poison!"
             Call IO.O
          Endif
          If MessWorkRecord3.Monster.Poison>False Then
             Strng="It's poisoned!"
             Call IO.O
          Endif
          If MessWorkRecord3.Monster.LevelDrain Then
             Strng="It can drain levels!"
             Call IO.O
          Endif
          If MessWorkRecord3.Monster.Psionic Then
             Strng="It can cast psi spells!"
             Call IO.O
          Endif
       Endif
       Graphics.Off=False
       Exit Sub
    Endif
    ' search objects/treasure in room.
    Call Num
    Prefix1="It's "
    Temp4=True
    Temp6=False
    Temp7!=SFalse
    TempC=False
    If Parsed.Command1<>Nul Then
       Temp5!=RoomRecord.First
       If Temp5! Then
          Do While Lost.Carrier=False
             Call Read.Record(RoomInvFile,Temp5!)
             If MessWorkRecord6.Room=SFalse Then
                Exit Do
             Endif
             Temp6!=MessWorkRecord6.Next
             TempA!=MessWorkRecord6.Index
             If TempA!<SFalse Then
                VarB!=Abs(TempA!)
                If VarB!>SFalse And VarB!<=Lof(ObjectFile)/ObjectRecLen Then
                   Call Read.Record(ObjectFile,VarB!)
                   Out3=ObjectRecord.ShortName
                   Out3=Left$(Out3,Len(Parsed.Command1))
                   If Out3=Parsed.Command1 Then
                      TempC=TempC+1
                      If Parse.Temp=False Or TempC=Parse.Temp Then
                         Out3=ObjectRecord.ObjectName
                         Out3=Rtrim$(Out3)
                         Temp7!=TempA!
                         Temp6=MessWorkRecord6.Charges
                         Exit Do
                      Endif
                   Endif
                Endif
             Endif
             If TempA!>SFalse Then
                VarB!=TempA!
                If VarB!>SFalse And VarB!<=Lof(TreasureFile)/TreasureRecLen Then
                   Call Read.Record(TreasureFile,VarB!)
                   Out3=TreasureRecord.ShortName
                   Out3=Left$(Out3,Len(Parsed.Command1))
                   If Out3=Parsed.Command1 Then
                      TempC=TempC+1
                      If Parse.Temp=False Or TempC=Parse.Temp Then
                         Out3=TreasureRecord.TreasureName
                         Out3=Rtrim$(Out3)
                         Temp7!=TempA!
                         Temp6=MessWorkRecord6.Charges
                         Exit Do
                      Endif
                   Endif
                Endif
             Endif
             If Temp6!=SFalse Then
                Exit Do
             Endif
             Temp5!=Temp6!
          Loop
          If Temp7! Then
             TempX=-1
             Goto Display.Item
             Exit Sub
          Endif
       Endif
    Endif
    ' room containers.
    Call Num
    Temp4=False
    Call Search.Room.Containers
    If TempA! Then
       Prefix1="It's " ' container in room
       Call Look.In.Container(Nul)
       Exit Sub
    Endif
    ' search objects/treasure on user.
    Call Num
    Prefix1="You are carrying "
    Temp4=False
    Temp6=False
    Temp7!=SFalse
    TempC=False
    If Parsed.Command1<>Nul Then
       For Temp5!=1! To Lof(MessWorkFile6)/MessWorkRecLen6
          Call Read.Record(MessWorkFile6,Temp5!)
          If MessWorkRecord6.User=User.Index Then
             TempA!=MessWorkRecord6.Index
             If TempA!<SFalse Then
                VarQ!=Abs(TempA!)
                If VarQ!>SFalse And VarQ!<=Lof(ObjectFile)/ObjectRecLen Then
                   Call Read.Record(ObjectFile,VarQ!)
                   Out3=ObjectRecord.ShortName
                   Out3=Left$(Out3,Len(Parsed.Command1))
                   If Out3=Parsed.Command1 Then
                      TempC=TempC+1
                      If Parse.Temp=False Or TempC=Parse.Temp Then
                         Out3=ObjectRecord.ObjectName
                         Out3=Rtrim$(Out3)
                         Temp7!=TempA!
                         Temp6=MessWorkRecord6.Charges
                         Exit For
                      Endif
                   Endif
                Endif
             Endif
             If TempA!>SFalse Then
                VarQ!=TempA!
                If VarQ!>SFalse And VarQ!<=Lof(TreasureFile)/TreasureRecLen Then
                   Call Read.Record(TreasureFile,VarQ!)
                   Out3=TreasureRecord.ShortName
                   Out3=Left$(Out3,Len(Parsed.Command1))
                   If Out3=Parsed.Command1 Then
                      TempC=TempC+1
                      If Parse.Temp=False Or TempC=Parse.Temp Then
                         Out3=TreasureRecord.TreasureName
                         Out3=Rtrim$(Out3)
                         Temp7!=TempA!
                         Temp6=MessWorkRecord6.Charges
                         Exit For
                      Endif
                   Endif
                Endif
             Endif
          Endif
       Next
       If Temp7! Then
          TempX=-1
          Goto Display.Item
          Exit Sub
       Endif
    Endif
    ' user containers.
    Call Num
    Temp4=True
    Call Search.User.Containers
    If TempA! Then
       Prefix1="You are carrying " ' container in inventory
       Call Look.In.Container(Nul)
       Exit Sub
    Endif
    ' search user weapons.
    Call Num
    Temp4=False
    Temp6=False
    Temp7!=SFalse
    TempC=False
    If Parsed.Command1<>Nul Then
       For Var1=1 To 10
          Var2!=UserRecord.Weapon(Var1).Index
          If Var2! Then
             Call Read.Record(TreasureFile,Var2!)
             Out3=TreasureRecord.ShortName
             Out3=Left$(Out3,Len(Parsed.Command1))
             If Out3=Parsed.Command1 Then
                TempC=TempC+1
                If Parse.Temp=False Or TempC=Parse.Temp Then
                   Out3=TreasureRecord.TreasureName
                   Out3=Rtrim$(Out3)
                   If Var1=5 Or Var1=7 Then ' shield/weapon
                      Prefix1="You are holding "
                   Else ' armor/other
                      Prefix1="You are wearing "
                   Endif
                   Temp7!=Var2!
                   Temp6=UserRecord.Weapon(Var1).Charges
                   Exit For
                Endif
             Endif
          Endif
       Next
       If Temp7! Then
          TempX=-1
          Goto Display.Item
          Exit Sub
       Endif
    Endif
    ' display coins
    If Parsed.Command1="COINS" Then
       TempC=False
       Close #TempFile1
       FileName=DND.Path+"coins.dat"
       Open FileName For Random Shared As #TempFile1 Len=16
       Field #TempFile1, 4 As R$, 8 As G$, 2 As P1$, 2 As P2$
       V! = Lof(TempFile1)/16
       For X!=1! To V!
          GET #TempFile1, X!
          If CVS(R$)=Room Then
             TempC=TempC+1
             If Parse.Temp=False Or TempC=Parse.Temp Then
                VarQ$=" "
                Select Case Cvi(P2$)
                Case 0 ' gold
                   VarQ$=" gold "
                Case 1 ' silver
                   VarQ$=" silver "
                Case 2 ' copper
                   VarQ$=" copper "
                Case 3 ' bronze
                   VarQ$=" bronze "
                End Select
                If Cvi(P1$)=0 Then
                   Strng="It's some"+VarQ$+"coins."
                Else
                   Strng="It's some"+VarQ$+"coins [inv]."
                Endif
                Call IO.O
                If Last.Command.Number=Identify.Command Then
                   Select Case Cvi(P2$)
                   Case 0 ' gold
                      Var#=Cvd(G$)
                      Select Case Var#
                      Case 0#
                         Strng="It's worth zero gold pieces."
                      Case 1#
                         Strng="It's worth one gold piece."
                      Case 2# To 10#
                         Strng="It's worth "+Rtrim$(Numeral(Cint(Var#)))+" gold pieces."
                      Case Else
                         Call Amount(Var#,VarQ2$)
                         Strng="It's worth"+VarQ2$+" gold pieces."
                      End Select
                      Call IO.O
                   Case 1 ' silver
                      Var#=Cvd(G$)
                      Select Case Var#
                      Case 0#
                         Strng="It's worth zero silver pieces."
                      Case 1#
                         Strng="It's worth one silver piece."
                      Case 2# To 10#
                         Strng="It's worth "+Rtrim$(Numeral(Cint(Var#)))+" silver pieces."
                      Case Else
                         Call Amount(Var#,VarQ2$)
                         Strng="It's worth"+VarQ2$+" silver pieces."
                      End Select
                      Call IO.O
                   Case 2 ' copper
                      Var#=Cvd(G$)
                      Select Case Var#
                      Case 0#
                         Strng="It's worth zero copper pieces."
                      Case 1#
                         Strng="It's worth one copper piece."
                      Case 2# To 10#
                         Strng="It's worth "+Rtrim$(Numeral(Cint(Var#)))+" copper pieces."
                      Case Else
                         Call Amount(Var#,VarQ2$)
                         Strng="It's worth"+VarQ2$+" copper pieces."
                      End Select
                      Call IO.O
                   Case 3 ' bronze
                      Var#=Cvd(G$)
                      Select Case Var#
                      Case 0#
                         Strng="It's worth zero bronze pieces."
                      Case 1#
                         Strng="It's worth one bronze piece."
                      Case 2# To 10#
                         Strng="It's worth "+Rtrim$(Numeral(Cint(Var#)))+" bronze pieces."
                      Case Else
                         Call Amount(Var#,VarQ2$)
                         Strng="It's worth"+VarQ2$+" bronze pieces."
                      End Select
                      Call IO.O
                   End Select
                Endif
                Exit Sub
             Endif
          Endif
       Next
    Endif
    ' display gold coins
    If Parsed.Command1="GOLD" Then
       TempC=False
       Close #TempFile1
       FileName=DND.Path+"coins.dat"
       Open FileName For Random Shared As #TempFile1 Len=16
       Field #TempFile1, 4 As R$, 8 As G$, 2 As P1$, 2 As P2$
       V! = Lof(TempFile1)/16
       For X!=1! To V!
          GET #TempFile1, X!
          If CVS(R$)=Room Then
             If Cvi(P2$)=0 Then
                TempC=TempC+1
                If Parse.Temp=False Or TempC=Parse.Temp Then
                   If Cvi(P1$)=0 Then
                      Strng="It's some gold coins."
                   Else
                      Strng="It's some gold coins [inv]."
                   Endif
                   Call IO.O
                   If Last.Command.Number=Identify.Command Then
                      Var#=Cvd(G$)
                      Select Case Var#
                      Case 0#
                         Strng="It's worth zero gold pieces."
                      Case 1#
                         Strng="It's worth one gold piece."
                      Case 2# To 10#
                         Strng="It's worth "+Rtrim$(Numeral(Cint(Var#)))+" gold pieces."
                      Case Else
                         Call Amount(Var#,VarQ2$)
                         Strng="It's worth"+VarQ2$+" gold pieces."
                      End Select
                      Call IO.O
                   Endif
                   Exit Sub
                Endif
             Endif
          Endif
       Next
    Endif
    ' display silver coins
    If Parsed.Command1="SILVER" Then
       TempC=False
       Close #TempFile1
       FileName=DND.Path+"coins.dat"
       Open FileName For Random Shared As #TempFile1 Len=16
       Field #TempFile1, 4 As R$, 8 As G$, 2 As P1$, 2 As P2$
       V! = Lof(TempFile1)/16
       For X!=1! To V!
          GET #TempFile1, X!
          If CVS(R$)=Room Then
             If Cvi(P2$)=1 Then
                TempC=TempC+1
                If Parse.Temp=False Or TempC=Parse.Temp Then
                   If Cvi(P1$)=0 Then
                      Strng="It's some silver coins."
                   Else
                      Strng="It's some silver coins [inv]."
                   Endif
                   Call IO.O
                   If Last.Command.Number=Identify.Command Then
                      Var#=Cvd(G$)
                      Select Case Var#
                      Case 0#
                         Strng="It's worth zero silver pieces."
                      Case 1#
                         Strng="It's worth one silver piece."
                      Case 2# To 10#
                         Strng="It's worth "+Rtrim$(Numeral(Cint(Var#)))+" silver pieces."
                      Case Else
                         Call Amount(Var#,VarQ2$)
                         Strng="It's worth"+VarQ2$+" silver pieces."
                      End Select
                      Call IO.O
                   Endif
                   Exit Sub
                Endif
             Endif
          Endif
       Next
    Endif
    ' display copper coins
    If Parsed.Command1="COPPER" Then
       TempC=False
       Close #TempFile1
       FileName=DND.Path+"coins.dat"
       Open FileName For Random Shared As #TempFile1 Len=16
       Field #TempFile1, 4 As R$, 8 As G$, 2 As P1$, 2 As P2$
       V! = Lof(TempFile1)/16
       For X!=1! To V!
          GET #TempFile1, X!
          If CVS(R$)=Room Then
             If Cvi(P2$)=2 Then
                TempC=TempC+1
                If Parse.Temp=False Or TempC=Parse.Temp Then
                   If Cvi(P1$)=0 Then
                      Strng="It's some copper coins."
                   Else
                      Strng="It's some copper coins [inv]."
                   Endif
                   Call IO.O
                   If Last.Command.Number=Identify.Command Then
                      Var#=Cvd(G$)
                      Select Case Var#
                      Case 0#
                         Strng="It's worth zero copper pieces."
                      Case 1#
                         Strng="It's worth one copper piece."
                      Case 2# To 10#
                         Strng="It's worth "+Rtrim$(Numeral(Cint(Var#)))+" copper pieces."
                      Case Else
                         Call Amount(Var#,VarQ2$)
                         Strng="It's worth"+VarQ2$+" copper pieces."
                      End Select
                      Call IO.O
                   Endif
                   Exit Sub
                Endif
             Endif
          Endif
       Next
    Endif
    ' display broze coins
    If Parsed.Command1="BRONZE" Then
       TempC=False
       Close #TempFile1
       FileName=DND.Path+"coins.dat"
       Open FileName For Random Shared As #TempFile1 Len=16
       Field #TempFile1, 4 As R$, 8 As G$, 2 As P1$, 2 As P2$
       V! = Lof(TempFile1)/16
       For X!=1! To V!
          GET #TempFile1, X!
          If CVS(R$)=Room Then
             If Cvi(P2$)=3 Then
                TempC=TempC+1
                If Parse.Temp=False Or TempC=Parse.Temp Then
                   If Cvi(P1$)=0 Then
                      Strng="It's some bronze coins."
                   Else
                      Strng="It's some bronze coins [inv]."
                   Endif
                   Call IO.O
                   If Last.Command.Number=Identify.Command Then
                      Var#=Cvd(G$)
                      Select Case Var#
                      Case 0#
                         Strng="It's worth zero bronze pieces."
                      Case 1#
                         Strng="It's worth one bronze piece."
                      Case 2# To 10#
                         Strng="It's worth "+Rtrim$(Numeral(Cint(Var#)))+" bronze pieces."
                      Case Else
                         Call Amount(Var#,VarQ2$)
                         Strng="It's worth"+VarQ2$+" bronze pieces."
                      End Select
                      Call IO.O
                   Endif
                   Exit Sub
                Endif
             Endif
          Endif
       Next
    Endif
 Endif
 If VarA$=Nul Then
    Strng="I can't examine that!"
    Call IO.O
    Exit Sub
 Endif
 Temp7!=0!
 ' call secondary display
Display.Item:
 Gosub Get.Config2
 Filename$=Option1$+"CMD083A.EXE"
 If Dir$(Filename$)<>Nul Then
    Parsed.Command1=VarA$
    Parsed.Command2=VarB$
    Chain Filename$
 Endif
 Strng="I can't examine that!"
 Call IO.O
 Exit Sub
Get.Config2:
 VarX$="CMD083"
 Option1$=DND.Path
 VarX=0
 Do
    VarX=VarX+1
    If VarX>Options.Lines Then
       Exit Do
    Endif
    Var$=Ltrim$(Rtrim$(Options.Array(VarX)))
    If Ucase$(Var$)="[RAMDRIVE]" Then
       Do
          VarX=VarX+1
          If VarX>Options.Lines Then
             Return
          Endif
          Var$=Ltrim$(Rtrim$(Options.Array(VarX)))
          If Ucase$(Var$)="[END]" Then
             Return
          Endif
          VarZ=Instr(Var$,"=")
          If VarZ Then
             Var2$=Ltrim$(Rtrim$(Left$(Var$,VarZ-1)))
             Var3$=Ltrim$(Rtrim$(Mid$(Var$,VarZ+1)))
             If Ucase$(Var2$)=VarX$ Or Ucase$(Var2$)="CMD*" Then
                ' force cmd module to ramdrive
                If Var3$="-1" Then
                   Option1$=Data.Path3
                Else
                   Var3$=Ucase$(Var3$)
                   If Len(Var3$) Then
                      If Left$(Var3$,1)>="A" And Left$(Var3$,1)<="Z" Then
                         Select Case Len(Var3$)
                         Case 1
                            Option1$=Var3$+":\"
                         Case 2
                            If Right$(Var3$,1)=":" Then
                               Option1$=Var3$+"\"
                            Endif
                         Case 3
                            If Right$(Var3$,2)=":\" Then
                               Option1$=Var3$
                            Endif
                         End Select
                      Endif
                   Endif
                Endif
             Endif
          Endif
       Loop
    Endif
 Loop
 Return
Get.Config3:
 VarX=0
 OptionZ=-1
 Do
    VarX=VarX+1
    If VarX>Options.Lines Then
       Goto Next.Read
       Exit Do
    Endif
    Var$=Ltrim$(Rtrim$(Options.Array(VarX)))
    If Ucase$(Var$)="[CMD083]" Then
       Do
          VarX=VarX+1
          If VarX>Options.Lines Then
             Goto Next.Read
             Return
          Endif
          Var$=Ltrim$(Rtrim$(Options.Array(VarX)))
          If Ucase$(Var$)="[END]" Then
             Goto Next.Read
             Return
          Endif
          Var=Instr(Var$,"=")
          If Var Then
             Var2$=Lcase$(Ltrim$(Rtrim$(Left$(Var$,Var-1))))
             Var3$=Lcase$(Ltrim$(Rtrim$(Mid$(Var$,Var+1))))
             Gosub Parse.Options
          Endif
       Loop
    Endif
 Loop
 Return
Next.Read:
 Close #TempFile1
 Filename$=DND.Path+"CMD083.CFG"
 If Dir$(Filename$)="" Then
    Return
 Endif
 Open Filename$ For Input As #TempFile1
 Do
    If Eof(TempFile1) Then
       Exit Do
    Endif
    Line Input #TempFile1, Var$
    Var$=Ltrim$(Rtrim$(Var$))
    If Left$(Var$,1)<>";" Then
       VarX$=UserRecord.CodeName
       VarX$=Rtrim$(VarX$)
       VarX$=Ucase$(VarX$)
       If Ucase$(Var$)="["+VarX$+"]" Then
          VarZ=0
          OptionZ=-1
          Do
             If Eof(TempFile1) Then
                Exit Do
             Endif
             Line Input #TempFile1, Var$
             If Ucase$(Var$)="[END]" Then
                Return
             Endif
             Var=Instr(Var$,"=")
             If Var Then
                Var2$=Ltrim$(Rtrim$(Left$(Var$,Var-1)))
                Var3$=Ltrim$(Rtrim$(Mid$(Var$,Var+1)))
                Gosub Parse.Options
             Endif
          Loop
       Endif
   Endif
 Loop
 Return
Parse.Options:
 Select Case Var2$
 Case "allow.user.look"
    Select Case Var3$
    Case "0", "false", "off"
       OptionZ=0
    End Select
 End Select
Return
ErrorRsm33:
 Exit Sub
ErrorTrp33:
 Resume ErrorRsm33
End Sub

Sub Find.Custom2(Var,Var0!,Var2$)
 On Local Error Goto Err.Trp19a
 Var=False
 Line1=0
 Filename=DND.Path+"custom.dat"
 If Dir$(Filename)<>"" Then
    Close #TempFile1
    Open Filename For Input Shared As #TempFile1
    Do
       If Eof(TempFile1) Then Exit Do
       Line1=Line1+1
       Input #TempFile1,Var1$,Var1!,Var2!,X,Y
       Var1$=Ucase$(Left$(Var1$,12))
       If Len(Var1$) Then
          If Var1$=Ucase$(Parsed.Command1) Then
             If Var1!=Room Then
                If Sysop Or Normal.User=0 Or Debug.Mode Then
                   Eat$=""
                Else
                   If UserRecord.Level<Y Then
                      Exit Sub
                   Endif
                Endif
                Var=True
                Var0!=Var2!
                Var2$=Var1$
                If X Then
                   Var2$=Var2$+" [inv]"
                Endif
                If Y Then
                   Var2$=Var2$+" ["+Ltrim$(Str$(Y))+"]"
                Endif
                Exit Do
             Endif
          Endif
       Endif
    Loop
 Endif
Err.Rsm19a:
 Exit Sub
Err.Trp19a:
 If Debug.Mode Then
    Strng="Error in " + Ucase$(Filename) + " in line"+Str$(Line1)+"."
    Call IO.O
 Endif
 Resume Err.Rsm19a
End Sub
