Invalid return type SetMan.GetHubBot()
 

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

Invalid return type SetMan.GetHubBot()

Started by CrazyGuy, 20 February, 2009, 23:27:08

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

CrazyGuy

According to the API, SetMan.GetHubBot() should return the values bEnabled and bUseAsHubSecAlias as boolean.
However, these are returned as integer or nil (1/nil)

Tested on PtokaX 0.4.1.1 (Win32 GUI edition)

local tBot = SetMan.GetHubBot()
	Core.SendToAll("<test> Showing values returned by SetMan.GetHubBot...|")
	for k in pairs(tBot) do Core.SendToAll("<"..k.."> "..tostring(tBot[k]).."|") end
	Core.SendToAll("<test> Using SetMan.SetHubBot with values returned by SetMan.GetHubBot...|")
	Core.SendToAll("<SetMan.SetHubBot with SetMan.GetHubBot values result> "..tostring(SetMan.SetHubBot(tBot.bEnabled, tBot.sNick, tBot.sDescription, tBot.sEmail, tBot.bUseAsHubSecAlias)).."|")



Quote from: result
[23:21:04] <test> Showing values returned by SetMan.GetHubBot...
[23:21:04] <sDescription> Leviathan v4.1.1 from C??o?y†? & T?M?†r?V?ll?R
[23:21:04] <sEmail> LV_4@Bot.Hub
[23:21:04] <sNick> Leviathan_4.1
[23:21:04] <bEnabled> 1
[23:21:04] <bUsedAsHubSecAlias> 1
[23:21:04] <test> Using SetMan.SetHubBot with values returned by SetMan.GetHubBot...
[23:21:04] <Flaindead_Bry> [Error] xxxxxxxxx: bad argument #1 to 'SetHubBot' (boolean expected, got number)

The error shows that the expected types for SetMan.SetHubBot are correct though so the problem is limited to SetMan.GetHubBot :)

PPK

"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

PPK

I know, and same for profile permissions :P
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

CrazyGuy

 ;D I didn't test em all. I found these by accident while I was looking (without finding) a way to update registered bots information without having to Unreg/Reg.

But thnx for the fixes :)

SMF spam blocked by CleanTalk