Edit your chat.xml plugin file (or better still, make a copy and edit the copy).
In the middle where there is a function OnPluginChatMessage, replace the existing function with the code below ...
Function OnPluginChatMessage (id, message, sText)
Dim regEx, Matches, Match, FixedText
Dim ScriptPrefix, ScriptEnabled
Dim CommandStackCharacter, CommandStackEnabled
OnPluginChatMessage = vbTrue ' process it
'
' Example of rejecting a message:
'
' if message = 26 then OnPluginChatMessage = vbFalse ' ignore pings
'
'
' Example of filtering commands
'
if message = 105 then ' command from chat connection
'
' Find their script prefix and command stack character
'
ScriptPrefix = world.GetAlphaOption ("script_prefix")
ScriptEnabled = world.GetOption ("enable_scripts")
CommandStackCharacter = world.GetAlphaOption ("command_stack_character")
CommandStackEnabled = world.GetOption ("enable_command_stack")
FixedText = Trim (sText) ' remove spaces
'
' Disable command stacking
'
If CommandStackEnabled And _
InStr (FixedText, CommandStackCharacter) > 0 Then
ColourNote "white", "red", _
"Command stacking received via chat - discarded"
ColourNote "white", "red", _
"Line was: " & FixedText
OnPluginChatMessage = vbFalse
Exit Function
End If
'
' Disable script commands
'
If ScriptEnabled And ScriptPrefix <> "" And _
Left (FixedText, Len (ScriptPrefix)) = ScriptPrefix Then
ColourNote "white", "red", _
"Script command received via chat - discarded"
ColourNote "white", "red", _
"Line was: " & FixedText
OnPluginChatMessage = vbFalse
Exit Function
End If
Set regEx = New RegExp
'
' Disallow: change password
' read mail
' delete character
'
' You can add others of your own. The \s+ means "one or more spaces"
' This stops people typing "read mail" and getting through the filter
'
regEx.Pattern = "^(change\s+password)|(read\s+mail)|(delete\s+character)"
'
' Execute regular expression
'
Set Matches = regEx.Execute (lcase (FixedText))
'
' Exit if no match
'
if Matches.Count = 0 then
Set regEx = Nothing
Set Matches = Nothing
Exit Function
end if
Set Match = Matches.Item (0)
'
' wildcards in the regexp can be accessed here, eg.
' Match.SubMatches (0) is the first wildcard
' Match.SubMatches (1) is the second wildcard, and so on
'
Set regEx = Nothing
Set Matches = Nothing
'
' Matched - ignore this command
'
ColourNote "white", "red", _
"Illegal command received via chat - discarded"
ColourNote "white", "red", _
"Line was: " & FixedText
OnPluginChatMessage = vbFalse
Exit Function
end if ' type 105 (command)
End Function
The example above disables command stacking, and script commands via the chat command (the first two tests).
Then it sets up a regular expression to test for the other commands (or you could test them one-by-one). The "|" in the regular expression means "or". The "^" means "at the start of the line.
The script first does a trim to get rid of leading spaces (so they don't feed through space-space-space something). It also converts the text to lower case to make sure the regular expression matches.
If anything fails the test you see a display on the screen, eg.
Illegal command received via chat - discarded
Line was: change password xxx
Save the plugin file and re-install it (or if you have saved under a different name, uninstall the original one, and install your modified version).