diff --git a/.BNRBot.rbuistate b/.BNRBot.rbuistate index 8f95c0f..d3bdd16 100644 Binary files a/.BNRBot.rbuistate and b/.BNRBot.rbuistate differ diff --git a/Modules/Globals.rbbas b/Modules/Globals.rbbas index 820751d..0cfbcb5 100644 --- a/Modules/Globals.rbbas +++ b/Modules/Globals.rbbas @@ -1859,6 +1859,34 @@ Protected Module Globals End Function #tag EndMethod + #tag Method, Flags = &h1 + Protected Function MessageBlacklistMatch(Pattern As String) As Boolean + + Dim regex As New RegEx() + Dim match As RegExMatch + Dim i As Integer = UBound(Settings.PrefMessageBlacklist) + While i >= 0 + Select Case Settings.PrefMessageBlacklist(i).Left + Case 0 // Exact + If Settings.PrefMessageBlacklist(i).Right = Pattern Then Return True + Case 1 // Regex + Try + regex.SearchPattern = Settings.PrefMessageBlacklist(i).Right + match = regex.Search(Pattern) + If match <> Nil Then Return True + Catch err As RegExException + Continue // Regex problem, skip this pattern + End Try + Case Else // Unknown + End Select + i = i - 1 + Wend + + Return False // No Match + + End Function + #tag EndMethod + #tag Method, Flags = &h0 Function NeedsCDKey(Product As UInt32) As Boolean diff --git a/Modules/Packets.rbbas b/Modules/Packets.rbbas index 096ac71..64c4f64 100644 --- a/Modules/Packets.rbbas +++ b/Modules/Packets.rbbas @@ -1247,7 +1247,7 @@ Protected Module Packets // If bTmp = True then they are talking at most 0.4 seconds after entering. If dTmp <> Nil Then - If Sock.Config.SpamPrevention = True And Text = dTmp.Value("LastMessage") Then bTmp = True + If bTmp = False And Sock.Config.SpamPrevention = True And Text = dTmp.Value("LastMessage") Then bTmp = True dTmp.Value("LastMessageTime") = Microseconds() dTmp.Value("LastMessageType") = EventID dTmp.Value("LastMessage") = Text @@ -1255,6 +1255,10 @@ Protected Module Packets // If bTmp = True now then they may also be repeating their message. + If bTmp = False And Globals.MessageBlacklistMatch(Text) = True Then bTmp = True + + // If bTmp = True now then the message may even also be on the blacklist + If BitAnd(Flags, &H20) <= 0 And bTmp = False Then If BitAnd(Flags, &H09) > 0 Then colorA = Colors.Teal @@ -1378,7 +1382,7 @@ Protected Module Packets // If bTmp = True then they are talking at most 0.4 seconds after entering. If dTmp <> Nil Then - If Sock.Config.SpamPrevention = True And Text = dTmp.Value("LastMessage") Then bTmp = True + If bTmp = False And Sock.Config.SpamPrevention = True And Text = dTmp.Value("LastMessage") Then bTmp = True dTmp.Value("LastMessageTime") = Microseconds() dTmp.Value("LastMessageType") = EventID dTmp.Value("LastMessage") = Text @@ -1386,6 +1390,10 @@ Protected Module Packets // If bTmp = True now then they may also be repeating their message. + If bTmp = False And Globals.MessageBlacklistMatch(Text) = True Then bTmp = True + + // If bTmp = True now then the message may even also be on the blacklist + If BitAnd(Flags, &H20) <= 0 And bTmp = False Then If BitAnd(Flags, &H09) > 0 Then colorA = Colors.Teal diff --git a/Modules/Settings.rbbas b/Modules/Settings.rbbas index 46eb992..df63fec 100644 --- a/Modules/Settings.rbbas +++ b/Modules/Settings.rbbas @@ -277,6 +277,7 @@ Protected Module Settings Dim Options As UInt32 Dim Configs() As Configuration Dim PingRanges() As PingRange + Dim MessageBlacklist() As Pair // Second, retrieve the version of the file and then try to parse the file: Dim Version As Byte = Buffer.ReadBYTE() @@ -304,6 +305,9 @@ Protected Module Settings PingRanges(UBound(PingRanges)).HighestPing = Buffer.ReadDWORD() Wend + ReDim MessageBlacklist(-1) // Clear out any previous data (Fail safe check) + // Version 0 doesn't have a blacklist + Case Settings.SectionConfiguration Configs.Append(New Configuration()) Configs(UBound(Configs)).Name = Buffer.ReadCString() @@ -348,6 +352,78 @@ Protected Module Settings End Select + Wend + Case 1 + While Buffer.EOF() = False + + Section = Buffer.ReadDWORD() + Select Case Section + Case Settings.SectionGlobal + Options = Buffer.ReadBYTE() + Settings.PrefCheckForUpdates = (BitAnd(Options, &H01) > 0) + Settings.PrefMinimizeToTray = (BitAnd(Options, &H02) > 0) + Settings.PrefPingRangesFlushRight = (BitAnd(Options, &H04) > 0) + + // Ping Ranges + ReDim PingRanges(-1) // Clear out any previous data (Fail safe check) + Options = Buffer.ReadWORD() // Options is reused as a variable... + While UBound(PingRanges) + 1 < Options + PingRanges.Append(New PingRange()) + PingRanges(UBound(PingRanges)).BarCount = Buffer.ReadDWORD() + PingRanges(UBound(PingRanges)).BarColor = Buffer.ReadDWORD() + PingRanges(UBound(PingRanges)).LowestPing = Buffer.ReadDWORD() + PingRanges(UBound(PingRanges)).HighestPing = Buffer.ReadDWORD() + Wend + + // Message Blacklist + ReDim MessageBlacklist(-1) // Clear out any previous data (Fail safe check) + Options = Buffer.ReadWORD() // Options is reused as a variable... + While UBound(MessageBlacklist) + 1 < Options + MessageBlacklist.Append(New Pair(Buffer.ReadBYTE(), Buffer.ReadCString())) + Wend + + Case Settings.SectionConfiguration + Configs.Append(New Configuration()) + Configs(UBound(Configs)).Name = Buffer.ReadCString() + Configs(UBound(Configs)).Username = Buffer.ReadCString() + Configs(UBound(Configs)).Password = Buffer.ReadCString() + Configs(UBound(Configs)).BNETHost = Buffer.ReadCString() + Configs(UBound(Configs)).BNLSHost = Buffer.ReadCString() + Configs(UBound(Configs)).Product = Buffer.ReadDWORD() + Configs(UBound(Configs)).VersionByte = Buffer.ReadDWORD() + Configs(UBound(Configs)).CDKey = Buffer.ReadCString() + Configs(UBound(Configs)).CDKeyExpansion = Buffer.ReadCString() + Configs(UBound(Configs)).CDKeyOwner = Buffer.ReadCString() + Configs(UBound(Configs)).EmailAddress = Buffer.ReadCString() + Configs(UBound(Configs)).HomeChannel = Buffer.ReadCString() + Configs(UBound(Configs)).Timestamp = Buffer.ReadBYTE() + Configs(UBound(Configs)).PingSpoof = Buffer.ReadDWORD() + + Options = Buffer.ReadDWORD() + Configs(UBound(Configs)).BNLSEnabled = (BitAnd(Options, &H01) > 0) + Configs(UBound(Configs)).CDKeySpawn = (BitAnd(Options, &H02) > 0) + Configs(UBound(Configs)).AutoRejoinWhenKicked = (BitAnd(Options, &H04) > 0) + Configs(UBound(Configs)).VerbosePackets = (BitAnd(Options, &H08) > 0) + Configs(UBound(Configs)).EnableUDP = (BitAnd(Options, &H10) > 0) + Configs(UBound(Configs)).BNLSVersionCheck = (BitAnd(Options, &H20) > 0) + Configs(UBound(Configs)).ShowJoinLeaveMessages = (BitAnd(Options, &H40) > 0) + Configs(UBound(Configs)).EnableUTF8 = (BitAnd(Options, &H80) > 0) + Configs(UBound(Configs)).SpamPrevention = (BitAnd(Options, &H100) > 0) + Configs(UBound(Configs)).IgnoreBanKickUnban = (BitAnd(Options, &H200) > 0) + Configs(UBound(Configs)).ConfirmRemovingClanMembers = (BitAnd(Options, &H400) > 0) + Configs(UBound(Configs)).CreateAccountsFirst = (BitAnd(Options, &H800) > 0) + Configs(UBound(Configs)).ShowUserUpdateMessages = (BitAnd(Options, &H1000) > 0) + + Configs(UBound(Configs)).ProxyType = Buffer.ReadBYTE() + Configs(UBound(Configs)).ProxyHost = Buffer.ReadCString() + + Case Else + // The section is unrecognized to us. + Settings.AppendLoadError("Could not parse the settings file because it contains at least one (1) bad section.") + Exit While + + End Select + Wend Case Else // The file version is unrecognized to us. @@ -357,6 +433,7 @@ Protected Module Settings If UBound(Configs) >= 0 Then Settings.Configurations = Configs If UBound(PingRanges) >= 0 Then Settings.PrefPingRanges = PingRanges + If UBound(MessageBlacklist) >= 0 Then Settings.PrefMessageBlacklist = MessageBlacklist End Sub #tag EndMethod @@ -412,7 +489,7 @@ Protected Module Settings Buffer.WriteCString("EDIT THIS FILE WITH BNRBOT, DO NOT MODIFY THIS FILE YOURSELF.") // File version - Buffer.WriteBYTE(&H00) + Buffer.WriteBYTE(&H01) // Section Global: Buffer.WriteDWORD(Settings.SectionGlobal) @@ -436,6 +513,17 @@ Protected Module Settings Wend End If + // Message Blacklist + Buffer.WriteWORD(UBound(Settings.PrefMessageBlacklist) + 1) + If UBound(Settings.PrefMessageBlacklist) >= 0 Then + Options = &H0000 // Reuse Options as our loop variable. + While Options <= UBound(Settings.PrefMessageBlacklist) And Options < &HFFFF + Buffer.WriteBYTE(Settings.PrefMessageBlacklist(Options).Left) + Buffer.WriteCString(Settings.PrefMessageBlacklist(Options).Right) + Options = Options + 1 + Wend + End If + // Section Profile(s): For Each Config As Configuration In Settings.Configurations Buffer.WriteDWORD(Settings.SectionConfiguration) @@ -462,17 +550,15 @@ Protected Module Settings If Config.VerbosePackets = True Then Options = BitOr(Options, &H08) If Config.EnableUDP = True Then Options = BitOr(Options, &H10) If Config.BNLSVersionCheck = True Then Options = BitOr(Options, &H20) - // Unused Bit 0x40, used to be CBNET - If Config.ShowJoinLeaveMessages = True Then Options = BitOr(Options, &H80) - If Config.EnableUTF8 = True Then Options = BitOr(Options, &H100) - If Config.SpamPrevention = True Then Options = BitOr(Options, &H200) - If Config.IgnoreBanKickUnban = True Then Options = BitOr(Options, &H400) - If Config.ConfirmRemovingClanMembers = True Then Options = BitOr(Options, &H800) - If Config.CreateAccountsFirst = True Then Options = BitOr(Options, &H1000) - If Config.ShowUserUpdateMessages = True Then Options = BitOr(Options, &H2000) + If Config.ShowJoinLeaveMessages = True Then Options = BitOr(Options, &H40) + If Config.EnableUTF8 = True Then Options = BitOr(Options, &H80) + If Config.SpamPrevention = True Then Options = BitOr(Options, &H100) + If Config.IgnoreBanKickUnban = True Then Options = BitOr(Options, &H200) + If Config.ConfirmRemovingClanMembers = True Then Options = BitOr(Options, &H400) + If Config.CreateAccountsFirst = True Then Options = BitOr(Options, &H800) + If Config.ShowUserUpdateMessages = True Then Options = BitOr(Options, &H1000) Buffer.WriteDWORD(Options) - Buffer.WriteCString("") // Unused String, used to be CBNET Buffer.WriteBYTE(Config.ProxyType) Buffer.WriteCString(Config.ProxyHost) @@ -536,6 +622,10 @@ Protected Module Settings Protected PrefCheckForUpdates As Boolean #tag EndProperty + #tag Property, Flags = &h1 + Protected PrefMessageBlacklist() As Pair + #tag EndProperty + #tag Property, Flags = &h1 Protected PrefMinimizeToTray As Boolean #tag EndProperty diff --git a/Windows/wClanConfirmation.rbfrm b/Windows/wClanConfirmation.rbfrm index 0d34862..0e2b7e7 100644 --- a/Windows/wClanConfirmation.rbfrm +++ b/Windows/wClanConfirmation.rbfrm @@ -46,6 +46,7 @@ Begin Window wClanConfirmation Selectable = False TabIndex = 0 TabPanelIndex = 0 + TabStop = True Text = "You requested to %ACTION% Clan %TAG%!" TextAlign = 0 TextColor = "#Colors.White" @@ -142,6 +143,7 @@ Begin Window wClanConfirmation Selectable = False TabIndex = 9 TabPanelIndex = 0 + TabStop = True Text = "If you really want to do this, hit OK below.\r\n\r\nOtherwise, hit Cancel to not take any action." TextAlign = 0 TextColor = "#Colors.White" diff --git a/Windows/wClanCreationInvitation.rbfrm b/Windows/wClanCreationInvitation.rbfrm index 78a6762..da336fb 100644 --- a/Windows/wClanCreationInvitation.rbfrm +++ b/Windows/wClanCreationInvitation.rbfrm @@ -46,6 +46,7 @@ Begin Window wClanCreationInvitation Selectable = False TabIndex = 0 TabPanelIndex = 0 + TabStop = True Text = "You have been invited to create a clan!" TextAlign = 0 TextColor = "#Colors.White" @@ -80,6 +81,7 @@ Begin Window wClanCreationInvitation Selectable = False TabIndex = 1 TabPanelIndex = 0 + TabStop = True Text = "Clan Name: " TextAlign = 0 TextColor = "#Colors.White" @@ -208,6 +210,7 @@ Begin Window wClanCreationInvitation Selectable = False TabIndex = 3 TabPanelIndex = 0 + TabStop = True Text = "Clan Tag:" TextAlign = 0 TextColor = "#Colors.White" @@ -289,6 +292,7 @@ Begin Window wClanCreationInvitation Selectable = False TabIndex = 5 TabPanelIndex = 0 + TabStop = True Text = "Invited By:" TextAlign = 0 TextColor = "#Colors.White" @@ -465,6 +469,7 @@ Begin Window wClanCreationInvitation Selectable = False TabIndex = 7 TabPanelIndex = 0 + TabStop = True Text = "Members:" TextAlign = 0 TextColor = "#Colors.White" diff --git a/Windows/wClanInvitation.rbfrm b/Windows/wClanInvitation.rbfrm index d13dfbe..b90622b 100644 --- a/Windows/wClanInvitation.rbfrm +++ b/Windows/wClanInvitation.rbfrm @@ -46,6 +46,7 @@ Begin Window wClanInvitation Selectable = False TabIndex = 0 TabPanelIndex = 0 + TabStop = True Text = "You have been invited to a clan!" TextAlign = 0 TextColor = "#Colors.White" @@ -80,6 +81,7 @@ Begin Window wClanInvitation Selectable = False TabIndex = 1 TabPanelIndex = 0 + TabStop = True Text = "Clan Name: " TextAlign = 0 TextColor = "#Colors.White" @@ -208,6 +210,7 @@ Begin Window wClanInvitation Selectable = False TabIndex = 3 TabPanelIndex = 0 + TabStop = True Text = "Clan Tag:" TextAlign = 0 TextColor = "#Colors.White" @@ -289,6 +292,7 @@ Begin Window wClanInvitation Selectable = False TabIndex = 5 TabPanelIndex = 0 + TabStop = True Text = "Invited By:" TextAlign = 0 TextColor = "#Colors.White" diff --git a/Windows/wClanRemoveMember.rbfrm b/Windows/wClanRemoveMember.rbfrm index 78b5393..722c921 100644 --- a/Windows/wClanRemoveMember.rbfrm +++ b/Windows/wClanRemoveMember.rbfrm @@ -46,6 +46,7 @@ Begin Window wClanRemoveMember Selectable = False TabIndex = 0 TabPanelIndex = 0 + TabStop = True Text = "Are you sure you wish to remove this member?" TextAlign = 0 TextColor = "#Colors.White" @@ -80,6 +81,7 @@ Begin Window wClanRemoveMember Selectable = False TabIndex = 1 TabPanelIndex = 0 + TabStop = True Text = "Username:" TextAlign = 0 TextColor = "#Colors.White" @@ -208,6 +210,7 @@ Begin Window wClanRemoveMember Selectable = False TabIndex = 3 TabPanelIndex = 0 + TabStop = True Text = "Clan Rank:" TextAlign = 0 TextColor = "#Colors.White" diff --git a/Windows/wConfig.rbfrm b/Windows/wConfig.rbfrm index 5ab6b43..8fb23a1 100644 --- a/Windows/wConfig.rbfrm +++ b/Windows/wConfig.rbfrm @@ -1815,7 +1815,7 @@ Begin Window wConfig Visible = True Width = 348 End - Begin Label txtPingRangesNote + Begin Label txtJunk AutoDeactivate = True Bold = "" DataField = "" @@ -1823,7 +1823,7 @@ Begin Window wConfig Enabled = True Height = 14 HelpTag = "" - Index = -2147483648 + Index = 2 InitialParent = "Pages" Italic = "" Left = 132 @@ -1835,7 +1835,7 @@ Begin Window wConfig Multiline = "" Scope = 0 Selectable = False - TabIndex = 9 + TabIndex = 11 TabPanelIndex = 2 Text = "* Right-click the list for options (such as adding and removing)." TextAlign = 0 @@ -1960,7 +1960,7 @@ Begin Window wConfig Width = 356 _ScrollWidth = -1 End - Begin Label txtMinimizeToTray1 + Begin Label txtJunk AutoDeactivate = True Bold = True DataField = "" @@ -1968,7 +1968,7 @@ Begin Window wConfig Enabled = True Height = 15 HelpTag = "" - Index = -2147483648 + Index = 1 InitialParent = "Pages" Italic = "" Left = 132 @@ -2014,7 +2014,7 @@ Begin Window wConfig LockTop = True Scope = 0 State = 0 - TabIndex = 10 + TabIndex = 9 TabPanelIndex = 2 TabStop = True TextFont = "Verdana" @@ -2046,7 +2046,7 @@ Begin Window wConfig Multiline = "" Scope = 0 Selectable = False - TabIndex = 11 + TabIndex = 10 TabPanelIndex = 2 Text = "Flush bars to the right" TextAlign = 0 @@ -2469,6 +2469,154 @@ Begin Window wConfig Top = 378 Width = 32 End + Begin Label txtJunk + AutoDeactivate = True + Bold = True + DataField = "" + DataSource = "" + Enabled = True + Height = 15 + HelpTag = "" + Index = 3 + InitialParent = "Pages" + Italic = "" + Left = 132 + LockBottom = "" + LockedInPosition= False + LockLeft = True + LockRight = True + LockTop = True + Multiline = "" + Scope = 0 + Selectable = False + TabIndex = 12 + TabPanelIndex = 2 + Text = "Message Blacklist:" + TextAlign = 0 + TextColor = "#Colors.UI.ControlTextColor" + TextFont = "Verdana" + TextSize = 11 + TextUnit = 0 + Top = 313 + Transparent = False + Underline = "" + Visible = True + Width = 348 + End + Begin Listbox lstMessageBlacklist + AutoDeactivate = True + AutoHideScrollbars= True + Bold = "" + Border = False + ColumnCount = 2 + ColumnsResizable= False + ColumnWidths = 60 + DataField = "" + DataSource = "" + DefaultRowHeight= 15 + Enabled = True + EnableDrag = True + EnableDragReorder= True + GridLinesHorizontal= 0 + GridLinesVertical= 0 + HasHeading = True + HeadingIndex = -1 + Height = 147 + HelpTag = "These messages will be globally blacklisted; they won't show up in\r\nchat anywhere." + Hierarchical = "" + Index = -2147483648 + InitialParent = "Pages" + InitialValue = "Type Pattern" + Italic = "" + Left = 136 + LockBottom = False + LockedInPosition= False + LockLeft = True + LockRight = True + LockTop = True + RequiresSelection= "" + Scope = 0 + ScrollbarHorizontal= "" + ScrollBarVertical= True + SelectionType = 0 + TabIndex = 13 + TabPanelIndex = 2 + TabStop = True + TextFont = "Verdana" + TextSize = 11 + TextUnit = 0 + Top = 330 + Underline = "" + UseFocusRing = True + Visible = True + Width = 356 + _ScrollWidth = -1 + End + Begin Label txtJunk + AutoDeactivate = True + Bold = "" + DataField = "" + DataSource = "" + Enabled = True + Height = 14 + HelpTag = "" + Index = 4 + InitialParent = "Pages" + Italic = "" + Left = 136 + LockBottom = False + LockedInPosition= False + LockLeft = True + LockRight = True + LockTop = True + Multiline = "" + Scope = 0 + Selectable = False + TabIndex = 15 + TabPanelIndex = 2 + Text = "* Right-click the list for options (such as adding and removing)." + TextAlign = 0 + TextColor = "#Colors.UI.ControlTextColor" + TextFont = "Verdana" + TextSize = 11 + TextUnit = 0 + Top = 508 + Transparent = False + Underline = "" + Visible = True + Width = 364 + End + Begin PushButton btnApplyMessageBlacklist + AutoDeactivate = True + Bold = "" + ButtonStyle = 0 + Cancel = "" + Caption = "Apply Now" + Default = "" + Enabled = True + Height = 22 + HelpTag = "Applies this message blacklist to memory. When the dialog closes,\r\nthey will be stored to disk." + Index = -2147483648 + InitialParent = "Pages" + Italic = "" + Left = 412 + LockBottom = False + LockedInPosition= False + LockLeft = "" + LockRight = True + LockTop = True + Scope = 0 + TabIndex = 14 + TabPanelIndex = 2 + TabStop = True + TextFont = "Verdana" + TextSize = 11 + TextUnit = 0 + Top = 482 + Underline = "" + Visible = True + Width = 80 + End End End #tag EndWindow @@ -2630,6 +2778,22 @@ End i = i + 1 Wend + i = 0 + While i <= UBound(Settings.PrefMessageBlacklist) + + Select Case Settings.PrefMessageBlacklist(i).Left + Case 0 + lstMessageBlacklist.AddRow("Exact") + Case 1 + lstMessageBlacklist.AddRow("Regex") + Case Else + lstMessageBlacklist.AddRow(Str(Settings.PrefMessageBlacklist(i).Left)) + End Select + lstMessageBlacklist.Cell(lstMessageBlacklist.LastIndex, 1) = Settings.PrefMessageBlacklist(i).Right + + i = i + 1 + Wend + i = 0 While i <= UBound(Settings.Configurations) @@ -3788,10 +3952,12 @@ End #tag EndEvent #tag Event Sub Open() + Me.ColumnType(0) = Me.TypeEditable Me.ColumnType(1) = Me.TypeDefault Me.ColumnType(2) = Me.TypeEditable Me.ColumnType(3) = Me.TypeEditable + End Sub #tag EndEvent #tag Event @@ -4235,3 +4401,138 @@ End End Sub #tag EndEvent #tag EndEvents +#tag Events lstMessageBlacklist + #tag Event + Sub Open() + + Me.ColumnType(0) = Me.TypeDefault + Me.ColumnType(1) = Me.TypeEditableTextField + + End Sub + #tag EndEvent + #tag Event + Function CellTextPaint(g As Graphics, row As Integer, column As Integer, x as Integer, y as Integer) As Boolean + + If row = Me.ListIndex Then + g.ForeColor = Colors.UI.ControlBackColor + Else + g.ForeColor = Colors.UI.ListSelectionColor + End If + + If row >= 0 And row < Me.ListCount Then _ + g.DrawString(Me.Cell(row, column), x, y, g.Width - x * 2, True) + + Return True + + End Function + #tag EndEvent + #tag Event + Function CellBackgroundPaint(g As Graphics, row As Integer, column As Integer) As Boolean + + #pragma Unused column + + If row = Me.ListIndex Then + g.ForeColor = Colors.UI.ListSelectionColor + Else + g.ForeColor = Colors.UI.ControlBackColor + End If + + g.FillRect(0, 0, g.Width, g.Height) + Return True + + End Function + #tag EndEvent + #tag Event + Function ConstructContextualMenu(base as MenuItem, x as Integer, y as Integer) As Boolean + + #pragma Unused x + #pragma Unused y + + If base = Nil Then Return False + + base.Insert(0, New MenuItem("Add New Pattern")) + + If Me.ListIndex > -1 Then + base.Insert(1, New MenuItem("Insert New Pattern")) + base.Insert(2, New MenuItem(base.TextSeparator)) + base.Insert(3, New MenuItem("Remove Selected Pattern")) + base.Insert(4, New MenuItem(base.TextSeparator)) + base.Insert(5, New MenuItem("Type")) + + base.Item(5).Insert(0, New MenuItem("Exact Match")) + base.Item(5).Item(0).Checked = (Me.Cell(Me.ListIndex, 0) = "Exact") + + base.Item(5).Insert(1, New MenuItem("Regex Pattern")) + base.Item(5).Item(1).Checked = (Me.Cell(Me.ListIndex, 0) = "Regex") + End If + + Return (base.Count > 0) + + End Function + #tag EndEvent + #tag Event + Function ContextualMenuAction(hitItem as MenuItem) As Boolean + + If hitItem = Nil Then Return False + + Select Case hitItem.Text + Case "Add New Pattern" + + Me.AddRow("Regex") + Me.Cell(Me.LastIndex, 1) = "^ignore this$" + Me.EditCell(Me.LastIndex, 1) + + Case "Insert New Pattern" + + If Me.ListIndex > -1 Then + Me.InsertRow(Me.ListIndex, "Regex") + Me.Cell(Me.LastIndex, 1) = "^ignore this$" + Me.EditCell(Me.LastIndex, 1) + End If + + Case "Remove Selected Pattern" + + If Me.ListIndex > -1 Then Me.RemoveRow(Me.ListIndex) + + Case "Exact Match" + + If Me.ListIndex > -1 Then Me.Cell(Me.ListIndex, 0) = "Exact" + + Case "Regex Pattern" + + If Me.ListIndex > -1 Then Me.Cell(Me.ListIndex, 0) = "Regex" + + Else + #If TargetWin32 = False Then Beep() + MsgBox("Error: Cannot identify the action you wished to take.") + Return False + + End Select + + Return True + + End Function + #tag EndEvent +#tag EndEvents +#tag Events btnApplyMessageBlacklist + #tag Event + Sub Action() + + Dim i As Integer = 0, MessageBlacklist() As Pair + While i < lstMessageBlacklist.ListCount + Select Case lstMessageBlacklist.Cell(i, 0) + Case "Exact" + MessageBlacklist.Append(New Pair(0, lstMessageBlacklist.Cell(i, 1))) + Case "Regex" + MessageBlacklist.Append(New Pair(1, lstMessageBlacklist.Cell(i, 1))) + Case Else + MessageBlacklist.Append(New Pair(lstMessageBlacklist.Cell(i, 0), lstMessageBlacklist.Cell(i, 1))) + End Select + i = i + 1 + Wend + + Settings.PrefMessageBlacklist = MessageBlacklist + + End Sub + #tag EndEvent +#tag EndEvents diff --git a/Windows/wMain.rbfrm b/Windows/wMain.rbfrm index 721a733..6e62600 100644 --- a/Windows/wMain.rbfrm +++ b/Windows/wMain.rbfrm @@ -2191,16 +2191,19 @@ End If Config.EnableUTF8 = False Then s = Line Else s = ConvertEncoding(Line, Encodings.UTF8) If dTmp <> Nil Then - If Left(s, 3) = "/me" Or Left(s, 6) = "/emote" Then - dTmp.Value("LastMessageType") = &H17 - dTmp.Value("LastMessage") = Mid(s, Len(NthField(s, " ", 1) + " ") + 1) - ElseIf Left(s, 2) = "/w" Or Left(s, 4) = "/msg" Or Left(s, 8) = "/whisper" Then - dTmp.Value("LastMessageType") = &H0A - dTmp.Value("LastMessage") = Mid(s, Len(NthField(s, " ", 1) + " " + NthField(s, " ", 2) + " ") + 1) - Else + // Emotes and Whispers will be covered when they are sent back to us by Battle.net. + //If Left(s, 3) = "/me" Or Left(s, 6) = "/emote" Then + //dTmp.Value("LastMessageType") = &H17 + //dTmp.Value("LastMessage") = Mid(s, Len(NthField(s, " ", 1) + " ") + 1) + //ElseIf Left(s, 2) = "/w" Or Left(s, 4) = "/msg" Or Left(s, 8) = "/whisper" Then + //dTmp.Value("LastMessageType") = &H0A + //dTmp.Value("LastMessage") = Mid(s, Len(NthField(s, " ", 1) + " " + NthField(s, " ", 2) + " ") + 1) + //Else + If Left(s, 1) <> "/" Then dTmp.Value("LastMessageType") = &H05 dTmp.Value("LastMessage") = s End If + //End If End If Config.BNET.Send(Packets.CreateSID_CHATCOMMAND(s)) diff --git a/Windows/wProfile.rbfrm b/Windows/wProfile.rbfrm index b2fa8ec..960faff 100644 --- a/Windows/wProfile.rbfrm +++ b/Windows/wProfile.rbfrm @@ -142,6 +142,7 @@ Begin Window wProfile Selectable = False TabIndex = 0 TabPanelIndex = 0 + TabStop = True Text = "Username:" TextAlign = 0 TextColor = "#Colors.White" @@ -176,6 +177,7 @@ Begin Window wProfile Selectable = False TabIndex = 2 TabPanelIndex = 0 + TabStop = True Text = "Age:" TextAlign = 0 TextColor = "#Colors.White" @@ -210,6 +212,7 @@ Begin Window wProfile Selectable = False TabIndex = 4 TabPanelIndex = 0 + TabStop = True Text = "Sex:" TextAlign = 0 TextColor = "#Colors.White" @@ -340,6 +343,7 @@ Begin Window wProfile Selectable = False TabIndex = 8 TabPanelIndex = 0 + TabStop = True Text = "Description:" TextAlign = 0 TextColor = "#Colors.White" @@ -374,6 +378,7 @@ Begin Window wProfile Selectable = False TabIndex = 6 TabPanelIndex = 0 + TabStop = True Text = "Location:" TextAlign = 0 TextColor = "#Colors.White" @@ -514,6 +519,7 @@ Begin Window wProfile Scope = 0 TabIndex = 10 TabPanelIndex = 0 + TabStop = True Top = 33 Value = 1 Visible = True @@ -540,6 +546,7 @@ Begin Window wProfile Selectable = False TabIndex = 9 TabPanelIndex = 1 + TabStop = True Text = "Play Time:" TextAlign = 0 TextColor = "#Colors.White" @@ -814,6 +821,7 @@ Begin Window wProfile Selectable = False TabIndex = 7 TabPanelIndex = 1 + TabStop = True Text = "Last Game:" TextAlign = 0 TextColor = "#Colors.White" @@ -848,6 +856,7 @@ Begin Window wProfile Selectable = False TabIndex = 5 TabPanelIndex = 1 + TabStop = True Text = "Disconnects:" TextAlign = 0 TextColor = "#Colors.White" @@ -882,6 +891,7 @@ Begin Window wProfile Selectable = False TabIndex = 3 TabPanelIndex = 1 + TabStop = True Text = "Losses:" TextAlign = 0 TextColor = "#Colors.White" @@ -916,6 +926,7 @@ Begin Window wProfile Selectable = False TabIndex = 1 TabPanelIndex = 1 + TabStop = True Text = "Wins:" TextAlign = 0 TextColor = "#Colors.White" @@ -950,6 +961,7 @@ Begin Window wProfile Selectable = False TabIndex = 0 TabPanelIndex = 1 + TabStop = True Text = "Normal Games:" TextAlign = 0 TextColor = "#Colors.White" @@ -984,6 +996,7 @@ Begin Window wProfile Selectable = False TabIndex = 9 TabPanelIndex = 2 + TabStop = True Text = "Play Time:" TextAlign = 0 TextColor = "#Colors.White" @@ -1018,6 +1031,7 @@ Begin Window wProfile Selectable = False TabIndex = 7 TabPanelIndex = 2 + TabStop = True Text = "Last Game:" TextAlign = 0 TextColor = "#Colors.White" @@ -1052,6 +1066,7 @@ Begin Window wProfile Selectable = False TabIndex = 5 TabPanelIndex = 2 + TabStop = True Text = "Disconnects:" TextAlign = 0 TextColor = "#Colors.White" @@ -1086,6 +1101,7 @@ Begin Window wProfile Selectable = False TabIndex = 3 TabPanelIndex = 2 + TabStop = True Text = "Losses:" TextAlign = 0 TextColor = "#Colors.White" @@ -1120,6 +1136,7 @@ Begin Window wProfile Selectable = False TabIndex = 1 TabPanelIndex = 2 + TabStop = True Text = "Wins:" TextAlign = 0 TextColor = "#Colors.White" @@ -1154,6 +1171,7 @@ Begin Window wProfile Selectable = False TabIndex = 0 TabPanelIndex = 2 + TabStop = True Text = "Ladder Games:" TextAlign = 0 TextColor = "#Colors.White" @@ -1428,6 +1446,7 @@ Begin Window wProfile Selectable = False TabIndex = 11 TabPanelIndex = 2 + TabStop = True Text = "Rating:" TextAlign = 0 TextColor = "#Colors.White" @@ -1510,6 +1529,7 @@ Begin Window wProfile Selectable = False TabIndex = 13 TabPanelIndex = 2 + TabStop = True Text = "High Rating:" TextAlign = 0 TextColor = "#Colors.White" @@ -1592,6 +1612,7 @@ Begin Window wProfile Selectable = False TabIndex = 15 TabPanelIndex = 2 + TabStop = True Text = "Rank:" TextAlign = 0 TextColor = "#Colors.White" @@ -1674,6 +1695,7 @@ Begin Window wProfile Selectable = False TabIndex = 17 TabPanelIndex = 2 + TabStop = True Text = "High Rank:" TextAlign = 0 TextColor = "#Colors.White" @@ -1819,6 +1841,7 @@ Begin Window wProfile Selectable = False TabIndex = 13 TabPanelIndex = 0 + TabStop = True Text = "Game:" TextAlign = 0 TextColor = "#Colors.White"