PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: (!(Tys?kan)=) on 09 May, 2004, 22:03:48

Title: BlockBot
Post by: (!(Tys?kan)=) on 09 May, 2004, 22:03:48
Hi, who can modify this script:
cmd1 = "!b"

BlockedNicks = {}

function Main()
frmHub:EnableFullData(1)
end

BlockTriggs = {
["$Rev"] = 1,
["$Con"] = 2,
}


function DataArrival(curUser,data)
if strsub(data,1,1) == "$" then
local str1 = strsub(data,1,4)
if BlockTriggs[str1] then
if BlockedNicks[strlower(curUser.sName)] then
curUser:SendData("*** Files blocked")
return 0
elseif BlockTriggs[str1] == 1 then
local _,_,conNick = strfind(data,"(%S+)|$")
if BlockedNicks[strlower(conNick)] then
curUser:SendData("*** The user are infected.")
return 1
end
elseif BlockTriggs[str1] == 2 then
local _,_,conNick = strfind(strsub(data,14,strlen(data)),"^(%S+)")
if BlockedNicks[strlower(conNick)] then
curUser:SendData("*** The user infected.")
return 1
end
end
end
elseif strsub(data,1,1) == "<" and curUser.bOperator then
local _,_,cmd,nick = strfind(data,"^%b<>%s+(%S+)%s+(%S+)|$")
if cmd and cmd == cmd1 then
if BlockedNicks[strlower(nick)] then
BlockedNicks[strlower(nick)] = nil
curUser:SendData("*** "..nick.." blocked.")
else
BlockedNicks[strlower(nick)] = 1
curUser:SendData("*** "..nick.." blocked.")
end
return 1
end
end
end

The script must writing user's who's blocked to file, and the script must blocking some file such exe,tmp and other...
Thanks!
Title:
Post by: dvxjunkie on 16 May, 2004, 05:35:37
-- try this should work

badnicks = {
["badnick"] = 1,
["another badnick"] = 1,
["another badnick"] = 1 -- note no comma after last nick in list
}
function Main()
frmHub:EnableFullData(1)
end
function DataArrival(curUser, data)
if (strsub(data, 1, 1) == "$" and strfind(data, "ConnectToMe") and  badnicks[curUser.sName]) then
return 1
end
end