StealthBot.net: Profanity Unfilter - StealthBot.net

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Profanity Unfilter

#1 User is offline   Hdx Icon

  • Hdx
  • Icon
  • Group: Administrators
  • Posts: 1,359
  • Joined: July-31 09

Posted August 25, 2010 - 10:44 PM

Reader beware, profanity in the rest of the post :P
If you are curious what it does, read the comments.
Option Explicit
Script("Name") = "Profanity UnFilter"
Script("Author") = "Hdx"
Script("Major") = 0
Script("Minor") = 0
Script("Revision") = 1
'=============================================='
'Why did I make this? Shits and fucking giggels'
'What does it do? It reverses the Profanity filter of Battle.net, so you see "fuck you" instead of "!&$% you"'
'Is it complete? I think so, but probably not. Its not hard to add more filters, if you find more tell me in the thread.'

Private Const SID_CHATEVENT = &H0F

Private Const EID_WHISPER     = &H04
Private Const EID_TALK        = &H05
Private Const EID_BROADCAST   = &H06
Private Const EID_WHISPERSENT = &H0A
Private Const EID_INFO        = &H12
Private Const EID_ERROR       = &H13
Private Const EID_EMOTE       = &H17

Private SwapPacket

Sub Event_Load()
    SwapPacket = True
End Sub

Sub Event_PacketReceived(Protocol, ID, Length, Data)
    If (Protocol = "BNCS") Then
        If (ID = SID_CHATEVENT) Then
          Dim pBuffer
          Set pBuffer = DataBufferEx()
          pBuffer.Data = Mid(Data, 5)
          
          Call Recv_SID_CHATEVENT(pBuffer)
          
          Set pBuffer = Nothing
        End If
    End If
End Sub


'(DWORD) Event ID'
'(DWORD) Users Flags'
'(DWORD) Ping'
'(DWORD) IP Address (Defunct)'
'(DWORD) Account number (Defunct)'
'(DWORD) Registration Authority (Defunct)'
'(STRING) Username'
'(STRING) Text '
Private Sub Recv_SID_CHATEVENT(Buffer)
    If (SwapPacket = False) Then Exit Sub
    Dim EventID:  EventID  = Buffer.GetDWORD()
    Dim Flags:    Flags    = Buffer.GetDWORD()
    Dim Ping:     Ping     = Buffer.GetDWORD()
    Dim IPAddr:   IPAddr   = Buffer.GetDWORD()
    Dim Account:  Account  = Buffer.GetDWORD()
    Dim Auth:     Auth     = Buffer.GetDWORD()
    Dim Username: Username = Buffer.GetString()
    Dim Text:     Text     = Buffer.GetString()
  
    Select Case EventID
        Case EID_WHISPER, EID_TALK, EID_BROADCAST, EID_WHISPERSENT, EID_INFO, EID_ERROR, EID_EMOTE:
          Text = UnfilterProfanity(Text)
    End Select
  
    Dim out: Set out = DataBufferEx()
    out.InsertByte &HFF
    out.InsertByte SID_CHATEVENT
    out.InsertWORD (6 * 4) + Len(Username) + 1 + Len(Text) + 1 '6 UInt32's, 2 Strings in 2 null terminators
    out.InsertDWORD EventID
    out.InsertDWORD Flags
    out.InsertDWORD Ping
    out.InsertDWORD IPAddr
    out.InsertDWORD Account
    out.InsertDWORD Auth
    out.InsertNTString CStr(Username)
    out.InsertNTString CStr(Text)
    
    SwapPacket = False  
    Call ForceBNCSPacketParse(out.Data)
    SwapPacket = True
    VetoThisMessage
End Sub

'List taken from VL Forums: http://forum.valhallalegends.com/index.php/topic,1931.msg14988.html#msg14988 '
Private Function UnfilterProfanity(Text)    
    Text = Replace(Text, "!&$%@",     "pussy"    )
    Text = Replace(Text, "$!@%",      "shit"     )
    Text = Replace(Text, "#@%$!",     "bitch"    )
    Text = Replace(Text, "!@!#&",     "whore"    )
    Text = Replace(Text, "%@$%",      "dick"     )
    Text = Replace(Text, "!@!@%&",    "nipple"   )
    Text = Replace(Text, "$!$%",      "cock"     )
    Text = Replace(Text, "$&!%",      "cunt"     )
    Text = Replace(Text, "!&!@$",     "penis"    )
    Text = Replace(Text, "!@!@!@",    "vagina"   )
    Text = Replace(Text, "!@!@&#",    "nigger"   )
    Text = Replace(Text, "!@!@#",     "nigga"    )
    Text = Replace(Text, "@$%!@%&",   "asshole"  )
    Text = Replace(Text, "$%$",       "kkk"      )
    Text = Replace(Text, "$%@%",      "clit"     )
    Text = Replace(Text, "!&$%",      "fuck"     )
    Text = Replace(Text, "!@!@!%",    "faggot"   )
    Text = Replace(Text, "$%&!",      "klux"     )
    Text = Replace(Text, "%@%&!",     "dildo"    )
    Text = Replace(Text, "&@$%&#$@%", "masturbat")
    Text = Replace(Text, "&#&$%",     "erect"    )
    Text = Replace(Text, "$%&%",      "slut"     )
    Text = Replace(Text, "$@$&",      "kike"     )
    Text = Replace(Text, "%&$#@#!",   "lesbian"  )
    Text = Replace(Text, "$!@!$",     "chink"    )
    Text = Replace(Text, "!#!@$&",    "orgasm"   )
    Text = Replace(Text, "@$%!@!&",   "asswipe"  )
    Text = Replace(Text, "!@!$",      "gook"     )
    
    UnfilterProfanity = Text
End Function


Erin Go Bragh!
Posted Image

#2 User is offline   Fallen-God Icon

  • Full Member
  • PipPipPip
  • Group: Members
  • Posts: 364
  • Joined: September-11 09

Posted August 26, 2010 - 12:18 AM

View PostHdx, on 25 August 2010 - 11:44 PM, said:

Reader beware, profanity in the rest of the post :P
If you are curious what it does, read the comments.

Battle.Net has a profanity filter? I only ever used Warcraft so it's on other clients?
Choose Functional.

#3 User is offline   Hdx Icon

  • Hdx
  • Icon
  • Group: Administrators
  • Posts: 1,359
  • Joined: July-31 09

Posted August 26, 2010 - 12:19 AM

Its server side, so yes its on all clients.
YOU don't see the filtered version of what YOU send. But others do.

Note: PUBLIC channels are filtered, private channels (Ops, Clans, random names, etc..) are not.
Erin Go Bragh!
Posted Image

#4 User is online   Pyro Icon

  • Militant Asshole
  • Icon
  • Group: Administrators
  • Posts: 683
  • Joined: July-31 09

Posted August 26, 2010 - 04:24 AM

I made this a long time ago for 2.6!
Pyro, AKA Davnit
  • StealthBot Developer
  • Host of pyro.no-ip.biz

Website: https://davnit.net/
BNETDocs Discord: https://discord.gg/u87WVeu

#5 User is offline   Ribose Icon

  • Fire wants to be free.
  • Icon
  • Group: Global Moderators
  • Posts: 282
  • Joined: July-31 09

Posted September 08, 2010 - 10:28 PM

Text that has been un-filtered should appear gray so its obvious to you that it was un-filtered and others may not see it so.
Words such as "erectslut" should be unfiltered correctly.
My modified code:
Option Explicit
Script("Name") = "Profanity UnFilter"
Script("Author") = "Hdx, Ribose"
Script("Major") = 0
Script("Minor") = 0
Script("Revision") = 2
'=============================================='
'Why did I make this? Shits and fucking giggels'
'What does it do? It reverses the Profanity filter of Battle.net, so you see "fuck you" instead of "!&$% you"'
'Is it complete? I think so, but probably not. Its not hard to add more filters, if you find more tell me in the thread.'

Private Const SID_CHATEVENT = &H0F

Private Const EID_WHISPER     = &H04
Private Const EID_TALK        = &H05
Private Const EID_BROADCAST   = &H06
Private Const EID_WHISPERSENT = &H0A
Private Const EID_INFO        = &H12
Private Const EID_ERROR       = &H13
Private Const EID_EMOTE       = &H17

Private SwapPacket, Dict

