total info script :D - Page 2
 

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

total info script :D

Started by [NL]trucker, 26 February, 2004, 10:32:42

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Optimus

Me just pasted the code so others can continiou, cause this way was much quicker and less code then the first 1.

Specialy the Table for counting the profiles, this 1 is much better/quicker!

Take it & Combine it it's a good start to make more :]

acethecase

#26
- <>=========================H=U=B==I=N=F=O===============================
   ?Welcome:      [SU]aCe
   ?To this fine place Called:   [BBB]Stockholm][10Mbit]
   ?Your IP:         ****
   ?Your Share:      0.59 GB
   ?Your Status in this Hub:   Master
   ?Actual Share in the Hub:   2946.09 GB
   ?There are:       1 [MASTER] - 8 [OPERATOR] - 0 [VIP] online
   ?There are now:      97 of 500 users Online
   ?Hub minshare is:      3 GB
   ?Redirect address is:   
- <>======================================================================

I have remowed Hub description and Hub is reg @ -
no need for that I think.. Insted is it posible to add
(CT) Local Time - **:** and date *.*.**

nErBoS

Hi,

Done..

-----------------------------------------------------------------------------------------------------------------------------
---// EntryBot 0.3 By Cyberbob //---------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------

BotName = "????????M?C???????" --// Set here your bot name

kb = 1024
mb = kb*kb
gb = kb*kb*kb

function NewUserConnected(user)
	Message(user)
end

function OpConnected(user)
	Message(user)
end

function UserDisconnected(user)
end

function OpDisconnected(user)
end

--// Profile Counter
function ProfileCounter(profile)
	local table, count = GetUsersByProfile(profile), 0
	for i, User in table do 
		if GetItemByName(User) then
			count = count + 1
		end
	end
	return count
end


function Message(user)
	local disp = ""
	doGetProfile =  GetProfileName(user.iProfile) or "Not registerd"
	local s,e,share = strfind(user.sMyInfoString, "%$%s*(%d+)%$") 
	if share == nil then
	return 1
	end
	minshare = format("%0.2f", tonumber(share)/gb)
	hubshare = format("%0.2f", frmHub:GetCurrentShareAmount()/(1024)/(1024)/(1024))
	border1 = "<>=========================H=U=B==I=N=F=O==============================="
	border2 = "<>======================================================================"
	disp = "\r\n\r\n"..border1.."\r\n"
	disp = disp.."	?Welcome:		"..user.sName.."\r\n"
	disp = disp.."	?To this fine place Called:	"..frmHub:GetHubName().."\r\n"
	disp = disp.."	?Your IP:			"..user.sIP.."\r\n"
	disp = disp.."	?Your Share:		"..minshare.." GB\r\n"
	disp = disp.."	?Your Status in this Hub:	"..doGetProfile.."\r\n"
	disp = disp.."	?Actual Share in the Hub:	"..hubshare.." GB\r\n"
	disp = disp.."	?There are: 		"..ProfileCounter("Master").." [MASTER] - "..ProfileCounter("Operator").." [OPERATOR] - "..ProfileCounter("Vip").." [VIP] online\r\n"
	disp = disp.."	?There are now:		"..frmHub:GetUsersCount().." of "..frmHub:GetMaxUsers().." users Online\r\n"
	disp = disp.."	?Hub description is:		"..frmHub:GetHubDescr().."\r\n"
	disp = disp.."	?Hub register address is:	"..frmHub:GetRegServer().."\r\n"
	disp = disp.."	?Hub minshare is:		"..frmHub:GetMinShare()/(1024).." GB\r\n"
	disp = disp.."	?Redirect address is:	"..frmHub:GetRedirectAddress().."\r\n"..border2.."\r\n"
	disp = disp.."	?Time:			"..GetTime()

	user:SendData(BotName, disp)
end

function GetTime()
	s = date("%S")
	h = date("%H")
	m = date("%M")
	d = date("%d")
	mm = date("%m")
	y = date("%y")
	Date = "Date: "..d.."/"..mm.."/20"..y.." Hour: "..h..":"..m..":"..s
	return Date
end

Best regards, nErBoS
--## nErBoS Spot ##--

acethecase

#28
Nice thanx m8 for fast replay ---
 :D  :D  :D  :D  :D  :D  :D  :D

Just one little thing :

- <>=========================H=U=B==I=N=F=O===============================
   ?Welcome:      [SU]aCe
   ?To this fine place Called:   [BBB]Stockholm][10Mbit]
   ?Your IP:         ****
   ?Your Share:      0.59 GB
   ?Your Status in this Hub:   Master
   ?Actual Share in the Hub:   3217.78 GB
   ?There are:       1 [MASTER] - 7 [OPERATOR] - 0 [VIP] online
   ?There are now:      105 of 500 users Online
   ?Hub minshare is:      3 GB
   ?Redirect address is:   
- <>======================================================================
   ?Time:         Date: 04/03/2004 Hour: 16:25:25

Put the time/date in same ram/line  us the others one: l

TiMeTrAVelleR

Last 2 lines  make it like this   kopie paste

disp = disp.."   ?Redirect address is:   "..frmHub:GetRedirectAddress().."\r\n"..
   disp = disp.."   ?Time:         "..GetTime().."\r\n"..border2.."\r\n"

acethecase

thanx m8, got it.--all working nice.. :D

[NL]trucker

hello

if i take this part of your script

---------------------------------------------------------------

--// Profile Counter
function ProfileCounter(profile)
   local table, count = GetUsersByProfile(profile), 0
   for i, User in table do
      if GetItemByName(User) then
         count = count + 1
      end
   end
   return count
