Hub statistic.
 

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

Hub statistic.

Started by NemeziS, 28 December, 2004, 01:46:39

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

NemeziS

Hello, guys!

I'm doing my own hubstat script now. So I have a little problem with counting online/offline/registered users.
The problem root is: I have a lot of different profiles.
I need only info about:

1) Operators onine
2) Vips online
3) Regs online
4) Unreg users online
5) Total users online
6) Operators offline
7) Vips offline
8) Regs offline
9) How many Ops registered
10) How many Vips registered
11) How many users registered

Can someone help me?  :))

Best regards,
NemeziS
--LUA forever! =)

NemeziS

Thanx, Mutor!

Great function!

But I also need counting unregged (who not belong to any profile and not simply regged) users on my hub.

And the word "REG" is sometimes not correct, because users that belong to different profile are regged too!

I thought it can count all "regged" users.
Have you any idea about this?  :)

Best regards,
NemeziS
--LUA forever! =)

[_XStaTiC_]

#2
Ok I don't know if this is right, but it works good for me. It counts the unregged users

--AdTimer 1.1
--
--by Mutor
--Optimized by Optimus, thx
--
--Yet another Hub Advert script
--Sends hub Advert on timer or by command
--
--
--User Settings-------------------------------------------------------------------------------------
bot = "HubAd"						-- Name for bot
mins = 180 						-- Interval [in minutes] between Ads
Hubaddy = "yourhub.no-ip.com" 				-- Duh?
HubOwner = "Mutor"					-- Duh?
Prefix = "+"						-- Set Command Prefix
AdComm = "ad"						-- Command to send Ad immediately
TZone = " -5 GMT [EST]"					-- Time Zone hub resides in
HubMsg1 = ""						-- Additional notices/info to be sent with ad
HubMsg2 = ""						-- Additional notices/info to be sent with ad
HubMsg3 = ""						-- Additional notices/info to be sent with ad
unregs = frmHub:GetUsersCount()                         -- count unregged users
--End User Settings----------------------------------------------------------------------------------

function Main() 
	SetTimer(mins*60000) 
	StartTimer() 
end 

function DataArrival(user, data)
	s,e,cmd = strfind(data, "%b<>%s+(%S+)(%S+)")
	if (cmd==Prefix..AdComm) and user.bOperator then
		OnTimer()  
	end
end

function OnTimer()
	local tmp
	tmp = "\r\n\r\n\t---<>-------------------------------------------------------------------------------------<>---\r\n"  
	tmp = tmp.."\t[ "..frmHub:GetHubName().." ]\r\n" 
	tmp = tmp.."\t---<>-------------------------------------------------------------------------------------<>---\r\n" 
	tmp = tmp.."\tHub Name: \t"..frmHub:GetHubName().."\r\n"
	tmp = tmp.."\tHub Owner: \t"..HubOwner.."\r\n" 
	tmp = tmp.."\tHub Addy: \t"..Hubaddy.."\r\n" 
	tmp = tmp.."\tHub Time: \t( "..date("%B %d %Y %X ").." ) - "..TZone .."\r\n"
	tmp = tmp.."\tHub Desc: \t"..frmHub:GetHubDescr().."\r\n" 
	tmp = tmp.."\tRedirect To: \t"..frmHub:GetRedirectAddress().."\r\n"
	tmp = tmp.."\tReg Server: \t"..frmHub:GetRegServer().."\r\n"  
	tmp = tmp.."\tRedirect All: \t"..RedirAll().."\r\n" 
	tmp = tmp.."\tRedirect Full: \t"..RedirFull().."\r\n" 
	tmp = tmp.."\tMax Users: \t"..frmHub:GetMaxUsers().."\r\n" 
	tmp = tmp.."\tMin Share: \t"..format("%.2f GB",frmHub:GetMinShare()/1024).."\r\n"
	tmp = tmp.."\tHub Share: \t"..format("%.2f GB",frmHub:GetCurrentShareAmount()/(1024 * 1024 * 1024)).."\r\n"
	tmp = tmp.."\tMasters Online: \t"..cProfile("Master").."\r\n" 
	tmp = tmp.."\tOps Online: \t"..cProfile("Operator").."\r\n" 
	tmp = tmp.."\tVips Online: \t"..cProfile("VIP").."\r\n"
	tmp = tmp.."\tRegs Online: \t"..cProfile("REG").."\r\n"
	tmp = tmp.."\tUnregs Online: \t"..unregs.."\r\n"
	tmp = tmp.."\t---<>-------------------------------------------------------------------------------------<>---\r\n" 
	tmp = tmp.."\tTotal Online:\t\t"..frmHub:GetUsersCount().."\r\n" 
	tmp = tmp.."\t---<>-------------------------------------------------------------------------------------<>---\r\n" 
	tmp = tmp.."\tNotice(s):\r\n"
	tmp = tmp.."\t-- "..HubMsg1.."\r\n"
	tmp = tmp.."\t-- "..HubMsg2.."\r\n"
	tmp = tmp.."\t-- "..HubMsg3.."\r\n"
	tmp = tmp.."\t---<>-------------------------------------------------------------------------------------<>---\r\n" 
	SendToAll(bot,tmp)
end

function RedirAll() 
	local rdstatusall = frmHub:GetRedirectAll()
	local rastatus = ""
	if rdstatusall == 1 then
		rastatus = "on"
	else
		rastatus = "off"
	end
	return rastatus
end 

function RedirFull()
	local rdstatusfull = frmHub:GetRedirectFull()
	local rfstatus = 0
	if rdstatusfull == 1 then
		rfstatus = "on"
	else
		rfstatus = "off"
	end
	return rfstatus
end 

--// Profile Counter
function cProfile(what)
	local disp = ""
	local table,online,offline = GetUsersByProfile(what),0,0
	for i, User in table do 
		if GetItemByName(User) then
			online = online + 1
                        unregs = unregs - 1
		else
			offline = offline + 1
		end
	end
	disp = disp.."Online: "..online.."\t\tOffline: "..offline
	return disp
end

SMF spam blocked by CleanTalk