Strange user object error in RC4
 

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

Strange user object error in RC4

Started by bastya_elvtars, 03 February, 2008, 13:55:36

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bastya_elvtars

With the following code:
Code: lua
function UserConnected(user)
  if  Core.GetUserValue(user, 12) then


I get:

bad argument #1 to 'GetUserValue' (table expected, got string)

Hungarista told me to make the script display the type of the user object. I did it, and performed a reconnect. I got:

[13:35:46] <TYPE> table
[13:35:47] <TYPE> table
[13:35:47] <TYPE> string


The modified code was:
Code: lua
function UserConnected(user)
  Core.SendToAll("<TYPE> "..type(user).."|")
  if  Core.GetUserValue(user, 12) then
Everything could have been anything else and it would have just as much meaning.

PPK

Tested on real users with
function UserConnected(user)
  Core.SendToNick("PPK", "<TYPE> "..type(user).."|")
end

result
Quote[14:30:46] <TYPE> table
[14:32:04] <TYPE> table
[14:35:11] <TYPE> table
[14:35:27] <TYPE> table
[14:36:30] <TYPE> table
[14:37:16] <TYPE> table
[14:38:02] <TYPE> table
[14:38:53] <TYPE> table
[14:39:17] <TYPE> table
[14:39:49] <TYPE> table
[14:40:40] <TYPE> table
[14:41:04] <TYPE> table
[14:41:24] <TYPE> table
[14:41:57] <TYPE> table
[14:41:57] <TYPE> table
[14:42:03] <TYPE> table
[14:44:14] <TYPE> table
[14:44:21] <TYPE> table
[14:45:42] <TYPE> table
[14:45:59] <TYPE> table
[14:46:07] <TYPE> table
[14:46:47] <TYPE> table
[14:46:52] <TYPE> table
[14:48:00] <TYPE> table
[14:49:09] <TYPE> table
[14:49:23] <TYPE> table
[14:49:44] <TYPE> table
[14:50:09] <TYPE> table
[14:50:37] <TYPE> table
[14:52:26] <TYPE> table
[14:52:34] <TYPE> table
[14:53:04] <TYPE> table
[14:53:18] <TYPE> table
[14:54:13] <TYPE> table
[14:54:22] <TYPE> table
[14:55:17] <TYPE> table
[14:55:57] <TYPE> table
[14:56:04] <TYPE> table
[14:57:10] <TYPE> table
[14:57:27] <TYPE> table
[14:57:46] <TYPE> table
[14:57:51] <TYPE> table
[15:00:24] <TYPE> table
[15:01:20] <TYPE> table
[15:03:27] <TYPE> table
[15:04:09] <TYPE> table
[15:06:23] <TYPE> table
[15:06:32] <TYPE> table
[15:06:33] <TYPE> table
[15:07:38] <TYPE> table
[15:09:19] <TYPE> table
[15:10:57] <TYPE> table
[15:11:52] <TYPE> table
[15:12:18] <TYPE> table
[15:16:43] <TYPE> table
[15:17:26] <TYPE> table
[15:18:32] <TYPE> table
[15:18:53] <TYPE> table
[15:19:01] <TYPE> table
[15:19:35] <TYPE> table
[15:20:19] <TYPE> table
[15:20:36] <TYPE> table
[15:20:36] <TYPE> table
[15:21:39] <TYPE> table
[15:22:24] <TYPE> table
[15:22:47] <TYPE> table
[15:25:48] <TYPE> table
[15:25:56] <TYPE> table
[15:26:37] <TYPE> table
[15:27:36] <TYPE> table
[15:28:32] <TYPE> table
[15:28:57] <TYPE> table
[15:29:09] <TYPE> table
[15:31:41] <TYPE> table
[15:32:16] <TYPE> table
[15:33:42] <TYPE> table
[15:34:54] <TYPE> table
[15:35:23] <TYPE> table
[15:35:50] <TYPE> table
[15:36:20] <TYPE> table
[15:37:54] <TYPE> table
[15:38:35] <TYPE> table
[15:40:41] <TYPE> table
[15:40:55] <TYPE> table
[15:41:15] <TYPE> table
[15:42:35] <TYPE> table
[15:42:44] <TYPE> table
[15:45:06] <TYPE> table
[15:47:43] <TYPE> table
[15:47:53] <TYPE> table
[15:48:00] <TYPE> table
[15:48:46] <TYPE> table
[15:48:51] <TYPE> table
[15:49:20] <TYPE> table
[15:49:42] <TYPE> table
[15:50:29] <TYPE> table
[15:50:47] <TYPE> table
[15:52:21] <TYPE> table
[15:52:34] <TYPE> table
[15:52:47] <TYPE> table
[15:53:41] <TYPE> table
[15:55:53] <TYPE> table
[15:57:17] <TYPE> table
[15:57:33] <TYPE> table
[15:58:07] <TYPE> table
[15:58:39] <TYPE> table
[15:58:44] <TYPE> table
[15:59:33] <TYPE> table
[16:00:00] <TYPE> table
[16:01:33] <TYPE> table
[16:02:52] <TYPE> table
[16:03:36] <TYPE> table
[16:04:13] <TYPE> table
[16:04:26] <TYPE> table
[16:05:13] <TYPE> table
[16:06:15] <TYPE> table
[16:08:30] <TYPE> table
[16:10:15] <TYPE> table
[16:10:17] <TYPE> table
[16:11:55] <TYPE> table
[16:15:15] <TYPE> table
[16:16:37] <TYPE> table
[16:17:05] <TYPE> table
[16:17:34] <TYPE> table
[16:17:39] <TYPE> table
[16:18:56] <TYPE> table
[16:20:00] <TYPE> table
[16:22:51] <TYPE> table
[16:25:41] <TYPE> table
[16:26:26] <TYPE> table
[16:26:55] <TYPE> table
[16:28:40] <TYPE> table
[16:28:53] <TYPE> table
[16:29:49] <TYPE> table
[16:29:55] <TYPE> table
[16:30:03] <TYPE> table
[16:30:59] <TYPE> table
[16:32:02] <TYPE> table
[16:32:36] <TYPE> table
[16:33:14] <TYPE> table
[16:34:38] <TYPE> table
[16:37:47] <TYPE> table
[16:38:26] <TYPE> table
[16:38:44] <TYPE> table
[16:39:17] <TYPE> table
[16:39:37] <TYPE> table
[16:40:36] <TYPE> table
[16:43:15] <TYPE> table
[16:43:33] <TYPE> table
[16:43:33] <TYPE> table
[16:46:18] <TYPE> table
[16:46:23] <TYPE> table
[16:46:32] <TYPE> table
[16:46:50] <TYPE> table
[16:47:31] <TYPE> table
[16:49:13] <TYPE> table
[16:49:50] <TYPE> table
[16:51:49] <TYPE> table
[16:52:07] <TYPE> table
[16:52:55] <TYPE> table
[16:55:27] <TYPE> table
[16:56:43] <TYPE> table
[16:57:00] <TYPE> table
[17:00:14] <TYPE> table
[17:00:29] <TYPE> table
[17:00:40] <TYPE> table
[17:01:13] <TYPE> table
[17:02:04] <TYPE> table
[17:02:14] <TYPE> table
[17:02:58] <TYPE> table
[17:03:05] <TYPE> table
[17:03:41] <TYPE> table
[17:04:49] <TYPE> table
[17:06:46] <TYPE> table
[17:07:23] <TYPE> table
[17:08:02] <TYPE> table
[17:08:52] <TYPE> table
[17:10:49] <TYPE> table
[17:11:08] <TYPE> table
[17:11:21] <TYPE> table
[17:11:29] <TYPE> table
[17:11:30] <TYPE> table
[17:11:37] <TYPE> table
[17:11:42] <TYPE> table
[17:12:04] <TYPE> table
[17:12:17] <TYPE> table
[17:12:21] <TYPE> table
[17:12:58] <TYPE> table
[17:13:47] <TYPE> table
[17:14:32] <TYPE> table
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

amenay

Going with the simplest explanation first..Any chance you have a function defined elsewhere in the script calling UserConnected that you're overlooking? (:

bastya_elvtars

Yeah, that was the problem and it's been solved a few hours ago (would be too long to explain here), thanks anyway.
Everything could have been anything else and it would have just as much meaning.

SMF spam blocked by CleanTalk