end

        disp = disp.."   ==================================================================="
        disp = disp.."   ?There are:    "..ProfileCounter("Master").." [MASTER] -\r\n"
        disp = disp.."   ?There are:     "..ProfileCounter("Operator").." [OPERATOR] -\r\n"
        disp = disp.."   ?There are:     "..ProfileCounter("Vip").." [VIP]- \r\n"
        disp = disp.."   ?There are:     "..profilecounter("Reg").." [Registerd users]- online \r\n"
   disp = disp.."   \r\n\r\n"
        disp = disp.."   ?There are now:   "..frmHub:GetUsersCount().." of "..frmHub:GetMaxUsers().." users Online\r\n"
        disp = disp.."   ==================================================================="
        user:SendData(BotName, disp)
end

---------------------------------------------------------------------

why isn,t this working?
i get from script-editor

Syntax error: expected;
  last token read: `end' at line 21 in file `D:\==PTOTAX==\trucker\scripts\usercount.lua'

and as far as i see there is a end of file
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


nErBoS

Hi,

This part have no function....

disp = disp.." ===================================================================" 
disp = disp.." ?There are: "..ProfileCounter("Master").." [MASTER] -\r\n" 
disp = disp.." ?There are: "..ProfileCounter("Operator").." [OPERATOR] -\r\n" 
disp = disp.." ?There are: "..ProfileCounter("Vip").." [VIP]- \r\n" 
disp = disp.." ?There are: "..profilecounter("Reg").." [Registerd users]- online \r\n" 
disp = disp.." \r\n\r\n" 
disp = disp.." ?There are now: "..frmHub:GetUsersCount().." of "..frmHub:GetMaxUsers().." users Online\r\n" 
disp = disp.." ===================================================================" 
user:SendData(BotName, disp) 
end

try to put on the top "function Message(user)" like in the original script.

Best regards, nErBoS
--## nErBoS Spot ##--

[NL]trucker

Nerbos

got no more errors but script isn,t showing in main when i reconnect.

howcome?
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


nErBoS

Hi,

Your script or this script ???

If is it yours try to see if you are calling the function where you show the info in the function NewUserConnected and function OpConnected.

Best regards, nErBoS
--## nErBoS Spot ##--

acethecase

#35
Hi nErBoS&all others
I wonder if you can put some more info in like:

Peak Users: ***
Peak Share: ***

tnx 8)

nErBoS

Hi,

Do not know if is possible to get the peak of share and users from the hub software, i could make is a little stat code, do you want that ??

Best regards, nErBoS
--## nErBoS Spot ##--

acethecase

#37
Hi m8 .
Sure sounds good ?I can always tryit."
tnx

btw I have another little script that is showing peek users and peek share,
may be u can conbine it in to urs script..
This is what it shows in main :

   Logins: 6451
   Peak Users: 163   -   Current Users: 143   -   Max Users Allowed: 500
   Peak Share: 5.64 TB   -   Current Share: 4.51 TB   -   Share/User: 32.29 GB/User

   Total Regged User: 61 in 4 Profiles

       - Master: 1
       - Operator: 22
       - VIP: 38
       - Reg: 0

and this is the script :!

--Hub Stats V.01 by chill
--Serialisation by RabidWombat

statFile = "HubStats.txt"   -- The Filename
statFolder = "txt"      -- The Foldername set it to nil if not wanted
Max1 = 10         -- Time between each stats saving
cmd1 = "+hubstats"      -- Shows the Hub Stats

--------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------
--   MAIN SCRIPT
--------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------

if statFolder then
   statFile = statFolder.."/"..statFile
end

HubStats = {
   Logins = 0,
   MaxShareAmount = frmHub:GetCurrentShareAmount(),
   MaxUsers = frmHub:GetUsersCount(),
   StatsSince = date("%d/%m/%y"),
}
dofile(statFile)
--------------------------------------------------------
function Main()
   SetTimer(60*1000*Max1)
   StartTimer()
end
function OnExit()
   WriteTable(HubStats,"HubStats",statFile)
end
--------------------------------------------------------
function OnTimer()
   WriteTable(HubStats,"HubStats",statFile)
end
--------------------------------------------------------
function NewUserConnected(curUser)
   if (frmHub:GetCurrentShareAmount() > HubStats.MaxShareAmount) then
      HubStats.MaxShareAmount = frmHub:GetCurrentShareAmount()
   end
   if (frmHub:GetUsersCount() > HubStats.MaxUsers) then
      HubStats.MaxUsers = frmHub:GetUsersCount()
   end
   HubStats.Logins = HubStats.Logins + 1
end
OpConnected = NewUserConnected
--------------------------------------------------------
function DataArrival(curUser,data)
   if strsub(data,1,1) == "<" then
      data = strsub(data,strlen(curUser.sName)+4,strlen(data)-1)
      local _,_,word1 = strfind(data,"^(%S+)")
      if word1 and hubStatFunc[word1] then
         curUser:SendData(hubStatFunc[word1]())
         return 1
      end
   end
end
---------------------------------------------------------------------------------------

--   Hub Stats Functions
---------------------------------------------------------------------------------------
hubStatFunc = {
   [cmd1] = function()
      local msg = "---  Hub Stats Since "..HubStats.StatsSince.."  ---\r\n\r\n"
      msg = msg.."\tLogins: "..HubStats.Logins.."\r\n"..
      "\tPeak Users: "..HubStats.MaxUsers.."   -   Current Users: "..frmHub:GetUsersCount().."   -   Max Users Allowed: "..frmHub:GetMaxUsers().."\r\n"..
      "\tPeak Share: "..format("%.2f",(HubStats.MaxShareAmount/(1024*1024*1024*1024))).." TB"..
      "   -   Current Share: "..format("%.2f",(frmHub:GetCurrentShareAmount()/(1024*1024*1024*1024))).." TB"..
      "   -   Share/User: "..format("%.2f",(frmHub:GetCurrentShareAmount()/(1024*1024*1024)/frmHub:GetUsersCount())).." GB/User\r\n\r\n"..
      GetReggedUsers()
      return(msg)
   end,
}

