Ok, I'm finally getting brave, and delving into js scripts. I playing
around with a last callers script. and I've finally got everything to pull up right, and draw right on the screen, but the node number the users were on. This is the string I'm using, but all I'm getting on the report is "unde". Any Ideas how I can extract the last users node number, or is that not available. For the record, i'm modifying Masqurades last callers
utility to show the node. I'm not worrying about spacing, as I was able to change that, all I need is to extract the info. I've read the js docs, and got this far, but now I'm lost...
var node = formatString(users[i].stats.laston_node, 4);
node = colorizeString(node);
var node = formatString(users[i].stats.laston_node, 4);
node = colorizeString(node);
Without more information, no one can guess what hte problem is. For example:
What is this users[] array?
What does the formatString() function do? What does the 2nd argument (4 in this case) specify?
My guess: users[i].stats.laston_node is undefined and somehow formatString() is taking the first 4 characters of "undefined" and place that into the 'node' variable.
Re: JS Last On Node
By: Digital Man to DesotoFireflite on Wed Nov 06 2013 04:19 pm
var node = formatString(users[i].stats.laston_node, 4);
node = colorizeString(node);
Without more information, no one can guess what hte problem is. For example:
What is this users[] array?
What does the formatString() function do? What does the 2nd argument
(4 in this case) specify?
the 4 is the spaces allowed, the rest I borrowed from another command that
I finally got to work after trial and error, and I was hoping I could call node to get the info. Back to the drawing board I go.
My guess: users[i].stats.laston_node is undefined and somehow formatString() is taking the first 4 characters of "undefined" and place that into the 'node' variable.
I will have to do more homework. I took this string from another section that worked and subbed node, but I'm guessing that the node info is not stored in the same file. I guess what I need to know is where the users
last node info is stored, so I can retreive it, then maybe I can figure it out. I'm trying DM, and i'm taking baby steps. Thanks
I'm not sure what you meay by "users last node". The node number that the user last logged onto? That information is not stored in the user database. If you want the *current* node number, just use the bbs.node_num
Sysop: | Ragnarok |
---|---|
Location: | Dock Sud, Bs As, Argentina |
Users: | 136 |
Nodes: | 10 (0 / 10) |
Uptime: | 28:14:24 |
Calls: | 15,172 |
Calls today: | 1 |
Files: | 19,859 |
D/L today: |
18 files (4,249K bytes) |
Messages: | 1,692,457 |