PtokaX forum

Archive => Archived 5.1 boards => Request for scripts => Topic started by: achiever on 29 November, 2006, 10:10:46

Title: average users
Post by: achiever on 29 November, 2006, 10:10:46
hi,

I m in need of script which shows average users of the hub,by that i mean that if yesterdays max. users was 100 and todays max. users is 120 then after 12 pm at nite it should show :-

the average users of the hub is 110 per day

and also the hub daily average share, i.e it should record everydays max share n show the mean of it e.g.
if yesterdays max share was 4.0 TB n todays max share gets to 6.0 TB then it should show :-

the average max share of this hub is 5.0 TB

also that these messages should come at the login of every user for him.

thks for help  :)

achiever
Title: Re: average users
Post by: Thor on 29 November, 2006, 10:22:24
In Snooze's DiXBoT is this a feature, so I asked him to split it because that is a compiled bot. He said he will do it ;)
Title: Re: average users
Post by: Snooze on 29 November, 2006, 21:01:23
It wont do all of that though it has the info needed to do it..
I'll try to get it done this weekend :)

Thanks,
Snooze
Title: Re: average users
Post by: achiever on 01 December, 2006, 06:54:56
thks ppl,

thks a lot  :)

achiever
Title: Re: average users
Post by: achiever on 08 December, 2006, 11:01:37
Quote from: Snooze on 29 November, 2006, 21:01:23
It wont do all of that though it has the info needed to do it..
I'll try to get it done this weekend :)

hi,
i m sorry for being impatient, but i was really looking forward to this script.
can u plzz help.

thanks,

achiever
Title: Re: average users
Post by: Snooze on 08 December, 2006, 18:24:26
Sorry ... Work + my own script is really eating away at my time ..

Perhaps you could check my demohub to make sure it's infact doing what you had in mind ..

snooze.no-ip.com:1209


You can send me a PM from there and I'll try to find time to work on it..


Thanks,
Snooze
Title: Re: average users
Post by: achiever on 09 May, 2007, 07:02:27
hi,

i had this script which should count the average-max share and average-peak users of the hub. but it just shows me the current users and share of the hub.

tAvg = {
[1] = {
["Share"] = 0,
["User"] = 0,
},
[2] = {
["Share"] = 0,
["User"] = 0,
},
[3] = {
["Share"] = 0,
["User"] = 0,
},
[4] = {
["Share"] = 0,
["User"] = 0,
},
[5] = {
["Share"] = 0,
["User"] = 0,
},
[6] = {
["Share"] = 0,
["User"] = 0,
},
[0] = {
["Share"] = 0,
["User"] = 0,
},
}

NewUserConnected = function(user,data)
if frmHub:GetUsersCount()+ 1 > tAvg[tonumber(os.date("%w"))].User then
tAvg[tonumber(os.date("%w"))].User = frmHub:GetUsersCount() + 1
end
if frmHub:GetCurrentShareAmount() > tAvg[tonumber(os.date("%w"))].Share then
tAvg[tonumber(os.date("%w"))].Share = frmHub:GetCurrentShareAmount()
end
user:SendData("Fusion", "*** The average UsersPeak of the hub is "..string.format("%.0f",doAvgUserCal()/doUptimeCal()).." per day. The average SharePeak of this hub is "..doShareCal(doAvgShareCal()/doUptimeCal())..".")

end

OpConnected = NewUserConnected

doAvgShareCal = function()
local sShare = 0
for i = 0, table.getn(tAvg) do
sShare = sShare + tAvg[i].Share
end
if sShare ~= 0 then
return sShare
else
sShare = 1
return sShare
end
end

doAvgUserCal = function()
local sUser = 0
for i = 0, table.getn(tAvg) do
sUser = sUser + tAvg[i].User
end
if sUser ~= 0 then
return sUser
else
sUser = 1
return sUser
end
end

doUptimeCal = function()
local sUpDays = 0
if frmHub:GetUpTime()/86400 < 1 then
sUpDays = 1
else
sUpDays = tonumber(string.format("%.0f",frmHub:GetUpTime()/86400))
end
return sUpDays
end

doShareCal = function(nShare)
local tCal = {[1] = "B",[2] = "KiB",[3] = "MiB",[4] = "GiB",[5] = "TiB",["Count"] = 0,["Share"] = 0,}
if nShare ~= 0 and nShare ~= nil then
local sShare = nShare
while sShare >= 1 do
tCal.Share = sShare
sShare = sShare / 1024
tCal.Count = tCal.Count + 1
end
if tCal.Count > 1 then
uShare = string.format("%.2f",(tCal.Share)).." "..tCal[tCal.Count]
return uShare
else
uShare = string.format("%.2f",(tCal.Share)).." B"
return uShare
end
else
uShare = "0 B"
return uShare
end
end


so can some 1 help me modify the script.
thks,
achiever

if yesterdays max. users was 100 and todays max. users is 120 then after 12 pm at nite it should show :-

the average online users per day is 110

and also the hub daily average share, i.e it should record everydays max share n show the mean of it e.g.
if yesterdays max share was 4.0 TB n todays max share gets to 6.0 TB then it should show :-

the average-max share is 5.0 TB

also that these messages should come at the login of every user for him.


can some 1 plzz help me and modify this script to show some thing like that.
just 1 more addition

can it also find  Average registrations per day

i m need of it  :(
plzzzz some 1 make this script,

thks,
Title: Re: average users
Post by: achiever on 13 May, 2007, 17:30:03
thaaaaaaaaaaankkksss a ton for this help
hi mutor,
sorry for late report, but i think this script is just recording the all time max and is not taking its mean for everday of ne thing ie share, members or registration
QuoteAverage Daily Stats For Fusion Hub:  Users = [ 121 ]   Hubshare = [ 5.56 TB ]   Registrations = [ 32 ]

this the stats it shows today, yesterday the stats were users = 114 and registrations = 24

can u plzz make it shuch that it records the max of each day and calculates and shows its mean

thks
Title: Re: average users
Post by: achiever on 14 May, 2007, 09:14:55
working good tkhs for the quick response.
thanks