function GetReggedUsers()
   local tcount,pcount = 0,0,0
   local msg = ""
   for _,profile in GetProfiles() do
      pcount = pcount + 1
      local ucount = 0
      for _,_ in GetUsersByProfile(profile) do
         ucount = ucount + 1
         tcount = tcount + 1
      end
      msg = msg.."\t    - "..profile..": "..ucount.."\r\n"
   end
   msg = "\tTotal Regged User: "..tcount.." in "..pcount.." Profiles\r\n\r\n"..msg
   return(msg)
end
---------------------------------------------------------------------------------------

--   Write Tables

---------------------------------------------------------------------------------------
function WriteTable(table,tablename,file)
   local handle = openfile(file,"w")
   Serialize(table,tablename,handle)
     closefile(handle)
end
--------------------------------------------
function Serialize(tTable,sTableName,hFile,sTab)
   sTab = sTab or "";
   write(hFile,sTab..sTableName.." = {\n");
   for key,value in tTable do
      local sKey = (type(key) == "string") and format("[%q]",key) or format("[%d]",key);
      if(type(value) == "table") then
         Serialize(value,sKey,hFile,sTab.."\t");
      else
         local sValue = (type(value) == "string") and format("%q",value) or tostring(value);
         write(hFile,sTab.."\t"..sKey.." = "..sValue);
      end
      write(hFile,",\n");
   end
   write(hFile,sTab.."}");
end

nErBoS

#38
Hi,

That was what i was thinking on doing.

Here is it hope it helps...

-----------------------------------------------------------------------------------------------------------------------------
---// EntryBot 0.3 By Cyberbob //---------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------

BotName = "????????M?C???????" --// Set here your bot name

kb = 1024
mb = kb*kb
gb = kb*kb*kb

Stattxt = "Stat.txt" --Will be created in the script folder

Stat = {
	logins = 0,
	share = 0,
	users = 0,
}
function Main()
	frmHub:RegBot(BotName)
end

OpConnected = NewUserConnected

function NewUserConnected(user)
	local s,e,usrshare = strfind(user.sMyInfoString, "%$%s*(%d+)%$") 
	if (readfrom(Stattxt) == nil) then
		if (Stat.users < frmHub:GetUsersCount() ) then
			Stat.users = frmHub:GetUsersCount()
		else
		end
		if (Stat.share < frmHub:GetCurrentShareAmount() + usrshare) then
			Stat.share = frmHub:GetCurrentShareAmount() + usrshare
		end
		Stat.logins = Stat.logins + 1
		SaveToFile(Stattxt , Stat , "Stat")
	else
		LoadFromFile (Stattxt)
		local logins = Stat["logins"]
		local share = Stat["share"]
		local users = Stat["users"]
		if (users < frmHub:GetUsersCount() ) then
			Stat.users = frmHub:GetUsersCount()
		else
			Stat.users = users
		end
		if (share < frmHub:GetCurrentShareAmount() + usrshare) then
			Stat.share = frmHub:GetCurrentShareAmount() + usrshare
		else
			Stat.share = share
		end
		Stat.logins = logins + 1
		SaveToFile(Stattxt , Stat , "Stat")
	end

		
	Message(user)
end

OpDisconnected = UserDisconnected


function UserDisconnected(user)
end

--// Profile Counter
function ProfileCounter(profile)
	local table, count = GetUsersByProfile(profile), 0
	for i, User in table do 
		if GetItemByName(User) then
			count = count + 1
		end
	end
	return count
end


function Message(user)
	local disp = ""
	doGetProfile =  GetProfileName(user.iProfile) or "Not registerd"
	local s,e,share = strfind(user.sMyInfoString, "%$%s*(%d+)%$") 
	local ttshare = format("%0.2f", tonumber(Stat.share)/gb)
	if share == nil then
	return 1
	end
	minshare = format("%0.2f", tonumber(share)/gb)
	hubshare = format("%0.2f", frmHub:GetCurrentShareAmount()/(1024)/(1024)/(1024))
	border1 = "<>=========================H=U=B==I=N=F=O==============================="
	border2 = "<>======================================================================"
	disp = "\r\n\r\n"..border1.."\r\n"
	disp = disp.."	?Welcome:		"..user.sName.."\r\n"
	disp = disp.."	?To this fine place Called:	"..frmHub:GetHubName().."\r\n"
	disp = disp.."	?Your IP:			"..user.sIP.."\r\n"
	disp = disp.."	?Your Share:		"..minshare.." GB\r\n"
	disp = disp.."	?Your Status in this Hub:	"..doGetProfile.."\r\n"
	disp = disp.."	?Actual Share in the Hub:	"..hubshare.." GB\r\n"
	disp = disp.."	?There are: 		"..ProfileCounter("Master").." [MASTER] - "..ProfileCounter("Operator").." [OPERATOR] - "..ProfileCounter("Vip").." [VIP] online\r\n"
	disp = disp.."	?There are now:		"..frmHub:GetUsersCount().." of "..frmHub:GetMaxUsers().." users Online\r\n"
	disp = disp.."	?Hub description is:		"..frmHub:GetHubDescr().."\r\n"
	disp = disp.."	?Hub register address is:	"..frmHub:GetRegServer().."\r\n"
	disp = disp.."	?Hub minshare is:		"..frmHub:GetMinShare()/(1024).." GB\r\n"
	disp = disp.."	?Redirect address is:	"..frmHub:GetRedirectAddress().."\r\n"
	disp = disp.."	?Peak of share:		"..ttshare.." GB\r\n"
	disp = disp.."	?Peak of users:		"..Stat.users.."\r\n"
	disp = disp.."	?Logins:			"..Stat.logins.."\r\n"
	disp = disp.."	?Time:			"..GetTime().."\r\n"..border2.."\r\n"

	user:SendData(BotName, disp)
