PtokaX forum

Archive => Archived 5.1 boards => Finished Scripts => Topic started by: 6Marilyn6Manson6 on 23 March, 2006, 20:14:57

Title: AntiLeecherBlocker
Post by: 6Marilyn6Manson6 on 23 March, 2006, 20:14:57
--// Small script AntiLeecherBlocker made by 6Marilyn6Manson6 23/03/2006
--// Change version command by 6Marilyn6Manson6 21/04/2006
--// Added DoShareUnits function by 6Marilyn6Manson6 28/04/2006
--// Change small by 6Marilyn6Manson6 28/04/2006
--// Fixed small error by 6Marilyn6Manson6 28/04/2006
BotName = "[ITA]Annihilator" --frmHub:GetHubBotName(),
Version = "0.1"
Prefix = "!" --! + # ? -
------------------------------------------------------
BlockProfiles={
[0]=1,  -- Profile #0 (Registered)
[1]=1,  -- Profile #1 (VIP)
[2]=0,  -- Profile #2 (Operator)
[3]=0,  -- Profile #3 (Moderator)
[4]=0,  -- Profile #4 (Master)
[5]=0,  -- Profile #5 (Netfounder)
[-1]=1, -- Profile #-1 (Unregistered)
}
------------------------------------------------------
tImmune = {
["6Marilyn6Manson6"] = 1,
["[ITA]6Marilyn6Manson6"] = 1,
}
------------------------------------------------------
KiB = 1024
MiB = 1024*1024
GiB = 1024*1024*1024
TiB = 1024*1024*1024*1024
------------------------------------------------------
------------------------------------------------------
ActiveMinShare = 400*GiB
PassiveMinShare = 800*GiB
MaxHubs = 20
MaxSlots = 20
MaxNormalHubs = 10
MaxRegHubs = 10
------------------------------------------------------
Main = function()
if BotName ~= frmHub:GetHubBotName() then
frmHub:RegBot(BotName, 1, "AntiLeecherBlocker "..Version.."", "")
end
end
------------------------------------------------------
ChatArrival = function(usr,data)
data=string.sub(data,1,string.len(data)-1)
s,e,cmd = string.find(data, "%b<>%s+(%S+)")
if usr.bOperator then
if (string.lower(cmd) == Prefix.."version") then
SendToOps(BotName,"This Script Is: AntiLeecherBlocker "..Version.." written by 6Marilyn6Manson6")
return 1
end
end
end
------------------------------------------------------
DoShareUnits = function(intSize)
if intSize ~= 0 then
local tUnits = { "Bytes", "KiB", "MiB", "GiB", "TiB" }
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.3f %s",intSize, sUnits);
else
return "0 Bytes"
end
end
------------------------------------------------------
ConnectToMeArrival = function(usr,data)
if not tImmune[usr.sName] then
if BlockProfiles[usr.iProfile] == 1 then
if usr.bActive and usr.iShareSize < ActiveMinShare then
return usr:SendPM(BotName,"*** Attention! You Not Are Good For Download Here ;). You are in Active mode and you Have: "..DoShareUnits(usr.iShareSize)..", minimum is: "..DoShareUnits(ActiveMinShare)..". Check It Please ;)"),1
elseif not usr.bActive and usr.iShareSize < PassiveMinShare then
return usr:SendPM(BotName,"*** Attention! You Not Are Good For Download Here ;). You are in Passive mode and you Have: "..DoShareUnits(usr.iShareSize)..", minimum is: "..DoShareUnits(PassiveMinShare)..". Check It Please ;)"),1
elseif usr.iHubs > MaxHubs then
return usr:SendPM(BotName,"*** Attention! You Not Are Good For Download Here ;). You Have: "..usr.iHubs.." OPen HuBs, maximum is: "..MaxHubs.." .Check It Please ;)"),1
elseif usr.iSlots > MaxSlots then
return usr:SendPM(BotName,"*** Attention! You Not Are Good For Download Here ;). You Have: "..usr.iSlots.." OPen Slots, maximum is: "..MaxSlots.." .Check It Please ;)"),1
elseif usr.iNormalHubs > MaxNormalHubs then
return usr:SendPM(BotName,"*** Attention! You Not Are Good For Download Here ;). You Have: "..usr.iNormalHubs.." OPen Normal HuBs, maximum is: "..MaxNormalHubs.." .Check It Please ;)"),1
elseif usr.iRegHubs > MaxRegHubs then
return usr:SendPM(BotName,"*** Attention! You Not Are Good For Download Here ;). You Have: "..usr.iRegHubs.." OPen Registered/Vip HuBs, maximum is: "..MaxRegHubs.." .Check It Please ;)"),1
end
end
end
end

SearchArrival = function(usr,data)
if not tImmune[usr.sName] then
if BlockProfiles[usr.iProfile] == 1 then
if usr.bActive and usr.iShareSize < ActiveMinShare then
return usr:SendPM(BotName,"*** Attention! You Not Are Good For Search Here ;). You are in Active mode and you Have: "..DoShareUnits(usr.iShareSize)..", minimum for use Search is: "..DoShareUnits(ActiveMinShare)..". Check It Please ;)"),1
elseif not usr.bActive and usr.iShareSize < PassiveMinShare then
return usr:SendPM(BotName,"*** Attention! You Not Are Good For Search Here ;). You are in Passive mode and you Have: "..DoShareUnits(usr.iShareSize)..", minimum for use Search is: "..DoShareUnits(PassiveMinShare)..". Check It Please ;)"),1
end
end
end
end
------------------------------------------------------
RevConnectToMeArrival = ConnectToMeArrival
MultiConnectToMeArrival = ConnectToMeArrival
--// 6Marilyn6Manson6
Title: Re: AntiLeecherBlocker
Post by: 6Marilyn6Manson6 on 28 April, 2006, 14:24:24
First post update with most change :)
Title: Re: AntiLeecherBlocker
Post by: Alexinno on 16 June, 2006, 07:33:57
nice script 6Marilyn6Manson6
Title: Re: AntiLeecherBlocker
Post by: 6Marilyn6Manson6 on 16 June, 2006, 07:37:32
Quote from: Alexinno on 16 June, 2006, 07:33:57
nice script 6Marilyn6Manson6

Thank you. Im back yesterday from Milan and today I work for other important update ;). Last versione is 1.22 and you can download it from this thread:

http://forum.ptokax.org/index.php?topic=6050.0

C ya ;)