help with Illegalist
 

help with Illegalist

Started by atonal, 13 June, 2008, 18:35:24

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

atonal

Hi sombory can make this scripts work for new api ?

will be good thanks for all

here is the old acript

-- Simple Illegalist v0.1
-- Created by Ptaczek, Jan-3, 2003
-- Searches for specified patterns. Useful for illegal share checking
-- some changes by Skippy and RabidWombat and OpiumVolage and trucker
-- add tables warn and kick by nErBoS
-- converted to lua 5 by Madman [Untested!]

BotName = "Illegalist"

function Main()
frmHub:RegBot(BotName)
--frmHub:EnableSearchData(1)
end

Files = {
["childsex"]="NO sick Porn inhere!",
["childporn"]="NO sick kid Porn inhere!",
["underage"]="NO sick kid Porn inhere!",
["jena 16 yr"]="NO sick kid Porn inhere!",
["12 yo"]="NO sick kid Porn inhere!",
["16Yo"]="NO sick kid Porn inhere!",
["lolita"]="NO Lolita files inhere!",
["incest"]="NO sick incest Porn inhere!",
["animalsex"]="NO Animalsex files here!",
["svastika"]="NO Nazi/white power music HERE!!!",
[".temp.mp3"]="NO sharing of incomplete downloads",
["_INCOMPLETE_"]="NO sharing of incomplete downloads",
["download123456789.dat"]="NO sharing of incomplete downloads",
["part.met"]="NO sharing of incomplete downloads",
[".getright"]="NO sharing of incomplete downloads",
["share faker"]="NO tools for fake sharing allowed",
["share hacker"]="No tools for fake sharing allowed",
[".dctmp"]="NO sharing of incomplete downloads",
["explorer.scf"]="Don't share installed windows, i.e.",
["system32.dll"]="Don't share installed windows.",
["Ultima Thule"]="Rasistisk musik",
["msgsc.dll"]="Installerade program",
["COMCTL32.DLL"]="Installerade program",
["studio.xnf"]="Installerade program",
["command.com"]="Installerade program",
["wab.exe"]="Installerade program",
["Exempelspelningslista.wpl"]="Dela inte ut mina dokument mappen.",
["npdsplay.dll"]="Installerade program",
["Ultima Thule - En sk?ggl?s dundergud.mp3"]="Rasistisk musik",
["ultima thule - F?dernesland.mp3"]="Rasistisk musik",
["ultima thule - D? svallar v?rt vikingablod.mp3"]="Rasistisk musik",
["ultima thule - Vikingabalk.mp3"]="Rasistisk musik",
["ultima thule - Balladen till Sverige.mp3"]="Rasistisk musik",
["ultima thule - Jag tror p? sommaren.mp3"]="Rasistisk musik",
["Ultima Thule"]="Gruppen klassad som Rasistiskt",
["Ultima_Thule"]="Gruppen klassad som Rasistiskt",
["R?de Orm"]="Rasistisk musik",
["Pluton Svea"]="Rasistisk musik",
["Queue.xml"]="Don't share installed",
["Favorites.xml"]="Don't share installed",
["netlimiter"]="netlimiter"}

warn = {}
kick = {}
usersimune = {
"robocop", 
"Illegalist",} -- Users you want to not be checked

kicklog = "kicks.txt" -- In script folder
main = "Active" --- write Deactive and will not send the kicks and bans to the main


function NewUserConnected(user)
	if (warn[user.sName] == nil or warn[user.sName] == 4) then
		warn[user.sName] = 0
	end
	if (kick[user.sName] == nil or kick[user.sName] == 4) then
		kick[user.sName] = 0
	end

	for i,v in Files do
		user:SendData("$Search Hub:"..BotName.." F?F?0?1?"..i)
	end
end

