• String for node

    From DesotoFireflite@VERT/VALHALLA to All on Sunday, December 13, 2020 15:33:58
    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.

    /* 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); ------------------------------------------------------------------------------
    var lastCallerStr = alias + " " + age + " " + location + " " + lastOn + " " + mode + " " + node;

    console.gotoxy(4, 8 + i);
    console.print(lastCallerStr);
    }
    }

    SysOp: C.G. Learn, AKA: DesotoFireflite
    Valhalla Home Services! - (Synchronet) - bbs.valhallabbs.com
    Valhalla II! - (GAP) - bbs.valhallabbs.com:24
    A Gamers Paradise - Over 150 Registered Online Game Doors!

    Home Of Odin's Maze Game Server!
    Come Play Trade Wars On Valhalla's T.W.G.S!

    --- FART(n): An audio test of one's waste-disposal system.
    þ Synchronet þ Valhalla Home Services þ USA þ http://valhalla.synchro.net
  • From Digital Man@VERT to DesotoFireflite on Sunday, December 13, 2020 13:51:26
    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
  • From DesotoFireflite@VERT/VALHALLA to Digital Man on Monday, December 14, 2020 10:12:29
    Re: String for node
    By: Digital Man to DesotoFireflite on Sun Dec 13 2020 01:51 pm

    "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

    Actually, I'm looking for the node number this particular person is on at the time this .js is run. It's a last callers bulletin.

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

    I think I tried that, but I'll try it again. I should have written down the things I've tried.

    As always, thanks

    SysOp: C.G. Learn, AKA: DesotoFireflite
    Valhalla Home Services! - (Synchronet) - bbs.valhallabbs.com
    Valhalla II! - (GAP) - bbs.valhallabbs.com:24
    A Gamers Paradise - Over 150 Registered Online Game Doors!

    Home Of Odin's Maze Game Server!
    Come Play Trade Wars On Valhalla's T.W.G.S!

    --- Don't eat the yellow snow!
    þ Synchronet þ Valhalla Home Services þ USA þ http://valhalla.synchro.net
  • From DesotoFireflite@VERT/VALHALLA to Digital Man on Monday, December 14, 2020 16:05:33
    Re: String for node
    By: Digital Man to DesotoFireflite on Sun Dec 13 2020 01:51 pm

    The current node number is available in JS via bbs.node_num.

    var node = formatString(bbs[i].node_num, 2);
    node = colorizeString(node);

    Doesn't work

    var node = formatString(bbs.node_num, 2);
    node = colorizeString(node);

    Does work, but it fills every users node with the same number, looking to update for the one person only thats online at this time.

    "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? --

    the node the person is on at the present time. the same as stored in synchronets users on today.

    SysOp: C.G. Learn, AKA: DesotoFireflite
    Valhalla Home Services! - (Synchronet) - bbs.valhallabbs.com
    Valhalla II! - (GAP) - bbs.valhallabbs.com:24
    A Gamers Paradise - Over 150 Registered Online Game Doors!

    Home Of Odin's Maze Game Server!
    Come Play Trade Wars On Valhalla's T.W.G.S!

    --- SENILE.COM found...Out of Memory...
    þ Synchronet þ Valhalla Home Services þ USA þ http://valhalla.synchro.net
  • From Digital Man@VERT to DesotoFireflite on Monday, December 14, 2020 21:09:28
    Re: String for node
    By: DesotoFireflite to Digital Man on Mon Dec 14 2020 10:12 am

    Re: String for node
    By: Digital Man to DesotoFireflite on Sun Dec 13 2020 01:51 pm

    "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

    Actually, I'm looking for the node number this particular person is on at the time this .js is run. It's a last callers bulletin.

    So bbs.node_num will contain the *current* node number when the script is run. If you want to display the node number that a user used when they were last on, I suggest looking at logonlist.js and logonlist_lib.js.

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

    I think I tried that, but I'll try it again. I should have written down the things I've tried.

    Unless you're writing the node number to a file for later retrieval/display, that's probably not what you're looking for. The current node number (and a lot of other information) is already being written to data/logon.jsonl, so probably best to just read/use that data (using the .js mods I pointed to you above).
    --
    digital man

    Synchronet/BBS Terminology Definition #70:
    SMTP = Simple Message Transfer Protocol
    Norco, CA WX: 55.5øF, 38.0% humidity, 1 mph S wind, 0.02 inches rain/24hrs
    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Digital Man@VERT to DesotoFireflite on Monday, December 14, 2020 21:11:09
    Re: String for node
    By: DesotoFireflite to Digital Man on Mon Dec 14 2020 04:05 pm

    Re: String for node
    By: Digital Man to DesotoFireflite on Sun Dec 13 2020 01:51 pm

    The current node number is available in JS via bbs.node_num.

    var node = formatString(bbs[i].node_num, 2);
    node = colorizeString(node);

    Doesn't work

    I wouldn't expect it to: 'bbs' is not an array.

    var node = formatString(bbs.node_num, 2);
    node = colorizeString(node);

    Does work, but it fills every users node with the same number, looking to update for the one person only thats online at this time.

    Yes, like I stated in my previous message, that's probably not the data you're looking for (even though that's what you asked for).

    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? --

    the node the person is on at the present time. the same as stored in synchronets users on today.

    See data/logon.jsonl and exec/logonlist.js and exec/load/logonlist_lib.js
    --
    digital man

    This Is Spinal Tap quote #12:
    Nigel Tufnel: Well, I don't know - wh-wh-... what're the hours?
    Norco, CA WX: 55.5øF, 38.0% humidity, 1 mph S wind, 0.02 inches rain/24hrs
    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From DesotoFireflite@VERT/VALHALLA to Digital Man on Wednesday, December 16, 2020 14:50:26
    Re: String for node
    By: Digital Man to DesotoFireflite on Mon Dec 14 2020 09:11 pm

    the node the person is on at the present time. the same as stored in
    synchronets users on today.

    See data/logon.jsonl and exec/logonlist.js and exec/load/logonlist_lib.js

    I saw those, and honestly, I don't have what it takes to figure it out. I bow my head in shame, but thats way over my head at the stage I am at trying to learn. I'll keep working on it, as I did figure out some other stuff, but I just can't figure out how to pull the node out of it. Thanks for trying to help, hopefully in time I will understand enough js to figure it out myself.

    Thanks for trying DM, I do appreciate it.

    SysOp: C.G. Learn, AKA: DesotoFireflite
    Valhalla Home Services! - (Synchronet) - bbs.valhallabbs.com
    Valhalla II! - (GAP) - bbs.valhallabbs.com:24
    A Gamers Paradise - Over 150 Registered Online Game Doors!

    Home Of Odin's Maze Game Server!
    Come Play Trade Wars On Valhalla's T.W.G.S!

    --- Don't eat the yellow snow!
    þ Synchronet þ Valhalla Home Services þ USA þ http://valhalla.synchro.net
  • From Digital Man@VERT to DesotoFireflite on Wednesday, December 16, 2020 13:17:17
    Re: String for node
    By: DesotoFireflite to Digital Man on Wed Dec 16 2020 02:50 pm

    Re: String for node
    By: Digital Man to DesotoFireflite on Mon Dec 14 2020 09:11 pm

    the node the person is on at the present time. the same as stored in
    synchronets users on today.

    See data/logon.jsonl and exec/logonlist.js and exec/load/logonlist_lib.js

    I saw those, and honestly, I don't have what it takes to figure it out. I bow my head in shame, but thats way over my head at the stage I am at trying to learn. I'll keep working on it, as I did figure out some other stuff, but I just can't figure out how to pull the node out of it. Thanks for trying to help, hopefully in time I will understand enough js to figure it out myself.

    Thanks for trying DM, I do appreciate it.

    Here's a simplified example:

    var list = load({}, "logonlist_lib.js").get();
    for(var l in list)
    print(list[l].node + " " + list[l].user.alias);

    There's a lot more information available than just user alias and node number, but I was just including those fields as an example. You can use this to print the entire logon info object instead of just those 2 fields, if you're curious:
    print(lfexpand(JSON.stringify(list[l], null, 4)));
    --
    digital man

    Synchronet/BBS Terminology Definition #28:
    FDSZ = FOSSIL DSZ (by Chuck Forsberg)
    Norco, CA WX: 73.2øF, 21.0% humidity, 0 mph E wind, 0.00 inches rain/24hrs
    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From DesotoFireflite@VERT/VALHALLA to Digital Man on Wednesday, December 16, 2020 16:58:24
    Re: String for node
    By: Digital Man to DesotoFireflite on Wed Dec 16 2020 01:17 pm

    Here's a simplified example:

    var list = load({}, "logonlist_lib.js").get();
    for(var l in list)
    print(list[l].node + " " + list[l].user.alias);

    There's a lot more information available than just user alias and node number, but I was just including those fields as an example. You can use this to print the entire logon info object instead of just those 2 fields, if you're curious:
    print(lfexpand(JSON.stringify(list[l], null, 4)));
    --

    Thanks, that does help, at least it puts it where I think I can get a grip on it mentally. I'll let you know how it goes after I work with it a bit. Again, thanks for all you do.

    SysOp: C.G. Learn, AKA: DesotoFireflite
    Valhalla Home Services! - (Synchronet) - bbs.valhallabbs.com
    Valhalla II! - (GAP) - bbs.valhallabbs.com:24
    A Gamers Paradise - Over 150 Registered Online Game Doors!

    Home Of Odin's Maze Game Server!
    Come Play Trade Wars On Valhalla's T.W.G.S!

    --- Don't You Know, Can't You See, Don't You Understand!
    þ Synchronet þ Valhalla Home Services þ USA þ http://valhalla.synchro.net