Sub Event_Load()
    SwapPacket = True
    
    Set Dict = CreateObject("Scripting.Dictionary")
    
    Dict.CompareMode = vbBinaryCompare
    
    Dict.Add "&@$%&#$@%", "masturbat"
    Dict.Add "@$%!@%&",   "asshole"  
    Dict.Add "@$%!@!&",   "asswipe"  
    Dict.Add "%&$#@#!",   "lesbian"  
    Dict.Add "!@!@!%",    "faggot"   
    Dict.Add "!@!@&#",    "nigger"   
    Dict.Add "!@!@%&",    "nipple"   
    Dict.Add "!#!@$&",    "orgasm"   
    Dict.Add "!@!@!@",    "vagina"   
    Dict.Add "#@%$!",     "bitch"    
    Dict.Add "$!@!$",     "chink"    
    Dict.Add "%@%&!",     "dildo"    
    Dict.Add "!@!@#",     "nigga"    
    Dict.Add "!&!@$",     "penis"    
    Dict.Add "!&$%@",     "pussy"    
    Dict.Add "&#&$%",     "erect"    
    Dict.Add "!@!#&",     "whore"    
    Dict.Add "$%@%",      "clit"     
    Dict.Add "$!$%",      "cock"     
    Dict.Add "$&!%",      "cunt"     
    Dict.Add "%@$%",      "dick"     
    Dict.Add "!&$%",      "fuck"     
    Dict.Add "!@!$",      "gook"     
    Dict.Add "$%&!",      "klux"     
    Dict.Add "$@$&",      "kike"     
    Dict.Add "$!@%",      "shit"     
    Dict.Add "$%&%",      "slut"     
    Dict.Add "$%$",       "kkk"      
End Sub

Sub Event_Close()
    Set Dict = Nothing
End Sub

Sub Event_PacketReceived(Protocol, ID, Length, Data)
    If (Protocol = "BNCS") Then
        If (ID = SID_CHATEVENT) Then
          Dim pBuffer
          Set pBuffer = DataBufferEx()
          pBuffer.Data = Mid(Data, 5)
          
          Call Recv_SID_CHATEVENT(pBuffer)
          
          Set pBuffer = Nothing
        End If
    End If
End Sub


'(DWORD) Event ID'
'(DWORD) Users Flags'
'(DWORD) Ping'
'(DWORD) IP Address (Defunct)'
'(DWORD) Account number (Defunct)'
'(DWORD) Registration Authority (Defunct)'
'(STRING) Username'
'(STRING) Text '
Private Sub Recv_SID_CHATEVENT(Buffer)
    If (SwapPacket = False) Then Exit Sub
    Dim EventID:  EventID  = Buffer.GetDWORD()
    Dim Flags:    Flags    = Buffer.GetDWORD()
    Dim Ping:     Ping     = Buffer.GetDWORD()
    Dim IPAddr:   IPAddr   = Buffer.GetDWORD()
    Dim Account:  Account  = Buffer.GetDWORD()
    Dim Auth:     Auth     = Buffer.GetDWORD()
    Dim Username: Username = Buffer.GetString()
    Dim Text:     Text     = Buffer.GetString()
  
    Select Case EventID
        Case EID_TALK, EID_BROADCAST, EID_WHISPERSENT, EID_INFO, EID_ERROR, EID_EMOTE:
          Text = UnfilterProfanity(Text)
    End Select
  
    Dim out: Set out = DataBufferEx()
    out.InsertByte &HFF
    out.InsertByte SID_CHATEVENT
    out.InsertWORD (6 * 4) + Len(Username) + 1 + Len(Text) + 1 '6 UInt32's, 2 Strings in 2 null terminators
    out.InsertDWORD EventID
    out.InsertDWORD Flags
    out.InsertDWORD Ping
    out.InsertDWORD IPAddr
    out.InsertDWORD Account
    out.InsertDWORD Auth
    out.InsertNTString CStr(Username)
    out.InsertNTString CStr(Text)
    
    SwapPacket = False  
    Call ForceBNCSPacketParse(out.Data)
    SwapPacket = True
    VetoThisMessage
End Sub

