For TFS 0.3.5 I made script: http://otland.net/threads/lua-and-c-block-ips-links-on-default-trade-help.50954/
For TFS 0.3.6 it's almost the same (check link to updated version by Summ).
but for TFS 0.4 and OTX you can use other script!
This script DOES NOT REQUIRE C++ (source) changes!
This script uses other 'detection algorithm' which is much better and block all 'tricks' like...
block 'better-ot.hopto.org' blocks also:
script:
For TFS 0.3.6 it's almost the same (check link to updated version by Summ).
but for TFS 0.4 and OTX you can use other script!
This script DOES NOT REQUIRE C++ (source) changes!
This script uses other 'detection algorithm' which is much better and block all 'tricks' like...
block 'better-ot.hopto.org' blocks also:
In talkactions.xml add (awesome 'default' option only in TFS 0.4 and OTX):better-ot hopto org
better-ot ANGRY!! hopto org
better-ot h o p t o o rg
WTF?! Cant I say better!!!-!!!ot!!hopto!!org??
PHP:
<talkaction words="illegalWords" default="1" script="blocklinks.lua"/>
PHP:
local blockedLinks = {'wp.pl', 'better-ot.hopto.org'}
local muteStorage = 16246
local muteTime = 2 -- in seconds
-- END OF CONFIG --
local blockedLinksData = {}
local separator = '[ !\t%$%^%+%-%.%%_,<>]*'
for _, linkText in pairs(blockedLinks) do
local data = {}
data.link = linkText
data.preg = '.*'
for c in string.gmatch(linkText, '.') do
if(c == '.') then
data.preg = data.preg .. '.*'
else
data.preg = data.preg .. c .. separator
end
end
data.preg = data.preg .. '.*'
table.insert(blockedLinksData, data)
end
function isLegalMessage(words)
for _, blockedLink in pairs(blockedLinksData) do
if(string.match(words, blockedLink.preg) ~= nil) then
return false, blockedLink.link
end
end
return true, ''
end
function onSay(cid, words, param, channel)
words = words .. ' ' .. param
local legalMessage, forbiddenLink = isLegalMessage(
string.lower(words))
if(not legalMessage) then
local muteStorageValue = getPlayerStorageValue(cid, muteStorage)
if(muteStorageValue > os.time()) then
doPlayerSendCancel(cid, 'You are still muted for ' .. muteStorageValue-os.time() .. ' seconds.')
return true
end
setPlayerStorageValue(cid, muteStorage, os.time()+muteTime)
if(channel == CHANNEL_DEFAULT) then
doCreatureSay(cid, '...', TALKTYPE_SAY)
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Link: ' .. forbiddenLink .. ' is forbidden.')
return true
end
return false
end
Last edited: