PtokaX forum

Archive => Archived 5.1 boards => Help with scripts => Topic started by: ?[-?Genius?-]? on 01 April, 2007, 22:40:15

Title: Share/slots/hubs Bot
Post by: ?[-?Genius?-]? on 01 April, 2007, 22:40:15
Hi ppl

Its possible change this script for Redirect user if dont have minims share/slots/hub?

Script Cod

sBot= "[!???]??vdRip?"

kb = 1024
mb = 1024 ^ 2
gb = 1024 ^ 3

--=[ Configura??o ]=-

MinShare = 10240*mb -- in MBs
MinSlots = 3
MaxSlots = 5
--[ MaxHubs = 10 ]--

--=[ User inumes ao Bot ]=-

tImmune = {  ["[TvT]VeroN"] = 1, ["[CV]dream[er]"] = 1, ["[NT]mmmm@work"] = 1, ["[VIP]HELDER-TUGA"] = 1, ["[NT]saburu"] = 1, ["[VDF]NKS"] = 1, ["[NT]SpyFakes"] = 1, ["[SP]reg"] = 1, ["[SP]C???????-x"] = 1, ["[SP]Guitas"] = 1, ["[NT]monika"] = 1, ["[NT]maryjoint"] = 1, ["[SP]Cypress"] = 1, ["[NV]Bills"] = 1,  ["[SP]Red"] = 1, ["[SP]estrela_cadente"] = 1, ["[NT]SempreFiel"] = 1, ["[NT]Chucky"] = 1, ["[NT]Nitinha"] = 1, ["[NT]soniamartins"] = 1, ["[SP]user"] = 1, ["[SP]??ee?"] = 1, ["[SP]KillerIsDead"] = 1, ["[SP]Cyber_Cube?"] = 1, ["[SP]-?DiOsPiRo?-"] = 1, ["[SP]????????r??"] = 1, ["[SP]Nizi_Moon"] = 1, ["[NT]Algaman"] = 1, ["[SP]Nezinha"] = 1, ["[SP]__MARS__"] = 1,} --##  -Operators Immune List (["nick"] = 1) ##--

--=[ C?digo ]=-

DoShareUnits = function(intSize)
if 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 "nothing"
end
end

ConnectToMeArrival = function(curUser,data)
if not curUser.bOperator then
if not tImmune[curUser.sName] then
if curUser.iShareSize < MinShare then
return curUser:SendPM(sBot, " - = [ Boas, tens pouca partilha. O minimo ? de [ "..DoShareUnits(MinShare).." ]. Abra o seu espirito de partilha, e d? mais algum contributo. At? l? ficar? impossibilitado de efectuar downloads. ] = -"),1
elseif curUser.iSlots < MinSlots then
return curUser:SendPM(sBot, " - = [ Boas, tens poucas slots abertas. O minimo ? de "..MinSlots.." slots. Abra 3 a 5 slots para puder efectuar downloads no Hub. ] = -"),1
elseif curUser.iSlots > MaxSlots then
return curUser:SendPM(sBot, " - = [ Boas, tens muitas slots abertas. O m?ximo ? de "..MaxSlots.." slots. Abra 3 a 5 slots para puder efectuar downloads no Hub. ] = -"),1
--[ elseif (curUser.iNormalHubs + curUser.iRegHubs) > MaxHubs then ]--
--[ return curUser:SendPM(sBot, " - = [ Boas, t?s ligado a demasiados Hubs. O limite maximo ? de "..MaxHubs..". PF desligue-se de alguns Hubs. Vai ser redirectado ... ] = -"),1 ]--
end
end
end
end

RevConnectToMeArrival = ConnectToMeArrival
Title: Re: Share/slots/hubs Bot
Post by: Cêñoßy†ê on 01 April, 2007, 23:03:41
here you go  ;D


sBot= "[!???]??vdRip?"

kb = 1024
mb = 1024 ^ 2
gb = 1024 ^ 3

--=[ Configura??o ]=-

MinShare = 10240*mb -- in MBs
MinSlots = 3
MaxSlots = 5
check = { -- should script check profile (1/yes  0/no)
[-1] = 1, -- unregistered
[0] = 1, -- master
[1] = 1, -- operator
[2] = 1, -- vip
[3] = 1, -- reg
[4] = 1, -- moderator
[5] = 1, -- netfounder
[6] = 1, -- owner
}

--=[ User inumes ao Bot ]=-

