i want a script which records the peaks of the hub
+peaks
=-=-=-=-= Right Now =-=-=-=-=
- Users : 65
- OPs : 2
- Sharing : 1.82 TiB (2001290665599 bytes)
=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=
=-=-=-=-= This Session =-=-=-=-=
- Uptime : 1 hours, 41 minutes
- Peak users : 71
- Peak OPs : 3
- Peak shared : 2.07 TiB (2279051135628 bytes)
=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=
=-=-=-=-= All-Time Peaks =-=-=-=-=
- Combined uptime of all sessions since Thursday, July 14, 2005 : 1 days, 5 hours, 10 minutes
- Peak users : 145
- Peak OPs : 7
- Peak shared : 3.73 TiB (3003427593145 bytes)
=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=
this script is available in DDCH (DEV DIRECT CONNECT HUB) . if anyone can convert it into .lua then plzzz go a ahead. i am posting the script which is available for DDCH (.script format)
True, this script could be realy nice, with the ideas of kEwL
+ Few requests:
1) A timer to send this list of records in main chat with possibility to set the time of timer by cmd and RC.
2) Cmd + RC to switch between pm or main chat advertising or disable
2) In more of the request done add another record: the best sharer, with date,nick,and share size of this peak user.
3) RC for all commands
4) Possibility to send the list of records on login by pm or main chat
I hope that a good scripter could make this perfectly. Thx to this one :)
i would like to have such a script because this script not all records all time peaks but also records sessions peaks and current peaks. it would be great if someone make an attempt to create such a script for lua 5.1
Here is start for it, this only saves and updates all time records ::)
--[[
]]--
Records = {}
local f,e = io.open("Record.tbl", "a+" )
if f then
f:write("" )
f:close()
end
dofile("Record.tbl")
Main =function()
SetTimer(10*1000)
StartTimer()
end
OnTimer = function()
if Records.share then -- if table found
if tonumber(Records.share or 0) < frmHub:GetCurrentShareAmount() then -- is current total share bigger than in table
Records["share"] = frmHub:GetCurrentShareAmount() -- if it was we write it
SaveToFile("Record.tbl",Records, "Records") -- and save it
end
if tonumber(Records.users or 0) < frmHub:GetUsersCount() then -- is current usercount bigger than in table
Records["users"] = frmHub:GetUsersCount() -- if it was we write it
SaveToFile("Record.tbl",Records, "Records") -- and save it
end
if tonumber(Records.uptime or 0) < frmHub:GetUpTime() then -- is current uptime bigger than in table
Records["uptime"] = frmHub:GetUpTime() -- if it was we write it
SaveToFile("Record.tbl",Records, "Records") -- and save it
end
else -- if table was not found
Records = {uptime = frmHub:GetUpTime(),share = frmHub:GetCurrentShareAmount(),users = frmHub:GetUsersCount()} -- we do table
SaveToFile("Record.tbl",Records, "Records") -- and save it
end
collectgarbage("collect")
end
Serialize = function(tTable,sTableName,hFile,sTab)
sTab = sTab or ""
hFile:write(sTab..sTableName.." = {\n")
for key,value in pairs(tTable) do
if (type(value) ~= "function") then
local sKey = (type(key) == "string") and string.format("[%q]",key) or string.format("[%d]",key)
if(type(value) == "table") then
Serialize(value,sKey,hFile,sTab.."\t")
else
local sValue = (type(value) == "string") and string.format("%q",value) or tostring(value)
hFile:write(sTab.."\t"..sKey.." = "..sValue)
end
hFile:write(",\n")
end
end
hFile:write(sTab.."}")
end
SaveToFile = function(file,table,tablename)
local hFile = io.open(file,"w+")
Serialize(table,tablename,hFile)
hFile:close()
end
good attempt C??o?y?e, can someone try to complete this script.