Author Topic: Invalid return type SetMan.GetHubBot()  (Read 2520 times)

0 Members and 1 Guest are viewing this topic.

Offline CrazyGuy

  • Viking
  • ****
  • Posts: 506
  • Karma: +83/-20
    • ?????=-_The NightHawk_-=?????
Invalid return type SetMan.GetHubBot()
« on: 20 February, 2009, 23:27:08 »
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)

Code: [Select]
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 :)
« Last Edit: 21 February, 2009, 00:55:50 by CrazyGuy »

PtokaX forum

Invalid return type SetMan.GetHubBot()
« on: 20 February, 2009, 23:27:08 »

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 481
  • Karma: +209/-22
  • PtokaX developer
Re: Invalid return type SetMan.GetHubBot()
« Reply #1 on: 22 February, 2009, 20:46:20 »
Found and fixed  ::)
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 481
  • Karma: +209/-22
  • PtokaX developer
Re: Invalid return type SetMan.GetHubBot()
« Reply #2 on: 23 February, 2009, 10:59:29 »
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

Offline CrazyGuy

  • Viking
  • ****
  • Posts: 506
  • Karma: +83/-20
    • ?????=-_The NightHawk_-=?????
Re: Invalid return type SetMan.GetHubBot()
« Reply #3 on: 23 February, 2009, 16:01:05 »
 ;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 :)

PtokaX forum

Re: Invalid return type SetMan.GetHubBot()
« Reply #3 on: 23 February, 2009, 16:01:05 »