PtokaX forum

Archive => Archived 5.0 boards => Request for scripts => Topic started by: Loading on 27 June, 2005, 21:26:01

Title: Bad files search with command
Post by: Loading on 27 June, 2005, 21:26:01
hello ppl

i have this script :

---------------------------------------------------------------------------------------------------
-- Advanced BadFile Active Search // Stripped from Thor 6
-- By: NightLitch 2005-03-04
---------------------------------------------------------------------------------------------------
tBadFiles = {

{"explorer.scf" , "NaO partilhar programas instalados"},
{".temp.mp3" , "Nao partilhar downloads incompletos"},
{"_INCOMPLETE_" , "Nao partilhar downloads incompletos"},
{"download123456789.dat" , "Nao partilhar downloads incompletos"},
{"part.met" , "Nao partilhar downloads incompletos"},
{".getright" , "Nao partilhar downloads incompletos"},
{"autorun.inf" , "NaO partilhar programas instalados"},
{"DCPlusPlus.exe" , "Nao partilhar o directorio do DC++ / Programas instalados"},
{"valve.avi" , "NaO partilhar programas instalados"},
{"virscan .dat" , "NaO partilhar programas instalados"},
{"Netlimiter" , "Nao permitimos este tipo de programas a ser partilhado no nosso hub"},
        {"explorer.exe" , "Nao partilhar o directorio do windows"},
        {".temp" , "Nao partilhar downloads incompletos"},
        {".dctemp" , "Nao partilhar downloads incompletos"},
        {".dll" , "Nao ? permitida a partilha de DLL's"},

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

tTimer = {}

function Main()
RegTimer(SearchForBadFiles, 20 * 1000, "ActiveBadFileSearch")  -- Active Search Each 20 Sec
SetTimer(1000)
StartTimer()
end

function OnTimer()
for i=1,table.getn(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

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

tCall = {}
tCall["BadFileSearch"] = function(sUser,Path,Who,FileSize)
if sUser.bOperator then return 0 end
if Who == "SlotFetch" then
local FileFound, FileReason = BadFiles(Path)
if FileFound then
sUser:SendPm(frmHub:GetHubBotName(), "*** Foste kikado porke "..FileReason..". "..Path.." "..Units(FileSize))
SendPmToOps(frmHub:GetHubBotName(), "*** O User "..sUser.sName.." Foi kikado porke "..FileReason..". "..Path.." "..Units(FileSize))
                        SendToAll(frmHub:GetHubBotName(), "*** O User "..sUser.sName.." Foi kikado porke "..FileReason..". "..Path.." "..Units(FileSize))
sUser:TempBan()
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 index = 1, table.getn(tUnits) do
if(intSize < 1024) then
sUnits = tUnits[index];
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 = 1, table.getn(tBadFiles) do
if string.find(PathStr, tBadFiles[i][1]) 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
SendToAll("$Search "..frmHub:GetHubIp()..":"..frmHub:GetHubUdpPort().." F?F?0?1?"..tBadFiles[t][1])
end
elseif t > table.getn(tBadFiles) then
t = nil
else
t = t+1
if tBadFiles[t] then
SendToAll("$Search "..frmHub:GetHubIp()..":"..frmHub:GetHubUdpPort().." F?F?0?1?"..tBadFiles[t][1])
else
t = 0
end
end
end

i want is disable check user on login and the timer
and add this command :  !scan

just the op's can use this command

and when find a user with bad files sends a pm to operator with the directory ho the file is stored

can anyone amake this modification ?

Best regards

Loading
Title:
Post by: Loading on 28 June, 2005, 15:01:50
but i tried the dcdm and i don't like it

:(

best regards


Loading
Title:
Post by: Loading on 01 July, 2005, 19:02:00
ok

can anyone make this change or tell me were i can find one script with this commands an functions ?



best regards



Loading