peak script
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

peak script

Started by kEwL, 14 July, 2005, 18:11:30

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

kEwL

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)
   =-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=

Yahoo

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"

Stormbringer

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 :)

Yahoo

#3
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
"BoRN FIGhTEr"

Cêñoßy†ê

Here is start for it, this only saves and updates all time records ::)

Code: lua
--[[

]]--

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™ 2nd Generation v. 1.9

Yahoo

good attempt C??o?y?e, can someone try to complete this script.
"BoRN FIGhTEr"

SMF spam blocked by CleanTalk