PtokaX forum

Archive => Archived 4.0 boards => Finished Lua 4 scripts => Topic started by: ??????Hawk?????? on 29 June, 2004, 00:37:51

Title: Pm to Ops chat of bad file searchers
Post by: ??????Hawk?????? on 29 June, 2004, 00:37:51
heya peeps  :-)

just a little something i did for my hub

thaught id share it...


-- pm to ops chat of any one
-- searching for bad files
-- by ??????Hawk??????  
-- 28-06-2004
BadFiles = {
["childsex"]=1,
["childporn"]=2,
["underage"]=3,
["animalsex"]=4,
["preteen"]=5,
["r@ygold"]=6,
["lolita"]=7,
["rape"]=8,
["incest"]=9,
["beastiality"]=10,
["rape"]=11,
}

function Main()
frmHub:EnableFullData(1)
end

function DataArrival(tUser, sData)
if tUser.bOperator == nil then
if strsub(sData, 1, 12) == "$Search Hub:" then
local _,_,  sSearch = strfind(sData, "$Search Hub:%S+%s+%a%?%a%?%d+%?%d+%?(.*)|")
for key,a in BadFiles do
if( strfind( strlower(sSearch), key) ) then
SendPmToOps(frmHub:GetOpChatName(), "\r\n\r\nThis user is searching for Bad files Please check their share:-\r\n\r\nUsername:-\t"..tUser.sName.."\r\n\IP:-\t\t" .. tUser.sIP .. "\r\nSearched for:-\t"..key.."\r\n\r\n" )
end
end
elseif strsub(sData, 1, 7) == "$Search" then
local _,_, sSearch = strfind(sData, "%$Search %d+%.%d+%.%d+%.%d+:%d+%s+%a%?%a%?%d+%?%d+%?(.*)|")
for key,a in BadFiles do
if( strfind( strlower(sSearch), key) ) then
SendPmToOps(frmHub:GetOpChatName(), "\r\n\r\nThis user is searching for Bad files Please check their share:-\r\n\r\nUsername:-\t"..tUser.sName.."\r\n\IP:-\t\t" .. tUser.sIP .. "\r\nSearched for:-\t"..key.."\r\n\r\n" )
end
end
end
end
end

Title:
Post by: blackwings on 29 June, 2004, 00:43:00
I have couple of question about this script

1) This script works both on active and passive user, is that correct?

2) Could you add two tables? Like one talbe with file names that a user should get kicked for and one table with file names that a user should get banned for.
Title:
Post by: ??????Hawk?????? on 29 June, 2004, 01:28:29
try this m8.

and yes it  works on both passive and active searches




-- pm to ops chat of any one
-- searching for bad files
-- ban or warn user
-- by ??????Hawk??????  
-- 28-06-2004
Bot = "Bad Search"
BadFiles = {
["childsex"]="ban",
["childporn"]="ban",
["underage"]="ban",
["animalsex"]="ban",
["preteen"]="ban",
["r@ygold"]="ban",
["lolita"]="warn",
["rape"]="warn",
["incest"]="warn",
["beastiality"]="warn",
["rape"]="warn",
}

function Main()
frmHub:EnableFullData(1)
end

function DataArrival(tUser, sData)
if tUser.bOperator == nil then
if strsub(sData, 1, 12) == "$Search Hub:" then
local _,_,  sSearch = strfind(sData, "$Search Hub:%S+%s+%a%?%a%?%d+%?%d+%?(.*)|")
for key,a in BadFiles do
if( strfind( strlower(sSearch), key) ) then
if BadFiles[key] == "ban" then
SendPmToOps(frmHub:GetOpChatName(), "\r\n\r\nThis user has been banned for searching for Bad files:-\r\n\r\nUsername:-\t"..tUser.sName.."\r\n\IP:-\t\t" .. tUser.sIP .. "\r\nSearched for:-\t"..key.."\r\n\r\n" )
tUser:SendPM(Bot, "\r\n\r\nYou have been banned for searching for Bad files:-\r\n\r\nUsername:-\t"..tUser.sName.."\r\n\IP:-\t\t" .. tUser.sIP .. "\r\nSearched for:-\t"..key.."\r\n\r\nThese Details have been Logged" )
tUser:Ban()
tUser:Disconnect()
elseif BadFiles[key] == "warn" then
SendPmToOps(frmHub:GetOpChatName(), "\r\n\r\nwThis user is searching for Bad files Please check their share:-\r\n\r\nUsername:-\t"..tUser.sName.."\r\n\IP:-\t\t" .. tUser.sIP .. "\r\nSearched for:-\t"..key.."\r\n\r\n" )
tUser:SendPM(Bot, "\r\n\r\nYou are searching for Bad files:-\r\n\r\nUsername:-\t"..tUser.sName.."\r\n\IP:-\t\t" .. tUser.sIP .. "\r\nSearched for:-\t"..key.."\r\n\r\nThese Details have been Logged \r\n\r\n! ! ! THIS IS A WARNING ! ! !" )
end

end
end
elseif strsub(sData, 1, 7) == "$Search" then
local _,_, sSearch = strfind(sData, "%$Search %d+%.%d+%.%d+%.%d+:%d+%s+%a%?%a%?%d+%?%d+%?(.*)|")
for key,a in BadFiles do
if( strfind( strlower(sSearch), key) ) then
if BadFiles[key] == "ban" then
SendPmToOps(frmHub:GetOpChatName(), "\r\n\r\nThis user has been banned for searching for Bad files:-\r\n\r\nUsername:-\t"..tUser.sName.."\r\n\IP:-\t\t" .. tUser.sIP .. "\r\nSearched for:-\t"..key.."\r\n\r\n" )
tUser:SendPM(Bot, "\r\n\r\nYou have been banned for searching for Bad files:-\r\n\r\nUsername:-\t"..tUser.sName.."\r\n\IP:-\t\t" .. tUser.sIP .. "\r\nSearched for:-\t"..key.."\r\n\r\nThese Details have been Logged" )
tUser:Ban()
tUser:Disconnect()
elseif BadFiles[key] == "warn" then
SendPmToOps(frmHub:GetOpChatName(), "\r\n\r\nThis user is searching for Bad files Please check their share:-\r\n\r\nUsername:-\t"..tUser.sName.."\r\n\IP:-\t\t" .. tUser.sIP .. "\r\nSearched for:-\t"..key.."\r\n\r\n" )
tUser:SendPM(Bot, "\r\n\r\nYou are searching for Bad files:-\r\n\r\nUsername:-\t"..tUser.sName.."\r\n\IP:-\t\t" .. tUser.sIP .. "\r\nSearched for:-\t"..key.."\r\n\r\nThese Details have been Logged \r\n\r\n! ! ! THIS IS A WARNING ! ! !" )
end
end
end
end
end
end






just a point m8  ..  this will ban any ops working for other hubs if they'r not opped in your hub
Title:
Post by: blackwings on 29 June, 2004, 01:41:08
another question, can I use file extensions in the script, like .dll?

EDIT: another question, is this script for searching users share for bad files or is it checking on what users search for??
Title:
Post by: ??????Hawk?????? on 29 June, 2004, 02:18:07
yes you can use file extentions.

but remember if the user has their dc set to automaticaly search for alternative d/l locations
their search string will contain the full file name of anything there downloading ( including extention )  
so you may ban innocent users..

this script ONLY  intercepts users searches.


the script was never meant to be automated because there so many veriables that could ban an innocent user.

it was wrote purely as a tool to assist op's in keeping the Sick users out .