Attribute VB_Name = "Declarations" Public Const Port = 6667 Public Const CRLF = vbCrLf Public Const Aray = 200 Public Server As String Public Connect_Now As Boolean Public Connected As Boolean Public Innitiated As Boolean Public Listen As Boolean Type TwoStrings First As String Second As String End Type Type TwoIntegers First As Integer Second As Integer End Type Public Sub Pause() Dim Start As Long Start = Timer Do: Loop Until Timer - Start > 1 End Sub 'Private Sub ds1_DataArrival(ByVal bytesTotal As Long) 'Interface.Status "Hear data" ' ' 'Dim aparser As New parser ' ' Dim inData As String ' Dim sline As String ' Dim msg As String ' Dim msg2 As String ' Dim PingReq As String ' Dim CurrentTime As String ' Dim errorCode As String ' to store the error code if any -simon ' Dim X ' ' ' Get the incoming data into a string ' ds1.GetData inData, vbString ' ' 'Debug.Print inData ' ' Add any unprocessed text on first ' inData = OldText & inData ' ' ' Some IRC servers are only using a Cairrage ' ' Return, or a LineFeed, instead of both, so ' ' we need to be prepared for that ' X = 0 ' ' cut down on those IF statements - simon ' If Right$(inData, 2) = vbCrLf Or Right$(inData, 1) = Chr$(10) Or Right$(inData, 1) = Chr$(13) Then ' X = 1 ' End If ' ' If X = 1 Then ' OldText = "" ' its a full send, process ' Else ' OldText = inData ' Exit Sub ' incomplete send ' save and exit ' End If ' 'again: ' sline = ParseMSG(inData, sline).Second ' get next msg fragment ' inData = ParseMSG(inData, sline).First '' update the msg record ' 'AddText sline ' ' If Left$(sline, 6) = "PING :" Then ' we need to pong to stay alive ' ConvertOnot = False ' plen = Len(sline) ' getnum$ = Right$(sline, plen - 6) 'lets get the ping number ' SendData "PONG " & getnum$ & Server ' GoTo again ' get next msg ' ' ElseIf Left$(sline, 5) = "ERROR" Then ' some error ' ConvertOnot = False ' ' End If ' ' If Left$(sline, Len(Nickname) + 1) = ":" & Nickname Then ' ConvertOnot = False ' ' a command for the client only ' sline = Mid$(sline, InStr(sline, " ") + 1) ' Select Case Left$(sline, InStr(sline, " ") - 1) ' Case "MODE" ' ' End Select ' End If ' If this_command(sline, "PRIVMSG") Then ' ConvertOnot = Ture ' 'Debug.Print sline ' 'someone /msged us ' msg = Mid$(sline, InStr(sline, " ") + 9) ' Dim tempNick, tempmsg As String ' tempmsg = Mid$(msg, InStr(msg, ":") + 1) ' tempNick = LCase$(Left$(msg, InStr(msg, " ") - 1)) ' If Trim(tempmsg) = "VERSION" Then ' private msg ' tempNick = (Left$(sline, InStr(sline, "!") - 1)) 'get the person who did the request ' tempNick = Right$(tempNick, Len(tempNick) - 1) ' ConvertOnot = False ' ' add so its: --nick-- msg here ' ' 'lets tell this guys what we are using ' ' hey but we need to put the version in a varibale (laterz) ' SendData "NOTICE " + tempNick + " :VERSION kotariIRC BetA 8,1(http://members.xoom.com/kotari/)" ' ElseIf Left$(Trim(tempmsg), 5) = "PING" Then ' 'ping reply to user ' tempNick = (Left$(sline, InStr(sline, "!") - 1)) 'get the person who did the request ' tempNick = Right$(tempNick, Len(tempNick) - 1) ' PingReq = Mid$(sline, InStr(sline, "") - 1) ' 'lets reply to ping ' SendData "NOTICE " + tempNick + " " + PingReq ' ElseIf Trim(tempmsg) = "FINGER" Then ' ' finger reply ' tempNick = (Left$(sline, InStr(sline, "!") - 1)) 'get the person who did the request ' tempNick = Right$(tempNick, Len(tempNick) - 1) ' CurrentTime = Now ' SendData "NOTICE " + tempNick + " :" + "FINGER kotariIRC_User@" + userid + "" ' ElseIf Trim(tempmsg) = "TIME" Then ' ' timer reply ' tempNick = (Left$(sline, InStr(sline, "!") - 1)) 'get the person who did the request ' tempNick = Right$(tempNick, Len(tempNick) - 1) ' CurrentTime = Now ' SendData "NOTICE " + tempNick + " :" + "TIME " + CurrentTime + "" ' ElseIf tempNick = LCase$(Nickname) Then ' ConvertOnot = False ' ' End If ' End If ' 'we get the error code in advance ' 'so that repetiveness is minimised ' 'and it looks nicer :) - simon ' errorCode = Mid$(sline, InStr(1, sline, " ") + 1, 3) ' Select Case CMode ' ' ' Case 0 ' not in channel ' If errorCode = "001" Then ' Server = Mid$(sline, 2, InStr(sline, " ") - 2) ' 'making this an ElseIf cuts decision time by half - simon ' ElseIf errorCode = "433" Then ' ConvertOnot = False ' ' FileConnect.Caption = "&Connect" ' ConvertOnot = False ' ' ds1.Close: Exit Sub ' End If ' If Left$(sline, Len(Server) + 1) = ":" & Server Then ' ' its a server msg, add the important part ' sline = Mid$(sline, InStr(2, sline, ":") + 1) ' ConvertOnot = False ' ' End If ' If Left$(sline, 13) = "NOTICE AUTH :" Then ' ConvertOnot = False ' sline = Mid$(sline, InStr(2, sline, ":") + 1) ' ' End If ' Case 1 ' joining channel ' If Left$(sline, Len(Server) + 1) = ":" & Server Then ' msg = Mid$(sline, InStr(sline, " ") + 1) ' Select Case CInt(Left$(msg, InStr(msg, " ") - 1)) ' Case Err.RPL_TOPIC ' Topic ' channels(getChanIndex(channel)).Caption = channel & " " & Mid$(msg, InStr(msg, ":") + 1) ' Case Err.RPL_NAMREPLY ' Name list ' msg = Mid$(msg, InStr(msg, ":") + 1) ' 'here we get the ppl in the channel ' ' channels(getChanIndex(channel)).CreateNickList (msg) 'lets do the list baby! = simon ' Case Err.RPL_ENDOFNAMES ' End of Name List ' CMode = 2 ' change mode to joined channel ' End Select ' Else ' ' someone joined the channel, us! ' ' there is a something missing we need to update the user list dho? ' ' but i'll fix it ' If Left$(sline, InStr(sline, " ") - 1) = "JOIN" Then ' ConvertOnot = False ' ' End If ' End If ' Case 2 ' in a channel ' Debug.Print ">>>" & sline ' aparser.parse (sline) ' If aparser.msgType = "PRIVMSG" Then ' msg = Mid$(sline, InStr(sline, " ") + 9) ' messages msg, sline ' ' Else ' ' command not yet supported, just display it ' channels(getChanIndex(channel)).AddText sline ' End If ' End Select ' GoTo again 'Exit Sub 'End Sub