determinate determinate

Author Topic: peak script  (Read 1422 times)

0 Members and 1 Guest are viewing this topic.

Offline kEwL

  • Member
  • ***
  • Posts: 27
  • Karma: +1/-0
peak script
« on: July 14, 2005, 06:11:30 pm »
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)
   =-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=

Offline Yahoo

  • Triple Ace
  • **
  • Posts: 225
  • Karma: +32/-14
  • People Say "I Dont Know English"
    • Yahoo
Re: peak script
« Reply #1 on: February 15, 2007, 02:17:04 pm »
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)
"BoRN FIGhTEr"

Offline Stormbringer

  • Fulll Member
  • ****
  • Posts: 73
  • Karma: +27/-17
peak script
« Reply #2 on: February 15, 2007, 02:55:49 pm »
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 :)

Offline Yahoo

  • Triple Ace
  • **
  • Posts: 225
  • Karma: +32/-14
  • People Say "I Dont Know English"
    • Yahoo
Re: peak script
« Reply #3 on: March 22, 2007, 06:39:09 pm »
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
« Last Edit: March 22, 2007, 06:45:30 pm by Yahoo »
"BoRN FIGhTEr"

Offline Cêñoßy†ê

  • Scripter
  • Triple Ace
  • ******
  • Posts: 179
  • Karma: +29/-3
Re: peak script
« Reply #4 on: March 22, 2007, 06:56:26 pm »
Here is start for it, this only saves and updates all time records ::)

Code: (lua) [Select]
--[[

]]--

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
***********************
Powered By Leviathan v? ;)[KvN]
***********************

Offline Yahoo

  • Triple Ace
  • **
  • Posts: 225
  • Karma: +32/-14
  • People Say "I Dont Know English"
    • Yahoo
Re: peak script
« Reply #5 on: March 23, 2007, 05:10:13 am »
good attempt Cêñoßy†e, can someone try to complete this script.
"BoRN FIGhTEr"

 

determinate determinate
guestbook