BadFiles conversion
 

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

BadFiles conversion

Started by -SkA-, 18 November, 2007, 20:28:27

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

-SkA-

...and I really need the conversion of this script too  ::)

-- This script is converted with PtokaX LUA API Converter v0.9 at 11/17/07 11:48:14
---------------------------------------------------------------------------------------------------
-- Advanced BadFile Active Search // Stripped from Thor 6
-- By: NightLitch 2005-03-04
---------------------------------------------------------------------------------------------------
tBadFiles = {

--	{"download123456789.dat" , "NO incomplete .dat"},
--	{".GetRight" , "NO incomplete .getright"},
--	{".antifrag" , "No incomplete .antifrag"},
--	{"_INCOMPLETE_" , "NO incomplete of WinMx"},
--	{".tdc" , "NO incomplete .tdc"},
        {"preteen" , "NO preteen OSTJA!"},
        {"r@ygold" , "NO PRETEEN !"},
	{".porn." , "NO .PORN.!!! PERVERT"},
	{"masterbating" , "NO .PORN.!!!"},	
--	{".vob" , "NO .vob"},	
--	{"explorer.scf" , "NO file system in share"},
--	{".mp3.exe" , "NO shit in share! no virus"},
--	{".part.met" , "NO incomplete of emule"},
--      {".dctmp" , "NO incomplete .dctmp"},

}

---------------------------------------------------------------------------
--// Don't Edit below this point if you don't now what you are doing
---------------------------------------------------------------------------

tTimer = {}

OnStartup = function()
	RegTimer(SearchForBadFiles, 10*1000, "ActiveBadFileSearch") -- Active Search Each 20 Sec

end

OnTimer = function(tmr)
	for i in ipairs(tTimer) do
		tTimer[i][3] = tTimer[i][3] + 1
		if tTimer[i][3] > tTimer[i][2] then
			tTimer[i][3] = 1; tTimer[i][1]()
		end
	end
end

UDPSRArrival = function(sUser,sData)
	Core.GetUserAllData(sUser)
	local _,_,From,Path,FileSize,FreeSlots,TotalSlots = string.find(sData, "^%$SR%s+(%S+)%s+(.*)(%d+)%s+(%d+)%/(%d+)")
	if tCall["BadFileSearch"] then pcall(tCall["BadFileSearch"],sUser,Path,FileSize) end
end

tCall = {
	BadFileSearch = function(sUser,Path,FileSize)
		if not sUser.bOperator then 
			local FileFound, FileReason = BadFiles(string.lower(Path))
			if FileFound then
				Core.SendToNick(sUser.sNick,"<"..SetMan.GetString(21).."> *** You have been kicked for "..FileReason..". "..Path.." "..Units(FileSize))
				BanMan.TempBanIP(sUser.sIP,90,Path,SetMan.GetString(21),true)
				Core.Disconnect(sUser)
			end
		end
	end
}

RegTimer = function(Function,Interval,str)
	local tmpTrig = Interval / 1000
	table.insert(tTimer,{Function,tmpTrig,1,str})
end

Units = function(intSize)
	if tonumber(intSize) ~= 0 then
		local tUnits = { "Bytes", "KB", "MB", "GB", "TB" }
		intSize = tonumber(intSize); local sUnits;
		for i in ipairs(tUnits) do
			if(intSize < 1024) then sUnits = tUnits[i]; break; else intSize = intSize / 1024; end
		end
		return string.format("%0.1f %s",intSize, sUnits);
	else
		return "0 Bytes"
	end
end

BadFiles = function(PathStr)
	for i in ipairs(tBadFiles) do
		if string.find(PathStr, string.lower(tBadFiles[i][1]), 1, true) then
			return 1,tBadFiles[i][2]
		end
	end
	return nil, "Other Files"
end

SearchForBadFiles = function()
	if t == nil then
		t =1
		if tBadFiles[t] then
			Core.SendToAll("$Search "..Core.GetHubIP()..":"..SetMan.GetString(4).." F?F?0?1?"..tBadFiles[t][1])
		end
	elseif t > #tBadFiles then
		t = nil
	else
		t = t+1
		if tBadFiles[t] then
			Core.SendToAll("$Search "..Core.GetHubIP()..":"..SetMan.GetString(4).." F?F?0?1?"..tBadFiles[t][1])
		else
			t = 0
		end
	end
end


I've tried to convert that with Hungarista's tool but it doesn't works... (no errors from PX).

Thanks!
???:::??x??em?-N????:::??? ?wN??

BrianzaLand Blog" style="border:0

-SkA-

Quote from: Mutor on 18 November, 2007, 23:31:04
FileSearch 1.0 LUA 5.11 [Strict] [API 1 & 2]

Thank you for that script but the script I've submitted searches for shared files, not for users searches...
???:::??x??em?-N????:::??? ?wN??

BrianzaLand Blog" style="border:0

SMF spam blocked by CleanTalk