PtokaX forum

Archive => Archived 5.0 boards => Help with scripts => Topic started by: Daywalker on 25 March, 2005, 22:47:44

Title: converting problem...
Post by: Daywalker on 25 March, 2005, 22:47:44
Can some1 help me with this script?...i'm new with this stuff  :P


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 DataArrival(tUser, sData)
if tUser.bOperator == nil then
if string.sub(sData, 1, 12) == "$Search Hub:" then
local _,_,  sSearch = string.find(sData, "$Search Hub:%S+%s+%a%?%a%?%d+%?%d+%?(.*)|")
for key,a in BadFiles do
if( string.find( string.lower(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\nTotalkey:- \t".. sSearch .."\r\n\r\n" )  
end
end
elseif string.sub(sData, 1, 7) == "$Search" then
local _,_, sSearch = string.find(sData, "%$Search %d+%.%d+%.%d+%.%d+:%d+%s+%a%?%a%?%d+%?%d+%?(.*)|")
for key,a in BadFiles do
if( string.find( string.lower(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\nTotalkey:- \t".. sSearch .."\r\n\r\n" )  
end
end
end
end
end

I don't know what i did wrong...but i think i'm overdoin' some things...
Title:
Post by: jiten on 26 March, 2005, 09:37:57
Try this:

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 SearchArrival (tUser, sData)
if tUser.bOperator == nil then
if string.sub(sData, 1, 12) == "$Search Hub:" then
local _,_,  sSearch = string.find(sData, "$Search Hub:%S+%s+%a%?%a%?%d+%?%d+%?(.*)|")
for key,a in BadFiles do
if( string.find( string.lower(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\nTotalkey:- \t".. sSearch .."\r\n\r\n" )  
end
end
elseif string.sub(sData, 1, 7) == "$Search" then
local _,_, sSearch = string.find(sData, "%$Search %d+%.%d+%.%d+%.%d+:%d+%s+%a%?%a%?%d+%?%d+%?(.*)|")
for key,a in BadFiles do
if( string.find( string.lower(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\nTotalkey:- \t".. sSearch .."\r\n\r\n" )  
end
end
end
end
end


Best regards,

jiten
Title:
Post by: Daywalker on 26 March, 2005, 10:38:56
tnx to jiten....i think i was to tired to see that mistake  :rolleyes:

it works great now  :D
Title:
Post by: jiten on 26 March, 2005, 11:00:54
yw :]
Title:
Post by: Daywalker on 29 March, 2005, 22:57:43
I tryed ..on request of TTB to exclude the TTH search but
 it's something i can't get fixed is it possible at all, because Tiger Tree Hashing files are client related  ?(

some TTH strings looks like this
TTH:WSHJKUTRAPELLPWMAXZ
it's about the RAPE thingy that's the bug :P