scan filelists and making list of content
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

scan filelists and making list of content

Started by toh, 09 June, 2005, 19:34:19

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

toh

Is there any script that will scan filelists and make list of.. for example, *.avi files more than 500 mb in txt or html or may be Access database?

Markos

#1
hi all agen i hav changed some of this script  i am just wondering if this looks ok cose i dont do scripts
i dont get enay errors
-------------------------------------------------------------------------------------------------------

-- vim:ts=4:sw=4:noet

-- FileChecker.lua, rewrite of a 'SearchKick' bot for PtokaX by ptaczek and

-- Leon (called The Illegalist)

-- version 1.0 for DCH++

-- by Sedulus 20030910, requested by BSOD2600

-- 20030919: 1.0

--

-- Translated back to PtokaX (OpiumVolage 9 Sept. 2003)

-- Added timer for automating search

--

-- (using more mem (3 tables, instead of one) but less cpu)

--

-- searches for all terms in the SearchFor table,

-- sends a message to the user that he/she shares the file, with the response

-- message.

-- set disconnectUser to 1 if you want the user disconnected as well (not

-- recommended, as bots always seem to find a way to misinterpret data )

--

-- spaces in the SearchFor table will be converted to dollar's, but they will

-- (purposely) only match if there's a space in the result later.

-- so "a b" won't match "b a" or "aXXXb"



--// useful stuff

botName = "FileChecker?"

disconnectUser = nil -- disconnect the user, nil = don't

-- opchatName = "-OpChat-" -- set opchat nick here if you want messages to opchat instead of mainchat, else nil

opchatName = botName -- set opchat nick here if you want messages to opchat instead of mainchat, else nil

mb = 1024 * 1024

gb = 1024 * mb

-- Timer value, will send search for 1 of the file on all users at each timer

timerValue = 10*1000 -- Every 10 seconds (higher value will reduce load)

useTimer = 1 -- set to 1 to enable timer functions

counter = 1

--// do not modify this table, lookup the meanings in the $Search section in the protocol documentation

SearchTypes = {

ANY = 1,

AUDIO = 2,

COMPRESSED = 3,

DOCUMENT = 4,

EXECUTABLE = 5,

IMAGE = 6,

VIDEO = 7,

FOLDER = 8, -- do not use FOLDER's! the $SR's are formatted differently

}



st = SearchTypes

--// MODIFY THIS TABLE <-------

-- { searchType, words[, minimumSize[, regexMatch]] }

SearchFor = {


["N?o tenhas downloads incompletos no share! L? as regras em http://www.lav-sounds.pt.vu Info: http://www.ownage.site.vu"] = {

{ st.ANY, "antifrag", 1, "antifrag$" },

{ st.ANY, "download dat", 1, "download[0-9]+%.dat$" },

{ st.ANY, "INCOMPLETE~" },

{ st.ANY, "__INCOMPLETE___" },

{ st.ANY, ".part.met"},

{ st.ANY, ".mp3.temp"},

{ st.ANY, " .torrent"},

{ st.ANY, " dctmp"},

{ st.ANY, " .GETRIGHT"},

{ st.ANY, " Download10"},

}


-- },

}



--// convert the tables

SearchTable = {}

ResultTable = {}



function Main()

--frmHub:EnableSearchData(1)

frmHub:RegBot(botName)

botLen = string.len( botName )

local i = 0 -- add the serial botnames in here as well.. so the user doesn't think he is flooded by one person

for k,v in SearchFor do

for _,search in v do

-- add $Search

local s = "$Search Hub:"..botName..i.." "

if search[3] then

s = s.."T?F?"..search[3]

else

s = s.."F?F?0"

end

s = s.."?"..search[1].."?"..string.gsub( search[2], " ", "$" ).."|"

table.insert( SearchTable, s )

-- add $SR match

local idx = string.lower( search[2] )

ResultTable[idx] = { msg = k }

if search[4] then ResultTable[idx].regex = string.lower( search[4] ) end

-- next..

i = i + 1

end

end

st, SearchTypes, SearchFor = nil, nil, nil



-- set options

if opchatName then

messageFunc = SendPmToOps

else

messageFunc = SendPmToOps

opchatName = botName

end

if useTimer then SetTimer(timerValue) StartTimer() end

end



-- on new user

function NewUserConnected( client )

table.foreachi(SearchTable, function(_, v) client:SendData( v ) end)

end



-- on $SR

function SRArrival( client, line )

local match = nil

-- test if it was a result to us only

local ret,c,to = string.find( line, "\005([^\005|]*)|$" )

if ret and string.sub( to, 1, botLen ) == botName then

local ret,c,file,size = string.find( line, "^%$SR [^ ]+ ([^\005]*)\005([0-9]+) " )

if ret then

file = string.lower( file )

for k,v in ResultTable do

if ( v.regex and string.find( file, v.regex ) ) or ( not v.regex and string.find( file, k, 1, 1 ) ) then

match = 1

-- warn( client, file.." ("..dchpp.formatBytes( size ).." ("..size..")", v.msg )

warn( client, file.." ("..size.."", v.msg )

end

end

end

end

-- disconnect user

if match and disconnectUser and not client.bOperator then

client:SendData( "<"..botName.."> Est?s a ser Kikado!" )

clientisconnect()

return 1

end

end



function warn( client, file, response )

-- send message to user

client:SendData( "<"..botName.."> Tens no share o seguinte Ficheiro: "..file..": "..response )

if client.bOperator then return end

message = client.sName.." tem no share: "..file

-- send message to all Operators

messageFunc( opchatName, message )

end



function OnTimer()

if table.getn(SearchTable) < 1 then return end

SendToAll(SearchTable[counter])

counter = counter + 1

if counter > table.getn(SearchTable) then counter =1 end

end




-------------------------------------------------------------------------------------------------------

SMF spam blocked by CleanTalk