Subj : String for node
To   : DesotoFireflite
From : Digital Man
Date : Sun Dec 13 2020 01:51 pm

 Re: String for node
 By: DesotoFireflite to All on Sun Dec 13 2020 03:33 pm

> I'm playing with Sync JS, and trying to learn it, but I am stumped as how to
> get the node number. To be honest, I've hacked bits and pieces to try to
> make one. Everything displays except the node. Here is the part I'm having a
> issue with. I marked the area with -----. If you can give me the correct
> line I need, or paremeter, and explain it like I'm a 5 year old, it will Be
> appreciated.

The current node number is available in JS via bbs.node_num.
See synchro.net/docs/jsobjs.html for the reference.

> /* Display the first n users in the given array. */
> function displayLastCallers(users, limit)
> {
>     for(var i = 0; (i < users.length) && (i < limit); i++)
>     {
>         var alias = formatString(users[i].alias, 16);
>             alias = colorizeString(alias);
>         var location = formatString(users[i].location, 20);
>             location = colorizeString(location);
>         var lastOn = formatDate(new
> Date(system.timestr(users[i].stats.laston_date)), "NNN. dd, y hh:mma");
>             lastOn = formatString(lastOn, 22);
>             lastOn = colorizeString(lastOn);
>         var mode = formatString(users[i].connection, 6);
>             mode = colorizeString(mode);
>
>         var age = users[i].age;
>         if(users[i].age <= 0)
>         {
>             age = "   ";
>         }
>         else
>         {
>             age = formatString(age, 3);
>             age = colorizeString(age);
>         } ------------------------------------------------------------------
> ------------ Problem Area
>         var node = formatString(system[i].get_node, 2);
>             node = colorizeString(node); -----------------------------------
> -------------------------------------------

"system" is not an array, so that syntax ("system[]") isn't going to work.
Additionally, a user does not have a "node number" property. A user can be on multiple nodes and any node can serve any user, so the association doesn't really make any sense. Are you looking for the last node number that a user used or a node that is currently in-use or what?
--
                                           digital man

Synchronet "Real Fact" #115:
Synchronet v3.18b was released on September 20, 2020 (22 months after v3.17b)
Norco, CA WX: 69.4�F, 18.0% humidity, 0 mph W wind, 0.00 inches rain/24hrs

---
� Synchronet � Vertrauen � Home of Synchronet � [vert/cvs/bbs].synchro.net