

Here is the code...it is simply a modified version of the freely downloadable ImagicaTelnet client (which you can get at a number of different free download sites, just search). All I did was change the one sub and one function (see below). These are two procedures that must have some kind of error, but I can't figure it out! Here they are:
- Code: Select all
Sub AddColText(sOutput As String)
'On Error Resume Next
Dim CcStart, CcEnd
Dim ANSIprefix
Dim cCode As Integer
Dim StartCcP, EndCcP, oldSel, OldLen
CcStart = (Chr(27) + "[") ' this is the beginning of an ANSI color code.
CcEnd = "m" ' this is the end of an ANSI color code.
Do
Textboxtmp.SelStart = Len(Textboxtmp.Text)
Textboxtmp.SelColor = RGB(175, 175, 175)
Textboxtmp.SelBold = False
Textboxtmp.SelUnderline = False
Textboxtmp.SelItalic = False
Textboxtmp.SelLength = 0
StartCcP = InStr(sOutput, CcStart)
If StartCcP < 1 Then
Exit Do
End If
EndCcP = InStr(StartCcP, sOutput, CcEnd)
If EndCcP < 1 Then
Exit Do
End If
' this procedure determines whether the color code is BRIGHT or NORMAL.
ANSIprefix = Mid(sOutput, StartCcP + Len(CcStart) + 2, 2)
If ANSIprefix = "1;" Then
' this procedure strips the BRIGHT color code and adds 100 to cCode.
cCode = Val(Mid(sOutput, StartCcP + Len(CcStart) + 4, 2))
cCode = cCode + 100
Else
cCode = Val(ANSIprefix)
End If
Textboxtmp.SelColor = lastcolor
If cCode = 30 Then
lastcolor = RGB(75, 75, 0) ' ???
ElseIf cCode = 31 Then
lastcolor = RGB(75, 75, 75) ' BLACK
ElseIf cCode = 32 Then
lastcolor = RGB(175, 0, 0) ' RED
ElseIf cCode = 33 Then
lastcolor = RGB(0, 175, 0) ' GREEN
ElseIf cCode = 34 Then
lastcolor = RGB(175, 175, 0) ' YELLOW
ElseIf cCode = 35 Then
lastcolor = RGB(0, 0, 175) ' BLUE
ElseIf cCode = 36 Then
lastcolor = RGB(175, 0, 175) ' MAGENTA
ElseIf cCode = 37 Then
lastcolor = RGB(0, 175, 175) ' CYAN
ElseIf cCode = 130 Then
lastcolor = RGB(175, 175, 175) ' WHITE
ElseIf cCode = 131 Then
lastcolor = RGB(125, 125, 125) ' BBLACK
ElseIf cCode = 132 Then
lastcolor = RGB(255, 0, 0) ' BRED
ElseIf cCode = 133 Then
lastcolor = RGB(0, 255, 0) ' BGREEN
ElseIf cCode = 134 Then
lastcolor = RGB(255, 255, 0) ' BYELLOW
ElseIf cCode = 135 Then
lastcolor = RGB(0, 0, 255) ' BBLUE
ElseIf cCode = 136 Then
lastcolor = RGB(255, 0, 255) ' BMAGENTA
ElseIf cCode = 137 Then
lastcolor = RGB(0, 255, 255) ' BCYAN
ElseIf cCode = 138 Then
lastcolor = RGB(255, 255, 255) ' This line does not work.
End If
Textboxtmp.SelColor = lastcolor
Textboxtmp.SelText = Left(sOutput, StartCcP - 1)
sOutput = Mid(sOutput, EndCcP + 1)
TextBox.SelStart = StartCcP
TextBox.SelLength = 0
Loop
Textboxtmp.SelText = sOutput
Textboxtmp.SelStart = Len(Textboxtmp.Text)
TextBox.SelStart = oldSel
TextBox.SelLength = OldLen
End Sub
Any and all help is greatly appreciated at this point! Good luck figuring this one out. This has stumped me for a long time.
BTW- The server that i am logging into is LegendMUD @ mud.legendmud.org:9999
-={ MarioToad }=-