end

function GetTime()
	s = date("%S")
	h = date("%H")
	m = date("%M")
	d = date("%d")
	mm = date("%m")
	y = date("%y")
	Date = "Date: "..d.."/"..mm.."/20"..y.." Hour: "..h..":"..m..":"..s
	return Date
end

function Serialize(tTable, sTableName, hFile, sTab)
	assert(tTable, "tTable equals nil");
	assert(sTableName, "sTableName equals nil");
	assert(hFile, "hFile equals nil");

	assert(type(tTable) == "table", "tTable must be a table!");
	assert(type(sTableName) == "string", "sTableName must be a string!");

	sTab = sTab or "";

	write(hFile, sTab..sTableName.." = {\n" );

	for key, value in tTable do
		local sKey = (type(key) == "string") and format("[%q]",key) or format("[%d]",key);

		if(type(value) == "table") then
			Serialize(value, sKey, hFile, sTab.."\t");
		else
			local sValue = (type(value) == "string") and format("%q",value) or tostring(value);
			write(hFile, sTab.."\t"..sKey.." = "..sValue);
		end

		write(hFile, ",\n");
	end

	write(hFile, sTab.."}");
end

function SaveToFile(file , table , tablename)
	local hFile = openfile(file, "w");
	Serialize(table, tablename, hFile);
	closefile(hFile);
end

function LoadFromFile (file)
	assert(readfrom(file),"Making file, not to horry")
	dostring(read("*all"))
	readfrom()
end

Best regards, nErBoS
--## nErBoS Spot ##--

acethecase

firs thanx for script
second its not working ..lol
Nonthing is happening, no info in main!!
Strange beacuse no error report:

No syntax errors in script file C:\Documents and Settings\ace\Mina dokument\-=HUB=-\THE HUB\scripts\EntryBot 0.3.lua

nErBoS

Hi,

Sorry my bad :P

-----------------------------------------------------------------------------------------------------------------------------
---// EntryBot 0.3 By Cyberbob //---------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------

BotName = "????????M?C???????" --// Set here your bot name

kb = 1024
mb = kb*kb
gb = kb*kb*kb

Stattxt = "Stat.txt" --Will be created in the script folder

Stat = {
	logins = 0,
	share = 0,
	users = 0,
}
function Main()
	frmHub:RegBot(BotName)
end

function NewUserConnected(user, data)
	local s,e,usrshare = strfind(user.sMyInfoString, "%$%s*(%d+)%$") 
	if (readfrom(Stattxt) == nil) then
		if (Stat.users < frmHub:GetUsersCount() ) then
			Stat.users = frmHub:GetUsersCount()
		else
		end
		if (Stat.share < frmHub:GetCurrentShareAmount() + usrshare) then
			Stat.share = frmHub:GetCurrentShareAmount() + usrshare
		end
		Stat.logins = Stat.logins + 1
		SaveToFile(Stattxt , Stat , "Stat")
	else
		LoadFromFile (Stattxt)
		local logins = Stat["logins"]
		local share = Stat["share"]
		local users = Stat["users"]
		if (users < frmHub:GetUsersCount() ) then
			Stat.users = frmHub:GetUsersCount()
		else
			Stat.users = users
		end
		if (share < frmHub:GetCurrentShareAmount() + usrshare) then
			Stat.share = frmHub:GetCurrentShareAmount() + usrshare
		else
			Stat.share = share
		end
		Stat.logins = logins + 1
		SaveToFile(Stattxt , Stat , "Stat")
	end

		
	Message(user)
end

OpConnected = NewUserConnected

function UserDisconnected(user, data)
end

OpDisconnected = UserDisconnected

--// Profile Counter
function ProfileCounter(profile)
	local table, count = GetUsersByProfile(profile), 0
	for i, User in table do 
		if GetItemByName(User) then
			count = count + 1
		end
	end
	return count
end


function Message(user)
	local disp = ""
	doGetProfile =  GetProfileName(user.iProfile) or "Not registerd"
	local s,e,share = strfind(user.sMyInfoString, "%$%s*(%d+)%$") 
	local ttshare = format("%0.2f", tonumber(Stat.share)/gb)
	if share == nil then
	return 1
	end
	minshare = format("%0.2f", tonumber(share)/gb)
	hubshare = format("%0.2f", frmHub:GetCurrentShareAmount()/(1024)/(1024)/(1024))
	border1 = "<>=========================H=U=B==I=N=F=O==============================="
	border2 = "<>======================================================================"
	disp = "\r\n\r\n"..border1.."\r\n"
	disp = disp.."	?Welcome:		"..user.sName.."\r\n"
	disp = disp.."	?To this fine place Called:	"..frmHub:GetHubName().."\r\n"
	disp = disp.."	?Your IP:			"..user.sIP.."\r\n"
	disp = disp.."	?Your Share:		"..minshare.." GB\r\n"
	disp = disp.."	?Your Status in this Hub:	"..doGetProfile.."\r\n"
	disp = disp.."	?Actual Share in the Hub:	"..hubshare.." GB\r\n"
	disp = disp.."	?There are: 		"..ProfileCounter("Master").." [MASTER] - "..ProfileCounter("Operator").." [OPERATOR] - "..ProfileCounter("Vip").." [VIP] online\r\n"
	disp = disp.."	?There are now:		"..frmHub:GetUsersCount().." of "..frmHub:GetMaxUsers().." users Online\r\n"
	disp = disp.."	?Hub description is:		"..frmHub:GetHubDescr().."\r\n"
	disp = disp.."	?Hub register address is:	"..frmHub:GetRegServer().."\r\n"
	disp = disp.."	?Hub minshare is:		"..frmHub:GetMinShare()/(1024).." GB\r\n"
	disp = disp.."	?Redirect address is:	"..frmHub:GetRedirectAddress().."\r\n"
	disp = disp.."	?Peak of share:		"..ttshare.." GB\r\n"
	disp = disp.."	?Peak of users:		"..Stat.users.."\r\n"
	disp = disp.."	?Logins:			"..Stat.logins.."\r\n"
	disp = disp.."	?Time:			"..GetTime().."\r\n"..border2.."\r\n"

	user:SendData(BotName, disp)
