Skip to content

Instantly share code, notes, and snippets.

@DelusionalLogic
Created July 13, 2012 21:46
Show Gist options
  • Save DelusionalLogic/3107752 to your computer and use it in GitHub Desktop.
Save DelusionalLogic/3107752 to your computer and use it in GitHub Desktop.
Stop's commands from being sent
-- User: Delusional Logic
-- Date: 13-07-12
-- Time: 23:38
do
local prefixes = {'.'}
function chatHandler(msg)
local preLen = startsWith(msg, prefixes)
if preLen ~= 0 then
BlockChat()
end
end
function startsWith(sbig, slittle)
if type(slittle) == "table" then
for k,v in ipairs(slittle) do
if string.sub(sbig, 1, string.len(v)) == v then
return string.len(v)
end
end
return 0
end
if string.sub(sbig, 1, string.len(slittle)) == slittle then
return string.len(slittle)
end
return 0
end
BoL:addChatHandler(chatHandler)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment