PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: toolmanwill on 24 December, 2003, 16:48:03

Title: script to block all mp3's and such
Post by: toolmanwill on 24 December, 2003, 16:48:03
i am in dire need for a script either to work inside channelbot when it makes its bad files checks.
or a stand alone bot to block all files i choose,
except for any lossless types of audio and video files for a bootleg live audio and video hub i run. basically i want a main hub with only wav, shn, flac, ape, and other files that may be associated with them(txt, md5, pdf), then my other hub would use normal channel bot to handle porn and such.

thanx to anyone to can help me


Will
Title:
Post by: BlazeXxX on 28 December, 2003, 16:48:18
-- Simple Illegalist v0.1
-- Created by Ptaczek, Jan-3, 2003
-- Searches for specified patterns. Useful for illegal share checking
-- Modified by <[CZ][Cable]MadMax> CZech re(s)PUBlica HUB

BotName = "Kerberos"

Files = {
   ["rape"]="Nesdilej nechutny porno! A ven!!!",
   ["sick"]="Nesdilej nechutny porno! A ven!!!",
   ["preteen"]="U nas zadny pre-teen! A ven!!!",
   ["pre-teen"]="U nas zadny pre-teen! A ven!!!",
   ["vomit"]="Nesdilej svoje zvratky! A ven!!!",
   ["fekal"]="Nesdilej nechutny materialy! A ven!!!",
   ["nazi"]="Nesdilej nazi materialy! A ven!!!",
   ["Program Files"]="Co je nam do Tvych Program Files? A ven!!!",
   ["c:\windows"]="Co je nam do Tvych Woken? A ven!!!",
   ["c:\Winnt"]="Co je nam do Tvych Woken? A ven!!!",
   ["System Volume Information"]="Co je nam do Tvych System Volume Information? A ven!!!",
   ["Recycler"]="Co je nam do Tvych odpadku? A ven!!!",
   ["Recycled"]="Co je nam do Tvych odpadku? A ven!!!",
   [".vob"]="Nesdilej VOB soubory! A ven!!!"
}

Kicked = {}

function NewUserConnected(user)
   if( Kicked[user.sName] == 1 ) then
      Kicked[user.sName] = nil
   end
   for i,v in Files do
      user:SendData("$Search Hub:"..BotName.." F?F?0?1?"..i)
   end
end

function DataArrival(user, data)
   if( strsub(data, 1, 3) == "$SR" ) then
      _,_,nick = strfind( data, "\05(%S*)|$" )
      if( nick == BotName and Kicked[user.sName] == nil ) then
         Kicked[user.sName] = 1
         Reason = FindWhat(data)
         SendToOps(BotName, "*** Uzivatel "..user.sName.." vyhozen. Duvod: "..Reason)
         user:SendPM(BotName, "Byl jsi vyhozen, protoze: "..Reason)
         user:Disconnect()
      end
   end
end

function FindWhat(data)
   for i,v in Files do
      if( strfind(strlower(data), i) ) then
         return v
      end
   end
   return "Other files"
end
Title:
Post by: BlazeXxX on 28 December, 2003, 16:49:20
Just modify the Files = { section to work with ur file types.. Add the formats u don't want to allow in ur hub and thats it..

Try it and see..