Hi!
I know, I probably keep smart side of the forum bussy all the time with my freekin' ideas, but I was drinkin beer and I noticed, that I have to many passive users... Hate that s*it... So I figured out, that it would be cool, if the passive users would have 2 x bigger min share than active users.... Or something like that. Is it possible???
P.S.
I am learning how to make scripts on my own, so maybe like 6 months later I will give you more of my weird ideas already finished... who knows ;)
Hope this is what you need...
minshareforpassive=1 -- min. share for passive users in Gigabytes
--- code below, dont edit
function NewUserConnected(user)
if strfind(user.sMyInfoString,"M:P") then
seeshare(user)
return 1
end
end
function DataArrival(user,data)
if strsub(data, 1, 7) == "$MyINFO" then
if strfind(user.sMyInfoString,"M:P") then
seeshare(user)
return 1
end
end
end
function seeshare(user)
local _,_,shareinbytes=strfind(user.sMyInfoString, "$(%d+)%$")
if shareinbytes user:SendData(" You do not meet the share minimum for passive users. You are being disconnected.")
user:Disconnect()
end
end
It doesnt work :( Thats probably because Im using RoboCop.... Maybe creators of robocop will include this feature in further robocop editions....
haven't tried it but it should work...
-------------------------------------------------
-- Works like this:
-- Enter RC_MinShare for users
-- The Share will double for passive users
-------------------------------------------------
-- By: NightLitch (2004)
-------------------------------------------------
RC_MinShare = "1 GB"
-------------------------------------------------
-- Don't edit --
-------------------------------------------------
sUnit = {}
sUnit["KB"]= 1024
sUnit["MB"]= 1048576
sUnit["GB"]= 1073741824
sUnit["TB"]= 1099511627776
function Main()
if tonumber(RC_MinShare) == nil then s,e,num,cur = string.find(RC_MinShare, "(%d+)%s+(%S+)") RC_MinShare = num * sUnit[cur] end
end
function DataArrival(user,data)
if strsub(data, 1, 7) == "$MyINFO" then
if strfind(data,"M:P") then
local _,_,share = (data, "(%d+)%$%|$")
if tonumber(share) < tonumber(RC_MinShare * 2) then
user:SendData(" You do not meet the minimum share for passive users. You are being disconnected.")
user:Disconnect()
return 1
end
end
end
end
nope, somethings wrong
Syntax error: `)' expected;
last token read: `,' at line 25 in string "-------------------------------------------------
..."
Hi,
Found some bug, try ou this...
-------------------------------------------------
-- Works like this:
-- Enter RC_MinShare for users
-- The Share will double for passive users
-------------------------------------------------
-- By: NightLitch (2004)
-------------------------------------------------
RC_MinShare = "1 GB"
-------------------------------------------------
-- Don't edit --
-------------------------------------------------
sUnit = {}
sUnit["KB"]= 1024
sUnit["MB"]= 1048576
sUnit["GB"]= 1073741824
sUnit["TB"]= 1099511627776
function Main()
if tonumber(RC_MinShare) == nil then s,e,num,cur = strfind(RC_MinShare, "(%d+)%s+(%S+)") RC_MinShare = num * sUnit[cur] end
end
function DataArrival(user,data)
if strsub(data, 1, 7) == "$MyINFO" then
if strfind(data,"M:P") then
local _,_,share = strfind(data, "(%d+)%$%|$")
if tonumber(share) < tonumber(RC_MinShare * 2) then
user:SendData(" You do not meet the minimum share for passive users. You are being disconnected.")
user:Disconnect()
return 1
end
end
end
end
Best regards, nErBoS
nice thanks nErBoS, I forgot to change some parts from Lua 5 to Lua 4. hehe
Hi,
hehe i have notice that. I have to start playing with Lua 5 as well.
Best regards, nErBoS
thanks guys, youre the best ;)
btw, I dont wanna sound like a lamer, but what is lua 5 or lua 4 that you are talking about???
QuoteOriginally posted by enema
btw, I dont wanna sound like a lamer, but what is lua 5 or lua 4 that you are talking about???
different version of Lua, the programming language PtokaX uses...
PtokaX use: Lua 4.0.1
BCDC use: Lua 5.0.2
/NightLitch
Hi.
i like that script and it worked fine, but is there any way to add an option so it doesn't check VIP or OP share.
i was looking script like that for long time and was glad to find it :)
QuoteOriginally posted by Modifier
Hi.
i like that script and it worked fine, but is there any way to add an option so it doesn't check VIP or OP share.
i was looking script like that for long time and was glad to find it :)
to which?
that passive users minshare script, so it doesn't check passive OPs and VIPs share.
I have couple OP who are passive but i don't want that they have to share cause one of them is also hubowner and she want to keep her upload speed free for the hub.
hope you understand, cause my english ain't so good
Could somebody help me for that script ?
Try This.... =)
-------------------------------------------------
-- Works like this:
-- Enter RC_MinShare for users
-- The Share will double for passive users
-------------------------------------------------
-- By: NightLitch (2004)
-- Modded By Madman (2004)
-- Check What Profiles
-- Based On NightLitch's Ultimate Client Check
-------------------------------------------------
RC_MinShare = "1 GB"
-------------------------------------------------
-- Check What Profiles?
-------------------------------------------------
User = 1
Reg = 1
Vip = 0
Op = 0
Master = 0
-------------------------------------------------
-- Don't edit --
-------------------------------------------------
sUnit = {}
sUnit["KB"]= 1024
sUnit["MB"]= 1048576
sUnit["GB"]= 1073741824
sUnit["TB"]= 1099511627776
Profiles = {
[-1] = 1, -- regular user
[3] = 2, -- registered user
[2] = 3, -- vip user
[1] = 4, -- operator
[0] = 5, -- master/admin
}
Check = {
[1] = {[1] = User},
[2] = {[1] = Reg},
[3] = {[1] = Vip},
[4] = {[1] = Op},
[5] = {[1] = Master},
}
function Main()
if tonumber(RC_MinShare) == nil then s,e,num,cur = strfind(RC_MinShare, "(%d+)%s+(%S+)") RC_MinShare = num * sUnit[cur] end
end
function DataArrival(user,data)
if Check[Profiles[user.iProfile] ][1]==1 then
if strsub(data, 1, 7) == "$MyINFO" then
if strfind(data,"M:P") then
local _,_,share = strfind(data, "(%d+)%$%|$")
if tonumber(share) < tonumber(RC_MinShare * 2) then
user:SendData(" You do not meet the minimum share for passive users. You are being disconnected.")
user:Disconnect()
return 1
end
end
end
end
end
Thank you for that. :)
It gives me some error when it has been on for a couple of minutes ?
Syntax error: table index is nil
stack traceback:
1: function `DataArrival' at line 50
I know what makes the error...
Do you run Robocop or some other big bot?
if not RC then open my the Profiles.dat in Notepad and copy everything in it...
Then i can fix the error =)
i have RC9.0C running, is that what cause that error ?
Kind of...
I Added The Profiles
NetFounder and Moderator
-------------------------------------------------
-- Works like this:
-- Enter RC_MinShare for users
-- The Share will double for passive users
-------------------------------------------------
-- By: NightLitch (2004)
-- Modded By Madman (2004)
-- Check What Profiles
-- Based On NightLitch's Ultimate Client Check
-- Added RC Profiles
-------------------------------------------------
RC_MinShare = "1 GB"
-------------------------------------------------
-- Check What Profiles?
-------------------------------------------------
User = 1
Reg = 1
Vip = 0
Op = 0
Master = 0
Moderator = 0
NetFounder = 0
-------------------------------------------------
-- Don't edit --
-------------------------------------------------
sUnit = {}
sUnit["KB"]= 1024
sUnit["MB"]= 1048576
sUnit["GB"]= 1073741824
sUnit["TB"]= 1099511627776
Profiles = {
[-1] = 1, -- regular user
[3] = 2, -- registered user
[2] = 3, -- vip user
[1] = 4, -- operator
[0] = 5, -- master/admin
[4] = 6, -- Moderator
[5] = 7, -- NetFounder
}
Check = {
[1] = {[1] = User},
[2] = {[1] = Reg},
[3] = {[1] = Vip},
[4] = {[1] = Op},
[5] = {[1] = Master},
[6] = {[1] = Moderator},
[7] = {[1] = NetFounder},
}
function Main()
if tonumber(RC_MinShare) == nil then s,e,num,cur = strfind(RC_MinShare, "(%d+)%s+(%S+)") RC_MinShare = num * sUnit[cur] end
end
function DataArrival(user,data)
if Check[Profiles[user.iProfile] ][1]==1 then
if strsub(data, 1, 7) == "$MyINFO" then
if strfind(data,"M:P") then
local _,_,share = strfind(data, "(%d+)%$%|$")
if tonumber(share) < tonumber(RC_MinShare * 2) then
user:SendData(" You do not meet the minimum share for passive users. You are being disconnected.")
user:Disconnect()
return 1
end
end
end
end
end
Thanks, i'll test it now