end

function GetTime()
	s = date("%S")
	h = date("%H")
	m = date("%M")
	d = date("%d")
	mm = date("%m")
	y = date("%y")
	Date = "Date: "..d.."/"..mm.."/20"..y.." Hour: "..h..":"..m..":"..s
	return Date
end

function Serialize(tTable, sTableName, hFile, sTab)
	assert(tTable, "tTable equals nil");
	assert(sTableName, "sTableName equals nil");
	assert(hFile, "hFile equals nil");

	assert(type(tTable) == "table", "tTable must be a table!");
	assert(type(sTableName) == "string", "sTableName must be a string!");

	sTab = sTab or "";

	write(hFile, sTab..sTableName.." = {\n" );

	for key, value in tTable do
		local sKey = (type(key) == "string") and format("[%q]",key) or format("[%d]",key);

		if(type(value) == "table") then
			Serialize(value, sKey, hFile, sTab.."\t");
		else
			local sValue = (type(value) == "string") and format("%q",value) or tostring(value);
			write(hFile, sTab.."\t"..sKey.." = "..sValue);
		end

		write(hFile, ",\n");
	end

	write(hFile, sTab.."}");
end

function SaveToFile(file , table , tablename)
	local hFile = openfile(file, "w");
	Serialize(table, tablename, hFile);
	closefile(hFile);
end

function LoadFromFile (file)
	assert(readfrom(file),"Making file, not to horry")
	dostring(read("*all"))
	readfrom()
end

Best regards, nErBoS
--## nErBoS Spot ##--

acethecase

nicceee m8.. Thanx allot for all ya help,you the man--- :D

- <>=========================H=U=B==I=N=F=O===============================
   ?Welcome:      [SU]aCe
   ?To this fine place Called:   [BBB]Stockholm][10Mbit]
   ?Your IP:   ****      
   ?Your Share:      6.95 GB
   ?Your Status in this Hub:   Master
   ?Actual Share in the Hub:   3669.55 GB
   ?There are:       1 [MASTER] - 8 [OPERATOR] - 1 [VIP] online
   ?There are now:      110 of 500 users Online
   ?Hub minshare is:      3 GB
   ?Peak of share:      3846.21 GB
   ?Peak of users:      114
   ?Logins:         134
   ?Redirect address is:   
   ?Time:         Date: 06/03/2004 Hour: 01:29:17
- <>======================================================================

nEgativE

Hi all, Hi nErBoS, Bom trabalho :))
i wonder if its possible to include those (peak users and peak share) funtions on this one ? :-)

-----------------------------------------------------------------------------
-- online user counter by plop v:1.2
-- based on a bot by ....... witch showed basic hub info 2 users on entry
-- (fill in the name pls if you know who this was)
-----------------------------------------------------------------------------
-- LEVELSTOT[number] = total number of users with that level
-- LEVELS[number] = total online number of users with that level
-- commands = table of triggers used by the hub 2 add/delete users 
-- add the script commands yourself if you use a script 2 add/delete users
-- same can be done if you have more user levels then default
-----------------------------------------------------------------------------
-- tables all over but i seem 2 have forgotten 2 add chairs. snif snif
-----------------------------------------------------------------------------
-- manual stuff
-----------------------------------------------------------------------------
-- LEVELSTOT["0"] -- total masters
-- LEVELSTOT["1"] -- total operators
-- LEVELSTOT["2"] -- total VIPs
-- LEVELSTOT["3"] -- total registred users
-- tmp -- total operators and masters
-- frmHub:GetUsersCount() -- total online users
----------
-- LEVELS["0"] -- total online masters
-- LEVELS["1"] -- total online operators
-- LEVELS["2"] -- total online VIPs
-- LEVELS["3"] -- total online registered users
-- LEVELS["-1"] -- total online unregistered users
-- tmp3 -- total operators and masters
----------
-- offline users
-- LEVELSTOT["0"] - LEVELS["0"] == offline operators
-- tmp1 -- total offline VIPs
-- tmp2 -- total offline registered users
-----------------------------------------------------------------------------
-- name of the bot
Bot = "[operserv]"

-- couter tables, if you have more levels add there numbers in BOTH tables,
-- except unreg users, those only work in the lower table
LEVELSTOT = {["0"]=0, ["1"]=0, ["2"]=0, ["3"]=0}
LEVELS = {["0"]=0, ["1"]=0, ["2"]=0, ["3"]=0, ["-1"]=0}