'List taken from VL Forums: http://forum.valhallalegends.com/index.php/topic,1931.msg14988.html#msg14988 '
Private Function UnfilterProfanity(Text)
    If Len(Text) >= 3 Then
        Dim Keys, Key
        Keys = Dict.Keys()
        For Each Key In Keys
            Text = Replace(Text, Key, "ÿc5" & Dict(Key) & "ÿc0", 1, -1, vbBinaryCompare)
        Next
    End If
    
    UnfilterProfanity = Text
End Function

~Ribose
[ Download ] [ Wiki ] [ Support ] [ Scripting ]
[ Chrome ] [ Notepad++ ] [ fedora ]
[ Homepage ] [ BNLS ♯ ]

#6 User is offline   T3X0 Icon

  • Full Member
  • PipPipPip
  • Group: Members
  • Posts: 498
  • Joined: June-27 10

Posted September 10, 2010 - 06:10 PM

mhm could i ask you something?
stealthbot > stettings > Edit catch phrases
couldnt you add the words there, too? it should work then, too. shouldn't it?

By the way a good script :)
but could you add something like a folder for the words + who said the word + time and date ... ?

would be great then :)

edit: does the bot need channel operator status to replace the words?

This post has been edited by art: September 10, 2010 - 06:10 PM


#7 User is offline   The-Black-Ninja Icon

  • The Sex
  • Icon
  • Group: Scripting Moderators
  • Posts: 2,526
  • Joined: August-01 09

Posted September 10, 2010 - 06:22 PM

BNet censors the phrase before the bot can get what the word really was.

#8 User is offline   T3X0 Icon

  • Full Member
  • PipPipPip
  • Group: Members
  • Posts: 498
  • Joined: June-27 10

Posted September 10, 2010 - 07:39 PM

Quote

BNet censors the phrase before the bot can get what the word really was.

lol?

#9 User is offline   The-Black-Ninja Icon

  • The Sex
  • Icon
  • Group: Scripting Moderators
  • Posts: 2,526
  • Joined: August-01 09

Posted September 10, 2010 - 07:45 PM

View Postart, on 10 September 2010 - 03:39 PM, said:

lol?
When you use a flagged phrase in a public channel, BNet takes that phrase, censors it, then sends it back out for everyone to read. This is why the text goes all @#$%%^ when others see it because BNet is controlling what everyone says; Stealthbot is no different than any other user.

These messages aren't generated at random, there are hardcoded patterns for each flagged phrase, so all this script is doing is finding the combination of symbols and matching it to the phrase.

#10 User is offline   PhiX Icon

  • Notice the ownage.
  • Icon
  • Group: Administrators
  • Posts: 8,388,607
  • Joined: July-31 09

Posted September 11, 2010 - 12:09 AM

View Postart, on 10 September 2010 - 08:10 PM, said:

mhm could i ask you something?
stealthbot > stettings > Edit catch phrases
couldnt you add the words there, too? it should work then, too. shouldn't it?
I assume you're referring to chat filters, right? If you add the word to the list of chat filters, the bot will ignore any and all messages containing that word. It's not possible to replace words with custom ones. Only outgoing filters support this option, but that doesn't help in this situation. And catch phrases are a completely different feature.

View Postart, on 10 September 2010 - 08:10 PM, said:

but could you add something like a folder for the words + who said the word + time and date ... ?
Could be added, but I don't really see the benefit?

View Postart, on 10 September 2010 - 08:10 PM, said:

does the bot need channel operator status to replace the words?
No.
PhiX

BNLS: phix.no-ip.org

Please refrain from sending me personal messages regarding technical support issues. Use the forums, that is what they are there for.

#11 User is offline   dragonspike Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: February-20 11

Posted June 10, 2011 - 04:26 PM

hi well i need a bit off help to get it to work i dunno how to do it so can sumone tell me how to get it working plz ty

#12 User is offline   PhiX Icon

  • Notice the ownage.
  • Icon
  • Group: Administrators
  • Posts: 8,388,607
  • Joined: July-31 09

Posted June 10, 2011 - 07:39 PM

Simply add the script and censored words will be unfiltered in public channels. There are no commands if that's what you're asking.
PhiX

BNLS: phix.no-ip.org

Please refrain from sending me personal messages regarding technical support issues. Use the forums, that is what they are there for.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users