GetUserCount
 

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

GetUserCount

Started by Ivosch, 19 May, 2006, 19:16:05

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ivosch

local uziv=frmHub:GetUserCount()

What?s wrong?
[20:12] Syntax lawmaker/components/linda.lmc:21: attempt to call method `GetUserCount' (a nil value)
I found this function on wiki...

Psycho_Chihuahua

as far as i know Lawmaker is not yet Lua 5.1 compatibal.
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Ivosch

but for example function frmHub:GetCurrentShareAmount() is working  ???

Psycho_Chihuahua

Here is an Example how GetUserCount is used:

function GetEnable(enable)
	if enable == nil or enable == "" then
		enable = "not set"
	end
	return enable
end


	"\tThere Are Now:\t"..GetEnable(frmHub:GetUsersCount()).." of "..GetEnable(frmHub:GetMaxUsers()).." max users online.\r\n\r\n"..


Thats how its used in InfoBot created by Mutor and Modded a bit by me

Hope it helps you out a bit as i cant tell you much more (i'm still a script noob myself in some ways hehe)
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Ivosch


Psycho_Chihuahua

your'e welcome - glad i could help you out  8)
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Markitos

But wouldn't
"\tThere Are Now:\t"..(frmHub:GetUsersCount() or "N/A").." of "..(frmHub:GetMaxUsers() or "N/A").." max users online.\r\n\r\n"..

be more simplified???

Psycho_Chihuahua

Sure it would - but in InfoBot the GetEnable Function is used more then once ;)

in specific for:
"\tHub Name: \t"..GetEnable(frmHub:GetHubName())..",  "..Topic.."\r\n"..
	"\tHub description:\t"..GetEnable(frmHub:GetHubDescr()).."\r\n"..
	"\tPeak Users:\t"..GetEnable(frmHub:GetMaxUsersPeak()).."\r\n"..
	"\tThere Are Now:\t"..GetEnable(frmHub:GetUsersCount()).." of "..GetEnable(frmHub:GetMaxUsers()).." max users online.\r\n\r\n"..
	"\tIP Address:\t"..GetEnable(user.sIP).."\r\n"..
	"\tDC Tag:\t\t"..GetEnable(user.sTag).."\r\n"..
	"\tEmail:\t\t"..GetEnable(user.sEmail).."\r\n"..
	"\tConnection:\t"..GetEnable(user.sConnection).."\r\n\r\n"..


which makes that function rather good
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Markitos

Quote from: Mutor on 20 May, 2006, 03:49:00
It's also because some hub calls might return nil, -1 or an empty string.
The intent of the original function was to return a boolean response from any call.
ie.. 0/1
I understand.

bastya_elvtars

Quote from: Psycho_Chihuahua on 19 May, 2006, 19:19:08
as far as i know Lawmaker is not yet Lua 5.1 compatibal.

And will not be until a stabl?e PtokaX version with Lua 5.1 gets released. It is however damn easy to rewrite, that will be called 1.1 probably.
Everything could have been anything else and it would have just as much meaning.

Snooze

Quote from: bastya_elvtars on 26 May, 2006, 13:32:41
And will not be until a stabl?e PtokaX version with Lua 5.1 gets released. It is however damn easy to rewrite, that will be called 1.1 probably.

Good Call ;)

-Snooze

SMF spam blocked by CleanTalk