-- table holding the commands ptokax uses 2 add/delete users
-- add your bot's commands 2 this table if you use a bot 2 add/delete ppl
commands = {["!addreguser"]=1, ["!delreguser"]=1}
-------------------------------------------------------------------------------------------------------------------------------------------------
function Message(user)
   local s,e,share = strfind(user.sMyInfoString, "$(%d+)%$")
   share = format("%0.2f", ( share / (1024*1024*1024)))
   local hubshare = format("%0.2f",  ( frmHub:GetCurrentShareAmount() / (1024*1024*1024)))
   local tmp = LEVELSTOT["1"] + LEVELSTOT["0"]  --- total ops  (adding masters 2 ops)
   local tmp1 = (LEVELSTOT["2"] - LEVELS["2"]) if tmp1 < 0 then tmp1 = 0 end --- offline vips (total - online)
   local tmp2 = (LEVELSTOT["3"] - LEVELS["3"]) if tmp2 < 0 then tmp2 = 0 end --- offline regs (total - online)
   local tmp3 = LEVELS["1"] + LEVELS["0"] -- online ops (adding masters 2 the ops)
   user:SendData(Bot, "-=[?]=-----------------------------------------------------------------------------------------------=[?]=-") 
   user:SendData(Bot, "		<-----=[- "..frmHub:GetHubName().." ? v2004 -]=----->") 
   user:SendData(Bot, "-=[?]=-----------------------------------------------------------------------------------------------=[?]=-") 
   user:SendData(Bot, "    	  ? Comunidade Lusobrasileira de ?irect C?nnect - P2P ?") 
   user:SendData(Bot, "    	  ? "..user.sName..", bem vindo ao servidor.") 
   user:SendData(Bot, "    	  ? Seu endere?o IP: "..user.sIP) 
   user:SendData(Bot, "    	  ? Seu status no Hub: "..(GetProfileName(user.iProfile) or "N?o registrado")) 
   user:SendData(Bot, "    	  ? Voc? est? compartilhando: "..share.." GB - Limite minimo: "..frmHub:GetMinShare()/(1024).." GB.") 
   user:SendData(Bot, "    	  ? Usu?rios Online no Hub: "..frmHub:GetUsersCount()..".") 
   user:SendData(Bot, "    	  ? Operadores Online no Hub: "..tmp3..". ViPs: "..LEVELS["2"]..".")
   user:SendData(Bot, "    	  ? Total de Operadores registrados no Hub: "..tmp..". ViPs: "..LEVELSTOT["2"]..".")
   user:SendData(Bot, "    	  ? Usu?rios registrados, n?o conectados: "..tmp2..".")
   user:SendData(Bot, "    	  ? Compartilhamento atual no Hub: "..hubshare.." GB.") 
   user:SendData(Bot, "    	  ? Lista de comandos, regras, ajuda e informa??o: !ajuda") 
   user:SendData(Bot, "    	  ? Website - F?rum: [URL]www.lusobrasil.site.vu[/URL]") 
   user:SendData(Bot, "    	  ? "..GetTime().."") 
   user:SendData(Bot, "-=[?]=-----------------------------------------------------------------------------------------------=[?]=-") 
   user:SendData(Bot, "    	  ? Registros sem login no Hub por: 1 semana(s) ser?o auto-removidos. [- Perman?ncia de 5 min. -]") 
   user:SendData(Bot, "-=[?]=-----------------------------------------------------------------------------------------------=[?]=-") 
end
-------------------------------------------------------------------------------------------------------------------------------------------------
function GetTime()
	s = date("%S")
	h = date("%H")
	m = date("%M")
	d = date("%d")
	mm = date("%m")
	y = date("%y")
	Date = "Hora local: "..h..":"..m..":"..s.." ? "..d.."/"..mm.."/20"..y.."."
	return Date
end
-------------------------------------------------------------------------------------------------------------------------------------------------
ALLUSERS={}

function NewUserConnected(user)
   if ALLUSERS[user.sName]==nil then
      ALLUSERS[user.sName]=1
      LEVELS[tostring(user.iProfile)]=LEVELS[tostring(user.iProfile)]+1
   end
   Message(user)
end
-------------------------------------------------------------------------------------------------------------------------------------------------
function OpConnected(user)
   if ALLUSERS[user.sName]==nil then
      ALLUSERS[user.sName]=1
      LEVELS[tostring(user.iProfile)]=LEVELS[tostring(user.iProfile)]+1
   end
   Message(user)
end
-------------------------------------------------------------------------------------------------------------------------------------------------
function DataArrival(user, data)
   if ALLUSERS[user.sName]==nil then
      ALLUSERS[user.sName]=1
      LEVELS[tostring(user.iProfile)]=LEVELS[tostring(user.iProfile)]+1
   end
   s,e,cmd= strfind(data, "%b<>%s+(%S+)")
   if cmd ~= nil and commands[cmd] then
      SetTimer(5 * 1000) 
      StartTimer()
   end
end
-------------------------------------------------------------------------------------------------------------------------------------------------
function OnTimer()
   StopTimer()
   OpenRegisterdUsersFile()
end
-------------------------------------------------------------------------------------------------------------------------------------------------
function UserDisconnected(user)
   if ALLUSERS[user.sName] then
      ALLUSERS[user.sName]=nil
      if LEVELS[tostring(user.iProfile)] > 0 then
         LEVELS[tostring(user.iProfile)]=LEVELS[tostring(user.iProfile)]-1
      end
   end
end
-------------------------------------------------------------------------------------------------------------------------------------------------
function OpDisconnected(user)
   if ALLUSERS[user.sName] then
      ALLUSERS[user.sName]=nil
      if LEVELS[tostring(user.iProfile)] > 0 then
         LEVELS[tostring(user.iProfile)]=LEVELS[tostring(user.iProfile)]-1
      end
   end
end
-------------------------------------------------------------------------------------------------------------------------------------------------
function Main()
   frmHub:RegBot(Bot)
   OpenRegisterdUsersFile()
end
-------------------------------------------------------------------------------------------------------------------------------------------------
function OpenRegisterdUsersFile()
   readfrom("../RegisteredUsers.dat")
   for a,b in LEVELSTOT do
      LEVELSTOT[a]=0
   end
   while 1 do
      local line = read()
      local level 
      if line == nil then 
         readfrom()
         break 
      end
      s,e,level = strfind(line,".+|.+|(.+)")
      if LEVELSTOT[level] then
         LEVELSTOT[level] = LEVELSTOT[level] +1
      end
   end  
