Created
July 13, 2012 21:46
-
-
Save DelusionalLogic/3107752 to your computer and use it in GitHub Desktop.
Stop's commands from being sent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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