• Baja argument help

    From DesotoFireflite@VERT/VALHALLA to All on Sunday, February 13, 2022 13:47:00
    I have a login baja module I use to show users a local message base sub called new if a new message is present since the last time they logged in, and if there is nothing new, it does nothing. This works fine, and have been using it for years:

    !include sbbsdefs.inc
    !include file_io.inc
    !include dir_attr.inc

    SETSTR "LOCAL"
    MSG_SET_GROUP
    SETSTR "NEWS"
    MSG_SET_AREA
    MSG_NEW_SCAN_SUB

    Now, I want to improve on this since this script won't show a guest anything or a new user anything, so I improved it. Now it works as intended for guests and new users, and takes them directly to the new message base where they can read the news, or exit themselves by hitting enter.

    But the way I have it, it also takes the other users to the news message base even if there are no new messages, so I'm sure I have my logic screwed up. It's acting like it's not getting to the secont part. Below is the new file, can someone let me know where I went wrong. Thanks in advance.

    !include sbbsdefs.inc
    !include file_io.inc
    !include dir_attr.inc

    compare_ars LASTON EQUALS 0 OR REST G
    if_true
    # If New User or Guest, go to Local News Message Base and Read News...
    SETSTR "LOCAL"
    MSG_SET_GROUP
    SETSTR "NEWS"
    MSG_SET_AREA
    MSG_READ
    if_false
    # All other users, go to Local message Base, check for new messages In News,
    # and show New Messages and if no New Messages exist, do nothing, and exit.
    SETSTR "LOCAL"
    MSG_SET_GROUP
    SETSTR "NEWS"
    MSG_SET_AREA
    MSG_NEW_SCAN_SUB
    end_if

    SysOp: C.G. Learn, AKA: DesotoFireflite
    Valhalla Home Services! - (Synchronet) - bbs.valhallabbs.com
    Valhalla II! - (GAP) - bbs.valhallabbs.com:24
    Valhalla III! - (RemoteAccess) - bbs.valhallabbs.com:5023
    Valhalla IIII! - (Dungeons & Dragons BBS) - bbs.valhallabbs.com:26
    Valhalla Home Services Web! - http://bbs.valhallabbs.com
    A Gamers Paradise - Over 150 Registered Online Game Doors!
    Home Of Odin's Maze Game Server!

    --- Don't eat the yellow snow!
    Synchronet Valhalla Home Services USA http://valhalla.synchro.net
  • From Digital Man@VERT to DesotoFireflite on Sunday, February 13, 2022 12:11:00
    Re: Baja argument help
    By: DesotoFireflite to All on Sun Feb 13 2022 01:47 pm

    But the way I have it, it also takes the other users to the news message base even if there are no new messages, so I'm sure I have my logic screwed up. It's acting like it's not getting to the secont part. Below is the new file, can someone let me know where I went wrong. Thanks in advance.

    !include sbbsdefs.inc
    !include file_io.inc
    !include dir_attr.inc

    compare_ars LASTON EQUALS 0 OR REST G
    if_true
    # If New User or Guest, go to Local News Message Base and Read News...
    SETSTR "LOCAL"
    MSG_SET_GROUP
    SETSTR "NEWS"
    MSG_SET_AREA
    MSG_READ
    if_false
    # All other users, go to Local message Base, check for new messages In News, # and show New Messages and if no New Messages exist, do nothing, and exit.
    SETSTR "LOCAL"
    MSG_SET_GROUP
    SETSTR "NEWS"
    MSG_SET_AREA
    MSG_NEW_SCAN_SUB
    end_if

    Replace that "if_false" with "else".
    --
    digital man (rob)

    Breaking Bad quote #41:
    Academy hire you right out of the womb? You guys get younger every year!
    Norco, CA WX: 84.1F, 9.0% humidity, 6 mph ENE wind, 0.00 inches rain/24hrs

    ---
    Synchronet Vertrauen Home of Synchronet [vert/cvs/bbs].synchro.net
  • From DesotoFireflite@VERT/VALHALLA to Digital Man on Sunday, February 13, 2022 16:43:00
    Re: Baja argument help
    By: Digital Man to DesotoFireflite on Sun Feb 13 2022 12:11 pm

    Re: Baja argument help
    By: DesotoFireflite to All on Sun Feb 13 2022 01:47 pm

    But the way I have it, it also takes the other users to the news
    message base even if there are no new messages, so I'm sure I have my
    logic screwed up. It's acting like it's not getting to the secont
    part. Below is the new file, can someone let me know where I went
    wrong. Thanks in advance.

    !include sbbsdefs.inc
    !include file_io.inc
    !include dir_attr.inc

    compare_ars LASTON EQUALS 0 OR REST G
    if_true
    # If New User or Guest, go to Local News Message Base and Read News...
    SETSTR "LOCAL"
    MSG_SET_GROUP
    SETSTR "NEWS"
    MSG_SET_AREA
    MSG_READ
    if_false
    # All other users, go to Local message Base, check for new messages In
    News, # and show New Messages and if no New Messages exist, do
    nothing, and exit. SETSTR "LOCAL"
    MSG_SET_GROUP
    SETSTR "NEWS"
    MSG_SET_AREA
    MSG_NEW_SCAN_SUB
    end_if

    Replace that "if_false" with "else".

    Still not working for the regular users, takes them right to the message base. It's like it's not seeing the second part, and giving everyone the first part.
    see below, I changed it as you suggested.

    !include sbbsdefs.inc
    !include file_io.inc
    !include dir_attr.inc

    compare_ars LASTON EQUALS 0 OR REST G
    if_true
    # If New User or Guest, go to Local Message Base and Read News...
    SETSTR "LOCAL"
    MSG_SET_GROUP
    SETSTR "NEWS"
    MSG_SET_AREA
    MSG_READ
    else
    # All other users, go to Local message Base, check for new messages In News, # and show New Messages and if no New Messages exist, do nothing, and exit.
    SETSTR "LOCAL"
    MSG_SET_GROUP
    SETSTR "NEWS"
    MSG_SET_AREA
    MSG_NEW_SCAN_SUB
    end_if

    I can't understand it, I've worked with Baja before, and I thought I undersood it. I'm figuring with a new user, the last on would be 0(zero), and the Guest would be a restriction of "G", hence "compare_ars LASTON EQUALS 0 OR REST G", so as a regular user with no restrictions, and laston field populated with a date, it should be false, and go to else, the second half, but it's acting like it never sees the second half with regular users, but treats them like a new user or guest. I also tried "compare_ars LASTON=0 OR REST G" and got the same results. My logic must be flawed. It may be the LASTON causing the issue, but I don't know another way of determining a new user with ars or any other method.




    SysOp: C.G. Learn, AKA: DesotoFireflite
    Valhalla Home Services! - (Synchronet) - bbs.valhallabbs.com
    Valhalla II! - (GAP) - bbs.valhallabbs.com:24
    Valhalla III! - (RemoteAccess) - bbs.valhallabbs.com:5023
    Valhalla IIII! - (Dungeons & Dragons BBS) - bbs.valhallabbs.com:26
    Valhalla Home Services Web! - http://bbs.valhallabbs.com
    A Gamers Paradise - Over 150 Registered Online Game Doors!
    Home Of Odin's Maze Game Server!

    --- CAT (n.), Furry keyboard cover.
    Synchronet Valhalla Home Services USA http://valhalla.synchro.net
  • From Digital Man@VERT to DesotoFireflite on Sunday, February 13, 2022 14:26:00
    Re: Baja argument help
    By: DesotoFireflite to Digital Man on Sun Feb 13 2022 04:43 pm

    Re: Baja argument help
    By: Digital Man to DesotoFireflite on Sun Feb 13 2022 12:11 pm

    Re: Baja argument help
    By: DesotoFireflite to All on Sun Feb 13 2022 01:47 pm

    But the way I have it, it also takes the other users to the news
    message base even if there are no new messages, so I'm sure I have my
    logic screwed up. It's acting like it's not getting to the secont
    part. Below is the new file, can someone let me know where I went
    wrong. Thanks in advance.

    !include sbbsdefs.inc
    !include file_io.inc
    !include dir_attr.inc

    compare_ars LASTON EQUALS 0 OR REST G
    if_true
    # If New User or Guest, go to Local News Message Base and Read News...
    SETSTR "LOCAL"
    MSG_SET_GROUP
    SETSTR "NEWS"
    MSG_SET_AREA
    MSG_READ
    if_false
    # All other users, go to Local message Base, check for new messages In
    News, # and show New Messages and if no New Messages exist, do
    nothing, and exit. SETSTR "LOCAL"
    MSG_SET_GROUP
    SETSTR "NEWS"
    MSG_SET_AREA
    MSG_NEW_SCAN_SUB
    end_if

    Replace that "if_false" with "else".

    Still not working for the regular users, takes them right to the message base. It's like it's not seeing the second part, and giving everyone the first part. see below, I changed it as you suggested.

    !include sbbsdefs.inc
    !include file_io.inc
    !include dir_attr.inc

    compare_ars LASTON EQUALS 0 OR REST G
    if_true
    # If New User or Guest, go to Local Message Base and Read News...
    SETSTR "LOCAL"
    MSG_SET_GROUP
    SETSTR "NEWS"
    MSG_SET_AREA
    MSG_READ
    else
    # All other users, go to Local message Base, check for new messages In News, # and show New Messages and if no New Messages exist, do nothing, and exit.
    SETSTR "LOCAL"
    MSG_SET_GROUP
    SETSTR "NEWS"
    MSG_SET_AREA
    MSG_NEW_SCAN_SUB
    end_if

    I can't understand it, I've worked with Baja before, and I thought I undersood it. I'm figuring with a new user, the last on would be 0(zero), and the Guest would be a restriction of "G", hence "compare_ars LASTON EQUALS 0 OR REST G", so as a regular user with no restrictions, and laston field populated with a date, it should be false, and go to else, the second half, but it's acting like it never sees the second half with regular users, but treats them like a new user or guest. I also tried "compare_ars LASTON=0 OR REST G" and got the same results. My logic must be flawed. It may be the LASTON causing the issue, but I don't know another way of determining a new user with ars or any other method.

    LASTON is initialized to the current date/time when a new user account is created. "LOGONS" is probably the value you want to be checking. It should be equal to 1 for a user's first logon.

    By what you're describing, the second "else" section should *always* be executing and it's the first ("if_true") section that isn't being executed. In that case, fixing the ARS should solve that.
    --
    digital man (rob)

    Synchronet "Real Fact" #30:
    The COM I/O routines for Synchronet for DOS were written in ASM by Steve Deppe Norco, CA WX: 86.6F, 9.0% humidity, 1 mph SW 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, February 14, 2022 15:51:00
    Re: Baja argument help
    By: Digital Man to DesotoFireflite on Sun Feb 13 2022 02:26 pm

    I can't understand it, I've worked with Baja before, and I thought I
    undersood it. I'm figuring with a new user, the last on would be
    0(zero), and the Guest would be a restriction of "G", hence
    "compare_ars LASTON EQUALS 0 OR REST G", so as a regular user with no
    restrictions, and laston field populated with a date, it should be
    false, and go to else, the second half, but it's acting like it never
    sees the second half with regular users, but treats them like a new
    user or guest. I also tried "compare_ars LASTON=0 OR REST G" and got
    the same results. My logic must be flawed. It may be the LASTON
    causing the issue, but I don't know another way of determining a new
    user with ars or any other method.

    LASTON is initialized to the current date/time when a new user account is created. "LOGONS" is probably the value you want to be checking. It should be equal to 1 for a user's first logon.

    By what you're describing, the second "else" section should *always* be executing and it's the first ("if_true") section that isn't being executed. In that case, fixing the ARS should solve that.

    "LOGONS" was the key, it's working like I want it to now. I cleaned up the code a bit, so it doesn't look as klunky, see below. Thanks for the help.

    !include sbbsdefs.inc
    !include file_io.inc
    !include dir_attr.inc

    SETSTR "LOCAL"
    MSG_SET_GROUP
    SETSTR "NEWS"
    MSG_SET_AREA

    compare_ars LOGONS=1 OR REST G
    if_true
    # If New User or Guest, go to Local Message Base and Read News...
    MSG_READ
    else
    # All other users, go to Local message Base, check for new messages In News, and
    # show New Messages and if no New Messages exist, do nothing, and exit.
    MSG_NEW_SCAN_SUB
    end_if

    SysOp: C.G. Learn, AKA: DesotoFireflite
    Valhalla Home Services! - (Synchronet) - bbs.valhallabbs.com
    Valhalla II! - (GAP) - bbs.valhallabbs.com:24
    Valhalla III! - (RemoteAccess) - bbs.valhallabbs.com:5023
    Valhalla IIII! - (Dungeons & Dragons BBS) - bbs.valhallabbs.com:26
    Valhalla Home Services Web! - http://bbs.valhallabbs.com
    A Gamers Paradise - Over 150 Registered Online Game Doors!
    Home Of Odin's Maze Game Server!

    --- Don't eat the yellow snow!
    Synchronet Valhalla Home Services USA http://valhalla.synchro.net