end
-------------------------------------------------------------------------------------------------------------------------------------------------

nErBoS

Hi,

Done and already translated :) ....

-----------------------------------------------------------------------------
-- online user counter by plop v:1.2
-- based on a bot by ....... witch showed basic hub info 2 users on entry
-- (fill in the name pls if you know who this was)
-----------------------------------------------------------------------------
-- LEVELSTOT[number] = total number of users with that level
-- LEVELS[number] = total online number of users with that level
-- commands = table of triggers used by the hub 2 add/delete users 
-- add the script commands yourself if you use a script 2 add/delete users
-- same can be done if you have more user levels then default
-----------------------------------------------------------------------------
-- tables all over but i seem 2 have forgotten 2 add chairs. snif snif
-----------------------------------------------------------------------------
-- manual stuff
-----------------------------------------------------------------------------
-- LEVELSTOT["0"] -- total masters
-- LEVELSTOT["1"] -- total operators
-- LEVELSTOT["2"] -- total VIPs
-- LEVELSTOT["3"] -- total registred users
-- tmp -- total operators and masters
-- frmHub:GetUsersCount() -- total online users
----------
-- LEVELS["0"] -- total online masters
-- LEVELS["1"] -- total online operators
-- LEVELS["2"] -- total online VIPs
-- LEVELS["3"] -- total online registered users
-- LEVELS["-1"] -- total online unregistered users
-- tmp3 -- total operators and masters
----------
-- offline users
-- LEVELSTOT["0"] - LEVELS["0"] == offline operators
-- tmp1 -- total offline VIPs
-- tmp2 -- total offline registered users
-----------------------------------------------------------------------------
-- name of the bot
Bot = "[operserv]"

-- couter tables, if you have more levels add there numbers in BOTH tables,
-- except unreg users, those only work in the lower table
LEVELSTOT = {["0"]=0, ["1"]=0, ["2"]=0, ["3"]=0}
LEVELS = {["0"]=0, ["1"]=0, ["2"]=0, ["3"]=0, ["-1"]=0}

Stattxt = "Stat.txt" --Will be created in the script folder

Stat = {
	logins = 0,
	share = 0,
	users = 0,
}

-- table holding the commands ptokax uses 2 add/delete users
-- add your bot's commands 2 this table if you use a bot 2 add/delete ppl
commands = {["!addreguser"]=1, ["!delreguser"]=1}
-------------------------------------------------------------------------------------------------------------------------------------------------
function Message(user)
   local s,e,share = strfind(user.sMyInfoString, "$(%d+)%$")
   share = format("%0.2f", ( share / (1024*1024*1024)))
   local hubshare = format("%0.2f",  ( frmHub:GetCurrentShareAmount() / (1024*1024*1024)))
   local ttshare = format("%0.2f", tonumber(Stat.share)/(1024*1024*1024))
   local tmp = LEVELSTOT["1"] + LEVELSTOT["0"]  --- total ops  (adding masters 2 ops)
   local tmp1 = (LEVELSTOT["2"] - LEVELS["2"]) if tmp1 < 0 then tmp1 = 0 end --- offline vips (total - online)
   local tmp2 = (LEVELSTOT["3"] - LEVELS["3"]) if tmp2 < 0 then tmp2 = 0 end --- offline regs (total - online)
   local tmp3 = LEVELS["1"] + LEVELS["0"] -- online ops (adding masters 2 the ops)
   user:SendData(Bot, "-=[?]=-----------------------------------------------------------------------------------------------=[?]=-") 
   user:SendData(Bot, "		<-----=[- "..frmHub:GetHubName().." ? v2004 -]=----->") 
   user:SendData(Bot, "-=[?]=-----------------------------------------------------------------------------------------------=[?]=-") 
   user:SendData(Bot, "    	  ? Comunidade Lusobrasileira de ?irect C?nnect - P2P ?") 
   user:SendData(Bot, "    	  ? "..user.sName..", bem vindo ao servidor.") 
   user:SendData(Bot, "    	  ? Seu endere?o IP: "..user.sIP) 
   user:SendData(Bot, "    	  ? Seu status no Hub: "..(GetProfileName(user.iProfile) or "N?o registrado")) 
   user:SendData(Bot, "    	  ? Voc? est? compartilhando: "..share.." GB - Limite minimo: "..frmHub:GetMinShare()/(1024).." GB.") 
   user:SendData(Bot, "    	  ? Usu?rios Online no Hub: "..frmHub:GetUsersCount()..".") 
   user:SendData(Bot, "    	  ? Operadores Online no Hub: "..tmp3..". ViPs: "..LEVELS["2"]..".")
   user:SendData(Bot, "    	  ? Total de Operadores registrados no Hub: "..tmp..". ViPs: "..LEVELSTOT["2"]..".")
   user:SendData(Bot, "    	  ? Usu?rios registrados, n?o conectados: "..tmp2..".")
   user:SendData(Bot, "    	  ? Compartilhamento atual no Hub: "..hubshare.." GB.") 
   user:SendData(Bot, "    	  ? Lista de comandos, regras, ajuda e informa??o: !ajuda") 
   user:SendData(Bot, "    	  ? Website - F?rum: [URL]www.lusobrasil.site.vu[/URL]") 
   user:SendData(Bot, "    	  ? Numero M?ximo de Utilizadores recebido: "..Stat.users) 
   user:SendData(Bot, "    	  ? Numero M?ximo de Share recebido: "..ttshare)
   user:SendData(Bot, "    	  ? Numero de Entradas: "..Stat.logins)
   user:SendData(Bot, "    	  ? "..GetTime().."") 
   user:SendData(Bot, "-=[?]=-----------------------------------------------------------------------------------------------=[?]=-") 
   user:SendData(Bot, "    	  ? Registros sem login no Hub por: 1 semana(s) ser?o auto-removidos. [- Perman?ncia de 5 min. -]") 
   user:SendData(Bot, "-=[?]=-----------------------------------------------------------------------------------------------=[?]=-") 
