• Mystic Python getuser data

    From modchaos@21:2/112 to All on Monday, February 27, 2017 12:18:00
    Just have a quick question on the getuser function. Is there a listing of
    data that we can retrieve for the current user in python.
    Maybe the better question is:
    Is there a documented list or data file i can get the properties of the
    object getuser(0) returns?

    Thanks,
    Modchaos


    ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ
    Ż Modchaos - The Hub - bbs.bbshub.net Ž

    --- Mystic BBS v1.12 A31 (Linux)
    * Origin: The Hub [FSXNet 21:2/112) bbs.bbshub.net (21:2/112)
  • From Avon@21:1/101 to modchaos on Tuesday, February 28, 2017 08:03:00
    On 02/27/17, modchaos pondered and said...

    Just have a quick question on the getuser function. Is there a listing of data that we can retrieve for the current user in python.
    Maybe the better question is:
    Is there a documented list or data file i can get the properties of the object getuser(0) returns?

    I'm not a coder (yet) more a wanna be.

    In the records.112 file I see this

    [snip]

    Type
    RecUser = Record // USERS.DAT
    PermIdx : LongInt; // permanent user number
    Flags : LongInt; // User Flags
    bitmap
    Handle : String[30]; // Handle
    RealName : String[30]; // Real Name
    Password : String[15]; // Password
    Address : String[30]; // Address
    City : String[25]; // City
    ZipCode : String[9]; // Zipcode
    HomePhone : String[15]; // Home Phone
    DataPhone : String[15]; // Data phone
    Birthday : LongInt; //
    Gender : Char; // M/F/U
    Email : String[60];
    OptionData : Array[1..10] of String[60];
    UserInfo : String[30];
    Theme : String[20];
    AF1 : AccessFlagType;
    AF2 : AccessFlagType;
    Security : SmallInt;
    Expires : String[8];
    ExpiresTo : Byte;
    LastPWChange : String[8];
    StartMenu : String[20];
    Archive : String[4];
    QwkFiles : Boolean;
    DateType : Byte;
    ScreenSize : Byte;
    ScreenCols : Byte;
    PeerIP : String[20];
    PeerHost : String[50];
    FirstOn : LongInt; // Date/Time of First Call
    LastOn : LongInt; // Date/Time of
    Last Call
    Calls : LongInt; // Number of calls to BBS
    CallsToday : SmallWord; // Number of calls today
    DLs : SmallWord; // # of downloads
    DLsToday : SmallWord; // # of downloads today
    DLk : LongInt; // # of downloads
    in K
    DLkToday : LongInt; // # of downloaded
    K today
    ULs : LongInt; // total number of uploads
    ULk : LongInt; // total number of uploaded K
    Posts : LongInt; // total number of msg posts
    Emails : LongInt; // total number of sent email
    TimeLeft : LongInt; // time left
    online for today
    TimeBank : SmallInt; // number of mins
    in timebank
    FileRatings : LongInt;
    FileComment : LongInt;
    LastFBase : Word; // Last file base
    LastMBase : Word; // Last message
    base
    LastMGroup : Word; // Last group accessed
    LastFGroup : Word; // Last file group accessed
    Vote : Array[1..20] of Byte; // Voting booth
    data
    EditType : Byte; // 0 = Line, 1 = Full, 2 = Ask
    FileList : Byte; // 0 = Normal, 1 = Lightbar
    SigUse : Boolean; // Use auto-signature?
    SigOffset : LongInt; // offset to sig
    in AUTOSIG.DAT
    SigLength : Byte; // number of lines in sig
    HotKeys : Boolean; // does user have hotkeys on?
    MReadType : Byte; // 0 = line 1 =
    full 2 = ask
    UseLBIndex : Boolean; // use lightbar index?
    UseLBQuote : Boolean; // use lightbar quote mode
    UseLBMIdx : Boolean; // use lightbar index in email?
    UseFullChat : Boolean; // use full screen teleconference
    Credits : LongInt;
    Protocol : Char;
    UNUSED : Byte;
    QwkExtended : Boolean;
    QwkNetwork : LongInt;
    EmailValCode : String[8];
    EmailValSent : LongInt;
    EmailValDate : LongInt;
    Reserved : Array[1..366] of Byte;
    End;


    [snip]


    I also found this info in some old MPL docs


    [snip]

    Function GETUSER (N: Integer) : Boolean

    This procedure will read user data into the USER variables. The
    supplied N is the record number to read. The function returns
    true if the record was read, or false if a record was not read.
    The following USER variables will be set when a record is read:

    Variable Name Type Description
    -------------------------------------------------------------------
    USERDELETED Boolean Is the user marked as deleted?
    USERNAME String User's real name.
    USERALIAS String User's BBS alias.
    USERPASSWORD String User's password.
    USERADDRESS String User's street address.
    USERCITY String User's City/State.
    USERBIRTHDAY String User's birth date.
    USERSEX Char User's gender (M = Male, F = FeMale).
    USERSEC Byte User's security level (0-255).
    USERFIRSTON LongInt User's date/time of first call to the BBS.
    This is stored in the packed date format
    so in order to display the date & time,
    the functions of DATESTR and TIMESTR need
    to be used.
    USERLASTON LongInt User's date/time of the last call to the
    BBS. This is also stored in a packed date
    format, so the same rules for USERFIRST
    apply to this.
    -------------------------------------------------------------------


    [snip]

    Best, Paul

    --- Mystic BBS v1.12 A31 (Windows)
    * Origin: Agency BBS | telnet://agency.bbs.geek.nz (21:1/101)
  • From modchaos@21:2/112 to Avon on Monday, February 27, 2017 22:21:00
    Thanks for the thoughts
    On 02/28/17, Avon said the following...

    On 02/27/17, modchaos pondered and said...

    Just have a quick question on the getuser function. Is there a listin data that we can retrieve for the current user in python.
    Maybe the better question is:
    Is there a documented list or data file i can get the properties of t object getuser(0) returns?

    I'm not a coder (yet) more a wanna be.

    In the records.112 file I see this

    Thanks Paul! I did actually try and use various ways of typing "ZipCode" without success.

    I am also having an issue with using some python libs outside of Mystic when running a module in Mystic. I am going to try a few other things first before laughing too much


    ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ
    Ż Modchaos - The Hub - bbs.bbshub.net Ž

    --- Mystic BBS v1.12 A31 (Linux)
    * Origin: The Hub [FSXNet 21:2/112) bbs.bbshub.net (21:2/112)
  • From Pequito@21:1/126 to modchaos on Monday, February 27, 2017 16:01:00
    On 02/27/17, modchaos said the following...

    Thanks for the thoughts
    On 02/28/17, Avon said the following...

    On 02/27/17, modchaos pondered and said...

    Just have a quick question on the getuser function. Is there a l data that we can retrieve for the current user in python.
    Maybe the better question is:
    Is there a documented list or data file i can get the properties object getuser(0) returns?

    I'm not a coder (yet) more a wanna be.

    In the records.112 file I see this

    Thanks Paul! I did actually try and use various ways of typing "ZipCode" without success.


    Here is the function in detail:


    Function GETUSER (N: Integer) : Boolean

    This procedure will read user data into the USER variables. The
    supplied N is the record number to read. The function returns
    true if the record was read, or false if a record was not read.
    The following USER variables will be set when a record is read:

    Variable Name Type Description
    -------------------------------------------------------------------
    USERDELETED Boolean Is the user marked as deleted?
    USERNAME String User's real name.
    USERALIAS String User's BBS alias.
    USERPASSWORD String User's password.
    USERADDRESS String User's street address.
    USERCITY String User's City/State.
    USERZIP String User's ZipCode.
    USERHPHONE String User's home phone number.
    USERDPHONE String User's data phone number.
    USERBDAY String User's birth date.
    USERSEX Char User's gender (M = Male, F = FeMale).
    USERSEC Byte User's security level (0-255).
    USERMENU String User's Starting Menu (if blank, Mystic
    uses the default menu as setup in the
    configuration).
    USERFIRST LongInt User's date/time of first call to the BBS.
    This is stored in the packed date format
    so in order to display the date & time,
    the functions of DATESTR and TIMESTR need
    to be used.
    USERLAST LongInt User's date/time of the last call to the
    BBS. This is also stored in a packed date
    format, so the same rules for USERFIRST
    apply to this.
    USERCALLS LongInt User's total calls to the BBS system.
    USERTCALLS Integer User's number of calls to the BBS today.
    USERDLS LongInt User's total # of downloaded files.
    USERTDLS Integer User's total # of downloaded files today.
    -------------------------------------------------------------------

    Example:

    Var A Integer

    A := 1
    While GetUser(A)
    WriteLn ('User Alias: ', UserAlias)
    A := A + 1
    WEnd

    The above example will list all user accounts on the BBS system.

    +- $s.s$s.s$ ----------------------------------------+
    | $ż"$$$"ż$ twinklebbs.homeip.net |
    | .$$$. winkle BBS twinklebbs.homeip.net:8080 |
    +-- .$$$$$. -----------------------------------------+
    $ż"~"ż$ Christopher Malo aka Pequito!

    --- Mystic BBS v1.12 A31 (Linux)
    * Origin: Twinkle BBS (21:1/126)
  • From Avon@21:1/101 to modchaos on Tuesday, February 28, 2017 12:32:00
    On 02/27/17, modchaos pondered and said...

    I am also having an issue with using some python libs outside of Mystic when running a module in Mystic. I am going to try a few other things first before laughing too much

    Keep in mind g00r00 had only implemented a little of the mystic functions
    found in MPL in to Python at this early stage. I think his motivation to do more would be driven by the demand and creativity of others wanting to take advantage of Python. I certainly encouraged him to add Python support at the time as to me it's the modern day BASIC

    Make sure you use Python 2.7 with Mystic and not Python 3.x

    Best, Paul

    --- Mystic BBS v1.12 A31 (Windows)
    * Origin: Agency BBS | telnet://agency.bbs.geek.nz (21:1/101)
  • From Avon@21:1/101 to Pequito on Tuesday, February 28, 2017 12:33:00
    On 02/27/17, Pequito pondered and said...

    Here is the function in detail:

    Top man - thanks :)

    Best, Paul

    --- Mystic BBS v1.12 A31 (Windows)
    * Origin: Agency BBS | telnet://agency.bbs.geek.nz (21:1/101)
  • From modchaos@21:2/112 to Avon on Tuesday, February 28, 2017 04:13:00
    Keep in mind g00r00 had only implemented a little of the mystic functions found in MPL in to Python at this early stage. I think his motivation to do more would be driven by the demand and creativity of others wanting
    to take advantage of Python. I certainly encouraged him to add Python support at the time as to me it's the modern day BASIC

    Make sure you use Python 2.7 with Mystic and not Python 3.x

    Best, Paul

    Thanks! I am using Python 2.7 for sure. I am able to get the "handle" which
    for the current user in session would be

    getuser(0)["handle"]
    This actually comes back with the handle. Maybe g00r00 didn't add the zipcode to the python method properties. I cannot even find a mystic python library anywhere.

    I am used to writing python code for WebSphere and R and data science work so figured this would be a good fit.

    Thanks


    ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ
    Ż Modchaos - The Hub - bbs.bbshub.net Ž

    --- Mystic BBS v1.12 A31 (Linux)
    * Origin: The Hub [FSXNet 21:2/112) bbs.bbshub.net (21:2/112)
  • From Avon@21:1/101 to modchaos on Tuesday, February 28, 2017 19:48:00
    On 02/28/17, modchaos pondered and said...

    This actually comes back with the handle. Maybe g00r00 didn't add the zipcode to the python method properties. I cannot even find a mystic python library anywhere.

    The only docs we have thus far is the python.txt And as far as I can tell
    it's this section below that speaks to what has been enabled and is yet to
    come etc.

    Apologies for the large snip to follow

    [snip]

    MYSTIC PYTHON INTEGRATED BBS FUNCTIONS
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    (THIS IS A WORK IN PROGRESS... PLANNING STAGES....

    IMPLEMENTED BBS-SPECIFIC FUNCTIONS:

    write
    writeln
    menucmd
    getkey
    shutdown
    getstr
    getuser
    onekey
    keypressed

    PLANNED:

    Of course you get all of the Python stuff plus these functions:

    RETURNS FUNCTION NAME PARAMETERS

    INPUT/OUTPUT:

    (none) clear (none)
    (none) cleareol (none)
    (char, bool) getkey (none)
    (string) getstr (<mode>byte, <fieldsize>byte, <maxsize>byte, <default>string)
    (bool) getyn (<text>string, <default>bool)
    (none) gotoxy (<x>byte, <y>byte)
    (bool) keypressed (<waitTime>?) or separate waitKey function with MS timer?
    (char) moreprompt (none)
    (none) movex (<x>byte)
    (none) movey (<x>byte)
    (char) onekey (<keys>string, <echo>bool)
    (char,integer) onekeyrange (<keys>string, <min>integer, <max>integer
    (none) out (string)
    (none) outln (string)
    (none) pause (none)
    (none) pipe (string)
    (none) pipeln (string)
    (none) purgeinput (none)
    (bool) showfile (<file>string, <baudrate>integer, <pause>bool)
    (none) stuffkey (<keys>string)
    (byte) textattr (none)
    (byte) wherex (none)
    (byte) wherey (none)
    (none) write (string)
    (none) writeln (string)
    (none) writexy (<x>byte, <y>byte, <attr>byte, text<string>)
    (none) writexypipe (<x>byte, <y>byte, <attr>byte, <pad>byte, text<string>

    STRING FUNCTIONS:

    (byte) mcilen (string)
    (string) mci2str (string)

    MISCELLANOUS / UNSORTED:

    (bool) access (<acs>string)
    (none) appendtext (<filename>string, <text>string)
    (byte) getcodepage (none)
    (byte) getgraphics (none)
    (bool) ignoregroups (<optional on or off>bool) * IF this can
    be done they do same for codepage, textattr,graphics etc
    (string) getprompt (<promptnumber>integer)
    (none) hangup (none)
    (none) log (<level>byte, <category>char, <text>string)
    (none) menucmd (<cmd>string, <data>string)
    (byte) node (none)
    (none) setprompt (<promptnumber>integer, <text>string)
    (bool) shutdown (none)
    (none) upgradeuser (<level>byte)



    key missing things TODO:

    need to pass paramenters to the program somehow
    need formatDate and various conversion functions
    thisuser, user, msg areas, msg headers, msg text, file areas, file list
    ansi buffer,
    msg editor, ansi editor, text editor
    box, listbox, screen save/restore, extended input
    getattr putattr
    getmailstats
    getmsgbasestats
    helper string functions from MPL?

    [snip]

    Best, Paul

    --- Mystic BBS v1.12 A31 (Windows)
    * Origin: Agency BBS | telnet://agency.bbs.geek.nz (21:1/101)
  • From bcw142@21:1/145.1 to modchaos on Tuesday, February 28, 2017 10:39:00
    On 02/28/17, modchaos said the following...
    Thanks! I am using Python 2.7 for sure. I am able to get the "handle" which for the current user in session would be

    getuser(0)["handle"]
    This actually comes back with the handle. Maybe g00r00 didn't add the zipcode to the python method properties. I cannot even find a mystic python library anywhere.

    USERZIP String User's ZipCode.

    so look for USERZIP or more likey userzip, it should be there ;)

    --- Mystic BBS v1.11 (Raspberry Pi)
    * Origin: Old Mystic Pi BBS bcw142.zapto.org:2324 (21:1/145.1)
  • From Black Panther@21:1/186 to Pequito on Wednesday, March 01, 2017 12:47:00
    On 02/27/17, Pequito said the following...

    Here is the function in detail:

    Function GETUSER (N: Integer) : Boolean

    This procedure will read user data into the USER variables. The
    supplied N is the record number to read. The function returns
    true if the record was read, or false if a record was not read.

    Where did you find this? I've been looking for something like this for the
    main configuration data file, and haven't been able to find it.

    Thanks,


    ---
    Dan Richter
    aka Black Panther
    Sysop - Castle Rock BBS
    telnet://castlerockbbs.com
    The sparrows are flying again...

    --- Mystic BBS v1.12 A31 (Windows)
    * Origin: Castle Rock BBS - castlerockbbs.com (21:1/186)
  • From Pequito@21:1/126 to Black Panther on Wednesday, March 01, 2017 22:56:00
    On 03/01/17, Black Panther said the following...

    On 02/27/17, Pequito said the following...

    Here is the function in detail:

    Function GETUSER (N: Integer) : Boolean

    This procedure will read user data into the USER variables.
    supplied N is the record number to read. The function retur
    true if the record was read, or false if a record was not re

    Where did you find this? I've been looking for something like this for
    the main configuration data file, and haven't been able to find it.


    Its our special blend of secret! khaha nah there is a file on most systems
    that has this information in it.

    File to look for: mpldoc_a59.zip

    I has it and I think a few other systems do as well, its out dated but you
    can view the whats new on the releases to see whats changed etc.

    Cheers!
    Pequito

    +- $s.s$s.s$ ----------------------------------------+
    | $ż"$$$"ż$ twinklebbs.homeip.net |
    | .$$$. winkle BBS twinklebbs.homeip.net:8080 |
    +-- .$$$$$. -----------------------------------------+
    $ż"~"ż$ Christopher Malo aka Pequito!

    --- Mystic BBS v1.12 A31 (Linux)
    * Origin: Twinkle BBS (21:1/126)
  • From Black Panther@21:1/186 to Pequito on Wednesday, March 01, 2017 23:31:00
    On 03/01/17, Pequito said the following...

    Where did you find this? I've been looking for something like this fo the main configuration data file, and haven't been able to find it.

    Its our special blend of secret! khaha nah there is a file on most

    Hahaha. Don't make me drive down to your house... :)

    I has it and I think a few other systems do as well, its out dated but
    you can view the whats new on the releases to see whats changed etc.

    Awesome. I'll have to get on your board and see if I can find it.

    Thank you Sir.


    ---
    Dan Richter
    aka Black Panther
    Sysop - Castle Rock BBS
    telnet://castlerockbbs.com
    The sparrows are flying again...

    --- Mystic BBS v1.12 A31 (Windows)
    * Origin: Castle Rock BBS - castlerockbbs.com (21:1/186)
  • From Gryphon@21:1/120 to Pequito on Wednesday, March 08, 2017 23:25:00
    On 03/01/17, Pequito said the following...

    On 03/01/17, Black Panther said the following...

    On 02/27/17, Pequito said the following...

    Here is the function in detail:

    Function GETUSER (N: Integer) : Boolean

    This procedure will read user data into the USER variab
    supplied N is the record number to read. The function
    true if the record was read, or false if a record was n

    Where did you find this? I've been looking for something like this fo the main configuration data file, and haven't been able to find it.


    Its our special blend of secret! khaha nah there is a file on most
    systems that has this information in it.

    File to look for: mpldoc_a59.zip

    I has it and I think a few other systems do as well, its out dated but
    you can view the whats new on the releases to see whats changed etc.

    That document needs to be updated. I made that document after the 110a59
    alpha so there's been a lot of changes to mplc since then. But I think I've tried to update the wiki with some more up to date info.

    "No matter where you go, there you are!" - Buckaroo Bonzai

    --- Mystic BBS v1.12 A31 (Raspberry Pi)
    * Origin: Cyberia BBS | Cyberia.Darktech.Org | Kingwood, TX (21:1/120)