function SRArrival(user, data)
	_,_,nick = string.find( data, "\05(%S*)|$" )
	local s,e,path = string.find(data, "$SR%s+%S+%s+(.+)%x+%s+%x+/%x+")
		if( nick == BotName) then
			for i=1,table.getn(usersimune) do
				if (user.bOperator or user.sName == usersimune[i]) then
				return 1
			end
		end
		if (GetProfileName(user.iProfile) == "VIP") then
			if (kick[user.sName] == 3) then
				ClearNill(user)
				kick[user.sName] = kick[user.sName] + 1
				Reason = FindWhat(data)
				SendPmToOps(BotName, "*** User "..user.sName.." got ban. Reason: "..Reason.." FILE: "..path)
				user:SendPM(BotName,"You have been banned. "..Reason)
				if (main == "Active" ) then
					SendToAll(BotName, "*** User "..user.sName.." got ban. Reason: "..Reason.." FILE: "..path)
				end
				if (main == "Deactive") then
					return 1
				end
				user:Ban()
			elseif (warn[user.sName] == 3 or kick[user.sName] == 1 or kick[user.sName] == 2) then
				ClearNill(user)
				warn[user.sName] = warn[user.sName] + 1
				kick[user.sName] = kick[user.sName] + 1
				Reason = FindWhat(data)
				SendPmToOps(BotName, "*** User "..user.sName.." got "..kick[user.sName].." kicks. Reason: "..Reason.." FILE: "..path)
				user:SendPM(BotName,"You have been kicked "..kick[user.sName].." time(s) at 3 you will be ban. "..Reason.." FILE: "..path)
				--	appendto(kicklog) 
				--	write("\r\n"..user.sName.."|"..Reason.."|"..path.."|"..kick[user.sName].."|"..GetTime()) 
				--	writeto()
					local file = io.open(kicklog, "a+") -- "a+"
					file:write("\r\n"..user.sName.."|"..Reason.."|"..path.."|"..kick[user.sName].."|"..GetTime()) 
					file:close()
				if (main == "Active" ) then
					SendToAll(BotName, "*** User "..user.sName.." got "..kick[user.sName].." kicks. Reason: "..Reason.." FILE: "..path)
				end
				if (main == "Deactive") then
					return 1
				end
				user:TempBan()
			elseif (warn[user.sName] == 0 or warn[user.sName] == 1 or warn[user.sName] == 2) then
				ClearNill(user)
				warn[user.sName] = warn[user.sName] + 1
				Reason = FindWhat(data)
				SendPmToOps(BotName, "*** User "..user.sName.." got "..warn[user.sName].." warns. Reason: "..Reason.." FILE: "..path)
				user:SendPM(BotName, "You have been warned "..warn[user.sName].." time(s) at 3 you will be kicked. "..Reason.." FILE: "..path)
				user:SendPM(BotName, "You can come back when you have corrected the problem")
				user:SendPM(BotName, "Disconnected...")
				user:Disconnect()
			end
		elseif not(user.bOperator and GetProfileName(user.iProfile) == "VIP" and user.sName == usersimune[i]) then --this will solve the double log i think
			if (kick[user.sName] == 3) then
				ClearNill(user)
				kick[user.sName] = kick[user.sName] + 1
				Reason = FindWhat(data)
				SendPmToOps(BotName, "*** User "..user.sName.." got ban. Reason: "..Reason.." FILE: "..path)
				user:SendPM(BotName,"You have been banned. "..Reason)
				if (main == "Active" ) then
					SendToAll(BotName, "*** User "..user.sName.." got ban. Reason: "..Reason.." FILE: "..path)
				end
				if (main == "Deactive") then
					return 1
				end
				user:Ban()
			elseif (kick[user.sName] == 0 or kick[user.sName] == 1 or kick[user.sName] == 2) then
				ClearNill(user)
				kick[user.sName] = kick[user.sName] + 1
				user:SendData(Bot, kick[user.sName])
				Reason = FindWhat(data) 
				SendPmToOps(BotName, "*** User "..user.sName.." got "..kick[user.sName].." kicks. Reason: "..Reason.." FILE: "..path) 
				user:SendPM(BotName,"You have been kicked "..kick[user.sName].." time(s) at 3 you will be ban. "..Reason.." FILE: "..path)
				--	appendto(kicklog) 
				--	write("\r\n"..user.sName.."|"..Reason.."|"..path.."|"..kick[user.sName].."|"..GetTime()) 
				--	writeto()
					local file = io.open(kicklog, "a+") -- "a+"
					file:write("\r\n"..user.sName.."|"..Reason.."|"..path.."|"..kick[user.sName].."|"..GetTime()) 
					file:close()
				if (main == "Active" ) then
					SendToAll(BotName, "*** User "..user.sName.." got "..kick[user.sName].." kicks. Reason: "..Reason.." FILE: "..path)
				end
				if (main == "Deactive") then
					return 1
				end
				user:TempBan() 
			end
		end
	end
end

function FindWhat(data)
	for i,v in Files do
		if( string.find(string.lower(data), i) ) then
			return v
		end
	end
	return "Other files"
end

function GetTime()
	s = os.date("%S")
	h = os.date("%H")
	m = os.date("%M")
	d = os.date("%d")
	mm = os.date("%m")
	y = os.date("%y")
	Date = "Day: "..d.."/"..mm.."/20"..y.." Hour: "..h..":"..m..":"..s
	return Date
end

function ClearNill(user)
	if (warn[user.sName] == nil) then
		warn[user.sName] = 0
	end
	if (kick[user.sName] == nil) then
		kick[user.sName] = 0
	end
end

bastya_elvtars

You should use ADLSearch in your op client instead.
Everything could have been anything else and it would have just as much meaning.

SMF spam blocked by CleanTalk