end
-------------------------------------------------------------------------------------------------------------------------------------------------
function GetTime()
	s = date("%S")
	h = date("%H")
	m = date("%M")
	d = date("%d")
	mm = date("%m")
	y = date("%y")
	Date = "Hora local: "..h..":"..m..":"..s.." ? "..d.."/"..mm.."/20"..y.."."
	return Date
end
-------------------------------------------------------------------------------------------------------------------------------------------------
ALLUSERS={}

function NewUserConnected(user)
	local s,e,usrshare = strfind(user.sMyInfoString, "%$%s*(%d+)%$") 
	if (readfrom(Stattxt) == nil) then
		if (Stat.users < frmHub:GetUsersCount() ) then
			Stat.users = frmHub:GetUsersCount()
		else
		end
		if (Stat.share < frmHub:GetCurrentShareAmount() + usrshare) then
			Stat.share = frmHub:GetCurrentShareAmount() + usrshare
		end
		Stat.logins = Stat.logins + 1
		SaveToFile(Stattxt , Stat , "Stat")
	else
		LoadFromFile (Stattxt)
		local logins = Stat["logins"]
		local share = Stat["share"]
		local users = Stat["users"]
		if (users < frmHub:GetUsersCount() ) then
			Stat.users = frmHub:GetUsersCount()
		else
			Stat.users = users
		end
		if (share < frmHub:GetCurrentShareAmount() + usrshare) then
			Stat.share = frmHub:GetCurrentShareAmount() + usrshare
		else
			Stat.share = share
		end
		Stat.logins = logins + 1
		SaveToFile(Stattxt , Stat , "Stat")
	end

   if ALLUSERS[user.sName]==nil then
      ALLUSERS[user.sName]=1
      LEVELS[tostring(user.iProfile)]=LEVELS[tostring(user.iProfile)]+1
   end
   Message(user)
end
-------------------------------------------------------------------------------------------------------------------------------------------------
OpConnected = NewUserConnected

-------------------------------------------------------------------------------------------------------------------------------------------------
function DataArrival(user, data)
   if ALLUSERS[user.sName]==nil then
      ALLUSERS[user.sName]=1
      LEVELS[tostring(user.iProfile)]=LEVELS[tostring(user.iProfile)]+1
   end
   s,e,cmd= strfind(data, "%b<>%s+(%S+)")
   if cmd ~= nil and commands[cmd] then
      SetTimer(5 * 1000) 
      StartTimer()
   end
end
-------------------------------------------------------------------------------------------------------------------------------------------------
function OnTimer()
   StopTimer()
   OpenRegisterdUsersFile()
end
-------------------------------------------------------------------------------------------------------------------------------------------------
function UserDisconnected(user)
   if ALLUSERS[user.sName] then
      ALLUSERS[user.sName]=nil
      if LEVELS[tostring(user.iProfile)] > 0 then
         LEVELS[tostring(user.iProfile)]=LEVELS[tostring(user.iProfile)]-1
      end
   end
end
-------------------------------------------------------------------------------------------------------------------------------------------------
function OpDisconnected(user)
   if ALLUSERS[user.sName] then
      ALLUSERS[user.sName]=nil
      if LEVELS[tostring(user.iProfile)] > 0 then
         LEVELS[tostring(user.iProfile)]=LEVELS[tostring(user.iProfile)]-1
      end
   end
end
-------------------------------------------------------------------------------------------------------------------------------------------------
function Main()
   frmHub:RegBot(Bot)
   OpenRegisterdUsersFile()
end
-------------------------------------------------------------------------------------------------------------------------------------------------
function OpenRegisterdUsersFile()
   readfrom("../RegisteredUsers.dat")
   for a,b in LEVELSTOT do
      LEVELSTOT[a]=0
   end
   while 1 do
      local line = read()
      local level 
      if line == nil then 
         readfrom()
         break 
      end
      s,e,level = strfind(line,".+|.+|(.+)")
      if LEVELSTOT[level] then
         LEVELSTOT[level] = LEVELSTOT[level] +1
      end
   end  
end
-------------------------------------------------------------------------------------------------------------------------------------------------
function Serialize(tTable, sTableName, hFile, sTab)
	assert(tTable, "tTable equals nil");
	assert(sTableName, "sTableName equals nil");
	assert(hFile, "hFile equals nil");

	assert(type(tTable) == "table", "tTable must be a table!");
	assert(type(sTableName) == "string", "sTableName must be a string!");

	sTab = sTab or "";

	write(hFile, sTab..sTableName.." = {\n" );

	for key, value in tTable do
		local sKey = (type(key) == "string") and format("[%q]",key) or format("[%d]",key);

		if(type(value) == "table") then
			Serialize(value, sKey, hFile, sTab.."\t");
		else
			local sValue = (type(value) == "string") and format("%q",value) or tostring(value);
			write(hFile, sTab.."\t"..sKey.." = "..sValue);
		end

		write(hFile, ",\n");
	end

	write(hFile, sTab.."}");
end

function SaveToFile(file , table , tablename)
	local hFile = openfile(file, "w");
	Serialize(table, tablename, hFile);
	closefile(hFile);
end

function LoadFromFile (file)
	assert(readfrom(file),"Making file, not to horry")
	dostring(read("*all"))
	readfrom()
end

Best regards, nErBoS
--## nErBoS Spot ##--

nEgativE

ValewWw nErBoS !! :-) Thank U

SMF spam blocked by CleanTalk