Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Const USERNAME_ME_BRACKETS = &H3299CC
- Public Const USERNAME_ME_USERNAME = &HFFFF
- Public Const USERNAME_TEXT = &HFFFFFF
- Public Const USERNAME_EMOTE = &HFFE600
- Public Const USERNAME_WHISPER_TO_AND_FROM = &HAA5303
- Public Const VNET_SERVER_ERROR = &HCC1100
- Public Const VNET_SERVER_INFO = &H3299CC
- Public Const VNET_SERVER_ACCOUNT = &H5DFC0A
- Public Const VNET_USERNAME = &HCDBE70
- Public Const VNET_CLIENT = &HA3A3A3
- Public Const VNET_TEXT = &H66CCCC
- Public Const VNET_INFO = &HAC92B
- Public arrEvents() As Variant
- Public Sub setArray()
- arrEvents = Array("%1username%/1 %2(message)%/2 %3has joined VectorNet.%/3", _
- "%1username%/1 %2(message)%/2 %3has left VectorNet.%/3", _
- "%1<username>%/1 %2message%/2", _
- "%1<%/1%2username%/2 %1message>%/1", _
- "%1message%/1", _
- "%1username%/1 %2[pingms]%/2 %3has joined the channel.%/3", _
- "%1username%/1 %2[pingms]%/2 %3has left the channel.%/3", _
- " %1<To %/1%2username%/2%1>%/1 %2message%/2", _
- " %1<From %/1%2username%/2%1>%/1 %2message%/2", _
- "%1<%/1%2username%/2%1>%/1 %3message%/3")
- End Sub
- Public Sub buildHTMLBody()
- Dim htmlFile As String, fsoHTMLLog
- htmlFile = App.Path & "\logs\" & Year(Date) & "-" & Month(Date) & "-" & Day(Date) & ".html"
- If Not fso.FileExists(htmlFile) Then
- fso.CreateTextFile htmlFile
- Set fsoHTMLLog = fso.GetFile(htmlFile).OpenAsTextStream(2)
- With fsoHTMLLog
- .writeline " <body bgcolor=""black""><font face=""Tahoma"" color=""white""><h3><center>VectorNet logs dated " & Date & " for the username " & Config.username & ".</center></h3>"
- End With
- fsoHTMLLog.Close
- End If
- End Sub
- Public Sub handleHTMLEvent(ByVal arrIndex As Integer, ByVal username As String, ByVal message As String, ParamArray saColors() As Variant)
- On Error Resume Next
- Dim htmlFile As String, htmlLine As String, fsoHTMLLog As Object
- Dim timeString As String
- timeString = "<font color=""#F0FFF0"">[" & Time() & "] </font>"
- htmlFile = App.Path & "\logs\" & Format(Date, "yyyy-mm-dd") & ".html"
- htmlLine = arrEvents(arrIndex)
- For i = 0 To UBound(saColors)
- htmlLine = Replace(htmlLine, "%" & i + 1, "<font color=""#" & Hex(saColors(i)) & """>")
- htmlLine = Replace(htmlLine, "%/" & i + 1, "</font>")
- Next i
- If arrIndex = 5 Or arrIndex = 6 Then
- htmlLine = Replace(htmlLine, "ping", User(findUserIndex(username)).ping)
- End If
- htmlLine = Replace(htmlLine, "username", username)
- htmlLine = Replace(htmlLine, "message", message)
- htmlLine = htmlLine & "<br />"
- If Not fso.FileExists(htmlFile) Then
- fso.CreateTextFile htmlFile
- End If
- Set fsoHTMLLog = fso.GetFile(htmlFile).OpenAsTextStream(8)
- fsoHTMLLog.writeline timeString & htmlLine
- fsoHTMLLog.Close
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement