Author Topic: peak script  (Read 4777 times)

0 Members and 1 Guest are viewing this topic.

Offline kEwL

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

PtokaX forum

peak script
« on: 14 July, 2005, 18:11:30 »

Offline Yahoo

  • Triple Ace
  • **
  • Posts: 225
  • Karma: +32/-14
  • People Say "I Dont Know English"
    • Yahoo
Re: peak script
« Reply #1 on: 15 February, 2007, 14:17:04 »
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: 15 February, 2007, 14:55:49 »
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: 22 March, 2007, 18:39:09 »
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: 22 March, 2007, 18:45:30 by Yahoo »
"BoRN FIGhTEr"

Offline Cêñoßy†ê

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

Code: Lua
  1. --[[
  2.  
  3. ]]--
  4.  
  5. Records = {}
  6. local f,e = io.open("Record.tbl", "a+" )
  7. if f then
  8.         f:write("" )
  9.         f:close()
  10. end
  11. dofile("Record.tbl")
  12.  
  13. Main =function()
  14.         SetTimer(10*1000)
  15.         StartTimer()
  16. end
  17.  
  18. OnTimer = function()
  19.         if Records.share then   -- if table found
  20.                 if tonumber(Records.share or 0) < frmHub:GetCurrentShareAmount() then   -- is current total share bigger than in table
  21.                         Records["share"] = frmHub:GetCurrentShareAmount()       -- if it was we write it
  22.                         SaveToFile("Record.tbl",Records, "Records")     -- and save it
  23.                 end
  24.                 if tonumber(Records.users or 0) < frmHub:GetUsersCount() then   -- is current usercount bigger than in table
  25.                         Records["users"] = frmHub:GetUsersCount()       -- if it was we write it
  26.                         SaveToFile("Record.tbl",Records, "Records")     -- and save it
  27.                 end
  28.                 if tonumber(Records.uptime or 0) < frmHub:GetUpTime() then      -- is current uptime bigger than in table
  29.                         Records["uptime"] = frmHub:GetUpTime()  -- if it was we write it
  30.                         SaveToFile("Record.tbl",Records, "Records")     -- and save it
  31.                 end
  32.         else    -- if table was not found
  33.                 Records = {uptime = frmHub:GetUpTime(),share = frmHub:GetCurrentShareAmount(),users = frmHub:GetUsersCount()}   -- we do table
  34.                 SaveToFile("Record.tbl",Records, "Records")     -- and save it
  35.         end
  36.         collectgarbage("collect")
  37. end
  38.  
  39. Serialize = function(tTable,sTableName,hFile,sTab)
  40.         sTab = sTab or ""
  41.         hFile:write(sTab..sTableName.." = {\n")
  42.         for key,value in pairs(tTable) do
  43.                 if (type(value) ~= "function") then
  44.                         local sKey = (type(key) == "string") and string.format("[%q]",key) or string.format("[%d]",key)
  45.                         if(type(value) == "table") then
  46.                                 Serialize(value,sKey,hFile,sTab.."\t")
  47.                         else
  48.                                 local sValue = (type(value) == "string") and string.format("%q",value) or tostring(value)
  49.                                 hFile:write(sTab.."\t"..sKey.." = "..sValue)
  50.                         end
  51.                         hFile:write(",\n")
  52.                 end
  53.         end
  54.         hFile:write(sTab.."}")
  55. end
  56.  
  57. SaveToFile = function(file,table,tablename)
  58.         local hFile = io.open(file,"w+")
  59.         Serialize(table,tablename,hFile)
  60.         hFile:close()
  61. end
***********************
Powered By Leviathan v5.2 ;)

Offline Yahoo

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

PtokaX forum

Re: peak script
« Reply #5 on: 23 March, 2007, 05:10:13 »