tImmune = {  ["[TvT]VeroN"] = 1, ["[CV]dream[er]"] = 1, ["[NT]mmmm@work"] = 1, ["[VIP]HELDER-TUGA"] = 1, ["[NT]saburu"] = 1, ["[VDF]NKS"] = 1, ["[NT]SpyFakes"] = 1, ["[SP]reg"] = 1, ["[SP]C???????-x"] = 1, ["[SP]Guitas"] = 1, ["[NT]monika"] = 1, ["[NT]maryjoint"] = 1, ["[SP]Cypress"] = 1, ["[NV]Bills"] = 1,  ["[SP]Red"] = 1, ["[SP]estrela_cadente"] = 1, ["[NT]SempreFiel"] = 1, ["[NT]Chucky"] = 1, ["[NT]Nitinha"] = 1, ["[NT]soniamartins"] = 1, ["[SP]user"] = 1, ["[SP]??ee?"] = 1, ["[SP]KillerIsDead"] = 1, ["[SP]Cyber_Cube?"] = 1, ["[SP]-?DiOsPiRo?-"] = 1, ["[SP]????????r??"] = 1, ["[SP]Nizi_Moon"] = 1, ["[NT]Algaman"] = 1, ["[SP]Nezinha"] = 1, ["[SP]__MARS__"] = 1,} --##  -Operators Immune List (["nick"] = 1) ##--

--=[ C?digo ]=-

DoShareUnits = function(intSize)
if 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 "nothing"
end
end

MyINFOArrival = function(curUser,data)
if check[curUser.iProfile] == 1 and not tImmune[curUser.sName] then
if MinShare > 0 and curUser.iShareSize < MinShare then
curUser:Redirect(frmHub:GetRedirectAddress()," - = [ Boas, tens pouca partilha. O minimo ? de [ "..DoShareUnits(MinShare).." ]. Abra o seu espirito de partilha, e d? mais algum contributo. At? l? ficar? impossibilitado de efectuar downloads. ] = -")
end
if MinSlots > 0 and curUser.iSlots < MinSlots then
curUser:Redirect(frmHub:GetRedirectAddress()," - = [ Boas, tens poucas slots abertas. O minimo ? de "..MinSlots.." slots. Abra 3 a 5 slots para puder efectuar downloads no Hub. ] = -")
end
if MaxSlots > 0 and curUser.iSlots > MaxSlots then
curUser:Redirect(frmHub:GetRedirectAddress()," - = [ Boas, tens muitas slots abertas. O m?ximo ? de "..MaxSlots.." slots. Abra 3 a 5 slots para puder efectuar downloads no Hub. ] = -")
end
end
end
Title: Re: Share/slots/hubs Bot
Post by: ?[-?Genius?-]? on 01 April, 2007, 23:17:32
Hi

Sory but script dont work- I think its my problem. Its possible send script for my in normal Cod?

Sory about this
Title: Re: Share/slots/hubs Bot
Post by: Cêñoßy†ê on 01 April, 2007, 23:27:39
Quote from: ?[-?Genius?-]? on 01 April, 2007, 23:17:32
Hi

Sory but script dont work- I think its my problem. Its possible send script for my in normal Cod?

Sory about this
meaned that i should post it this way ??
did small changes to it allso
Title: Re: Share/slots/hubs Bot
Post by: ?[-?Genius?-]? on 01 April, 2007, 23:55:22
Hi Again

Sory Im noob in scripts :S

The script send this error

[22:48] Syntax ...+ [Extras]\Hub DvdRip Mar?o 2007\DvdRip\scripts\[DvdRip HUB] [Share].lua:51: '<eof>' expected near 'end'
Title: Re: Share/slots/hubs Bot
Post by: Cêñoßy†ê on 02 April, 2007, 00:22:36
sorry.. my mistake.. .bug fixed  ;D
Title: Re: Share/slots/hubs Bot
Post by: ?[-?Genius?-]? on 04 April, 2007, 00:25:46
Hi

The script dont Work. E join in the hub whit 1 slot open and bot dont block my downs :S
Title: Re: Share/slots/hubs Bot
Post by: Cêñoßy†ê on 04 April, 2007, 09:00:28
Quote from: ?[-?Genius?-]? on 04 April, 2007, 00:25:46
Hi

The script dont Work. E join in the hub whit 1 slot open and bot dont block my downs :S


post above updated with option to choose what profiles it checks and detection is now from myinfoarrival
Title: Re: Share/slots/hubs Bot
Post by: ?[-?Genius?-]? on 10 April, 2007, 01:09:28
Tankx C??o?y??

Script work 5 stars :)
Title: Re: Share/slots/hubs Bot
Post by: ExtreeM on 16 December, 2007, 23:11:23
is it possible to edit the script so that i can set each profile ( reg,user,vip,owner etc) to have max slots/hubs for each??