Post by spyderspawn on Apr 26, 2004 22:34:22 GMT -5
help wanted on the auth process to this certain chat it's like msn but different auth proccess I tryed basing it off the ocx the creator of the chat had created for it but it kept making me hang in the chat so I am trying to get it worken on an msn chat client so far syam101 has gotten it worken but he never sent me the code so it's left for me to figure out .
'-----------------------this source is off the ocx
Private Sub Command3_Click()
WS.Connect "myenetwork.net", 6667 '-----------------------------
Command3.Enabled = False
End Sub
Private Sub WS_Connect()
WS.Senddata "IRCVERS IRC" & vbCrLf
End Sub
Private Sub WS_DataArrival(ByVal bytesTotal As Long)
WS.GetData Data, vbString
'txtmain.SelText = Data
Dim dynData() As String, i As Integer
dynData = Split(Data, vbCrLf)
ReDim Preserve dynData(UBound(dynData)) As String
For i = 0 To UBound(dynData)
Data = dynData(i)
Call Server2DataArrival
Next i
'if data contains multiple string (i.e access/names)
Erase dynData
End Sub
Public Sub Server2DataArrival()
Dim S1 As String
Dim S2 As String
Dim S3 As String
On Error Resume Next
S1 = Split(Data, " ")(1)
S2 = Split(Data, " ")(2)
S3 = Split(Data, " ")(3)
txtmain.SelStart = Len(txtmain.Text)
If Data Like ":TK2CHATWBC04 800*" Then
If NickNames = "" Then
WS.Senddata "PROP $ MSNREGCOOKIE :" & Text9.Text & "$" & Text10.Text & vbCrLf
Exit Sub
End If
If NickNames <> "" Then
WS.Senddata "NICK " & NickNames & vbCrLf
End If
Exit Sub
End If
If Data Like ":TK2CHATWBC04 433 *" Then
MsgBox "Nickname already in use.", vbOKOnly, "Nick in use"
WS.Close
Exit Sub
End If
If Data Like ":TK2CHATWBC04 913 *" Then
MsgBox "You are banned from this chatroom.", vbOKOnly, "Banned"
WS.Close
Exit Sub
End If
If Data Like ":TK2CHATWBC04 NOTICE *" Then
Call Broadcast
Exit Sub
End If
If Data Like ":TK2CHATWBC04 473 *" Then
MsgBox "Invite only chatroom.", vbOKOnly, "Invite only mode"
WS.Close
Exit Sub
End If
'If S1 = "332" Then
'RMname = S3
'Exit Sub
'End If
Dim topics As String
Dim ChatWcMessage As String
If S1 = "332" Then
RMname = S3
'ListView1.ListItems(ListView1.ListItems.Count).Text = Replace(ListView1.ListItems(ListView1.ListItems.Count).Text, ">", "Guest_")
txtmain.SelColor = &HC0&
txtmain.SelItalic = False
txtmain.SelText = "Connected." & vbCrLf
Label2.Caption = Replace(Replace(RMname, "%#", ""), "\b", " ")
'topics = Mid(Data, Loc(" :%") + 3)
lFoundPos = Len(txtmain.Text) - 1
topics = Split(Data, " :")(1)
topics = Replace(topics, "\b", " ")
'lFoundPos3 = Len(txtMain.Text) - 1
txtmain.SelItalic = False
txtmain.SelColor = &HFF0000
txtmain.SelText = vbCrLf & "The chat topic is: " & topics & vbCrLf & vbCrLf
Call SetPic
lFoundPos = Len(txtmain.Text) - 1
Exit Sub
End If
If Loc(":" & RMname & " PRIVMSG " & RMname & " :") Then
'lFoundPos3 = Len(txtMain.Text) - 1
ChatWcMessage = Split(Data, " :")(1)
'ChatWcMessage = Mid(Data, InStr(Len(txtroomname.text) + 1, Data, txtroomname.text, 1) + Len(txtroomname.text) + 1)
'If Left(ChatWcMessage, 1) = ":" Then ChatWcMessage = Right(ChatWcMessage, Len(ChatWcMessage) - 1)
txtmain.SelColor = &H8000&
txtmain.SelBold = True
txtmain.SelText = ChatWcMessage & vbCrLf & vbCrLf
txtmain.SelBold = False
Call SetPic
lFoundPos = Len(txtmain.Text) - 1
Exit Sub
End If
If Data Like ":*!*@*" And S1 = "KICK" Then
Call UserKicked
Exit Sub
End If
If Data Like ":*!*@*" And S1 = "JOIN" Then
Call UserJoined
Exit Sub
End If
If S1 = "PART" Then
Call UserParted
Exit Sub
End If
If S1 = "353" Then
'lst.ListItems.Clear
Call ReadNames
Exit Sub
End If
If Data Like ":*!*@*" And Loc(":ACTION") <> 0 And S1 = "PRIVMSG" Then
Call UserAction
Exit Sub
End If
If S1 = "PRIVMSG" And Loc("ACTION") = 0 Then
'txtMain.SelText = Data & vbCrLf
Call UserSpoke
Exit Sub
End If
If Data Like ":*!*@* WHISPER *:*" And S1 = "WHISPER" Then
Call UserWhisper
Exit Sub
End If
If S1 = "001" Then
'MyName = Mid(Data, Loc("001 ") + 4, Loc(" :") - 21)
MYname = S2
mYname2 = Replace(MYname, ">", "Guest_")
ListView1.ListItems.Add , MYname, MYname, "blank", "blank"
WS.Senddata "JOIN %#" & Text5.Text & vbCrLf
'das = True
Exit Sub
End If
If Data Like ":*!*@*" And S1 = "MODE" And S3 = "+q" Then Call MadeOwner
If Data Like ":*!*@*" And S1 = "MODE" And S3 = "+o" Then Call MadeHost
If Data Like ":*!*@*" And S1 = "MODE" And S3 = "-q" Then Call PartOwner
If Data Like ":*!*@*" And S1 = "MODE" And S3 = "-o" Then Call PartHost
If Data Like "PING :*" Then WS.Senddata "PONG bla" & vbCrLf
End Sub
' this has only one winsocket on it . but I want to try to get this connected with an msn chat client . its been done once .. but here is the catch with out the msnchatx.ocx running neither has to be with the regular chat control .. feel free to get a hold me for more details of coding ..
'-----------------------this source is off the ocx
Private Sub Command3_Click()
WS.Connect "myenetwork.net", 6667 '-----------------------------
Command3.Enabled = False
End Sub
Private Sub WS_Connect()
WS.Senddata "IRCVERS IRC" & vbCrLf
End Sub
Private Sub WS_DataArrival(ByVal bytesTotal As Long)
WS.GetData Data, vbString
'txtmain.SelText = Data
Dim dynData() As String, i As Integer
dynData = Split(Data, vbCrLf)
ReDim Preserve dynData(UBound(dynData)) As String
For i = 0 To UBound(dynData)
Data = dynData(i)
Call Server2DataArrival
Next i
'if data contains multiple string (i.e access/names)
Erase dynData
End Sub
Public Sub Server2DataArrival()
Dim S1 As String
Dim S2 As String
Dim S3 As String
On Error Resume Next
S1 = Split(Data, " ")(1)
S2 = Split(Data, " ")(2)
S3 = Split(Data, " ")(3)
txtmain.SelStart = Len(txtmain.Text)
If Data Like ":TK2CHATWBC04 800*" Then
If NickNames = "" Then
WS.Senddata "PROP $ MSNREGCOOKIE :" & Text9.Text & "$" & Text10.Text & vbCrLf
Exit Sub
End If
If NickNames <> "" Then
WS.Senddata "NICK " & NickNames & vbCrLf
End If
Exit Sub
End If
If Data Like ":TK2CHATWBC04 433 *" Then
MsgBox "Nickname already in use.", vbOKOnly, "Nick in use"
WS.Close
Exit Sub
End If
If Data Like ":TK2CHATWBC04 913 *" Then
MsgBox "You are banned from this chatroom.", vbOKOnly, "Banned"
WS.Close
Exit Sub
End If
If Data Like ":TK2CHATWBC04 NOTICE *" Then
Call Broadcast
Exit Sub
End If
If Data Like ":TK2CHATWBC04 473 *" Then
MsgBox "Invite only chatroom.", vbOKOnly, "Invite only mode"
WS.Close
Exit Sub
End If
'If S1 = "332" Then
'RMname = S3
'Exit Sub
'End If
Dim topics As String
Dim ChatWcMessage As String
If S1 = "332" Then
RMname = S3
'ListView1.ListItems(ListView1.ListItems.Count).Text = Replace(ListView1.ListItems(ListView1.ListItems.Count).Text, ">", "Guest_")
txtmain.SelColor = &HC0&
txtmain.SelItalic = False
txtmain.SelText = "Connected." & vbCrLf
Label2.Caption = Replace(Replace(RMname, "%#", ""), "\b", " ")
'topics = Mid(Data, Loc(" :%") + 3)
lFoundPos = Len(txtmain.Text) - 1
topics = Split(Data, " :")(1)
topics = Replace(topics, "\b", " ")
'lFoundPos3 = Len(txtMain.Text) - 1
txtmain.SelItalic = False
txtmain.SelColor = &HFF0000
txtmain.SelText = vbCrLf & "The chat topic is: " & topics & vbCrLf & vbCrLf
Call SetPic
lFoundPos = Len(txtmain.Text) - 1
Exit Sub
End If
If Loc(":" & RMname & " PRIVMSG " & RMname & " :") Then
'lFoundPos3 = Len(txtMain.Text) - 1
ChatWcMessage = Split(Data, " :")(1)
'ChatWcMessage = Mid(Data, InStr(Len(txtroomname.text) + 1, Data, txtroomname.text, 1) + Len(txtroomname.text) + 1)
'If Left(ChatWcMessage, 1) = ":" Then ChatWcMessage = Right(ChatWcMessage, Len(ChatWcMessage) - 1)
txtmain.SelColor = &H8000&
txtmain.SelBold = True
txtmain.SelText = ChatWcMessage & vbCrLf & vbCrLf
txtmain.SelBold = False
Call SetPic
lFoundPos = Len(txtmain.Text) - 1
Exit Sub
End If
If Data Like ":*!*@*" And S1 = "KICK" Then
Call UserKicked
Exit Sub
End If
If Data Like ":*!*@*" And S1 = "JOIN" Then
Call UserJoined
Exit Sub
End If
If S1 = "PART" Then
Call UserParted
Exit Sub
End If
If S1 = "353" Then
'lst.ListItems.Clear
Call ReadNames
Exit Sub
End If
If Data Like ":*!*@*" And Loc(":ACTION") <> 0 And S1 = "PRIVMSG" Then
Call UserAction
Exit Sub
End If
If S1 = "PRIVMSG" And Loc("ACTION") = 0 Then
'txtMain.SelText = Data & vbCrLf
Call UserSpoke
Exit Sub
End If
If Data Like ":*!*@* WHISPER *:*" And S1 = "WHISPER" Then
Call UserWhisper
Exit Sub
End If
If S1 = "001" Then
'MyName = Mid(Data, Loc("001 ") + 4, Loc(" :") - 21)
MYname = S2
mYname2 = Replace(MYname, ">", "Guest_")
ListView1.ListItems.Add , MYname, MYname, "blank", "blank"
WS.Senddata "JOIN %#" & Text5.Text & vbCrLf
'das = True
Exit Sub
End If
If Data Like ":*!*@*" And S1 = "MODE" And S3 = "+q" Then Call MadeOwner
If Data Like ":*!*@*" And S1 = "MODE" And S3 = "+o" Then Call MadeHost
If Data Like ":*!*@*" And S1 = "MODE" And S3 = "-q" Then Call PartOwner
If Data Like ":*!*@*" And S1 = "MODE" And S3 = "-o" Then Call PartHost
If Data Like "PING :*" Then WS.Senddata "PONG bla" & vbCrLf
End Sub
' this has only one winsocket on it . but I want to try to get this connected with an msn chat client . its been done once .. but here is the catch with out the msnchatx.ocx running neither has to be with the regular chat control .. feel free to get a hold me for more details of coding ..