• new python commans

    From dream master@21:1/163 to g00r00 on Saturday, December 02, 2017 03:13:36
    will you be adding these in the python demo? also will the dra
    wbox befunctional? seeing all these new mpl command as well
    is like Christmascoming early ;) .
    úùDream Masterùú
    . øùúùøøùúùø
    DoRE!ACiDiC!Demonic[dream
    land.darktech.org]
    --- Mystic BBS v1.12 A36 2017/12/01 (Windows/64)
    * Origin: |08--[|15!|07dreamland BBS dreamland.darktech.org (21:1/163)
  • From g00r00@21:1/108 to dream master on Saturday, December 02, 2017 13:31:59
    will you be adding these in the python demo? also will the drawbox be functional? seeing all these new mpl command as well is like Christmas coming early ;)

    For the message reading Python stuff there is a demo in the scripts directory of the new install, all of the other commands were shown in the WHATSNEW I think.

    There will be box and listbox functions in Python as well, yes. Its just a matter of figuring out how I want it all to work. Getting the message access done was a big win because it required a lot of behind the scene changes to my engine that I needed to do so I can add other things as well.

    I'll paste the reader example here:

    #####################################################
    # Simple Message Reader Example using Mystic Python # #####################################################

    # Reads messages in the user's current message base
    # With a pause prompt that allows quitting

    from mystic_bbs import *

    # Load the current user and then load their current message base
    # but fail if they have not selected a message base

    user = getuser(0)
    mbase = getmbaseid(user["mbase"])

    if mbase is None:
    writeln ("|CRYou have not selected a message base yet!|CR|CR|PA")
    quit()

    # Open the message base then check to make sure its open before reading
    # data from it

    msg = msg_open(mbase["path"] + mbase["filename"]);

    if msg is None:
    quit()

    done = False

    # Seek to the first message in the base and loop while a message
    # is found, calling msg_next after each message so the next one
    # will be loaded. Seek must be called first even if reading
    # from the first message.

    msg_seek(msg, 0)

    while msg_found(msg) and not done and not shutdown():

    # Load the message header information into a dictionary
    # and the message text into a list

    msghdr = msg_gethdr(msg)
    msgtext = msg_gettxt(msg)

    # Show the message header, setting a line counter that can
    # be used to pause the screen

    pausecount = 3

    writeln("From: " + msghdr["from"]);
    writeln(" To: " + msghdr["to"]);
    writeln("Subj: " + msghdr["subj"]);
    writeln("-----");

    # loop through each line in the message (list) and pause when
    # we get more than 23 lines

    for line in msgtext:
    pausecount += 1

    writeln(line)

    if pausecount >= 23:
    pausecount = 1

    write("*PAUSE* (ENTER) to continue, (Q) to Quit: ")

    if onekey(chr(13) + 'Q', True) == 'Q':
    done = True
    break

    # Load the next message

    msg_next(msg);

    # Close the message base and report that we're done

    msg_close(msg)

    writeln("|CRProgram complete.");

    --- Mystic BBS v1.12 A36 2017/12/01 (Windows/64)
    * Origin: Sector 7 [Mystic BBS WHQ] (21:1/108)
  • From dream master@21:1/163 to g00r00 on Saturday, December 02, 2017 17:16:29
    On 12/02/17, g00r00 said the following...
    There will be box and listbox functions in Python as well, yes. Its
    just a matter of figuring out how I want it all to work. Getting the message access done was a big win because it required a lot of behind
    the scene changes to my engine that I needed to do so I can add other things as well.
    I'll paste the reader example here:

    it's good to be with mystic hehe

    |08 .|05ú|13ù|15Dr|07e|08am Ma|07st|15er|13ù|05ú|08.
    |08 øù|05ú|13ùø |13øù|05ú|08ùø
    |11 DoRE|03!|11ACiDiC|03!|11Demonic |08[|15dreamland|09.|15darktech|09.|15org|08]

    --- Mystic BBS v1.12 A36 2017/12/01 (Windows/64)
    * Origin: |08--[|15!|07dreamland BBS dreamland.darktech.org (21:1/163)
  • From Gryphon@21:1/120 to g00r00 on Monday, December 04, 2017 20:48:55
    On 12/02/17, g00r00 said the following...

    will you be adding these in the python demo? also will the drawbox be functional? seeing all these new mpl command as well is like Christm coming early ;)

    For the message reading Python stuff there is a demo in the scripts directory of the new install, all of the other commands were shown in
    the WHATSNEW I think.

    There will be box and listbox functions in Python as well, yes. Its
    just a matter of figuring out how I want it all to work. Getting the message access done was a big win because it required a lot of behind
    the scene changes to my engine that I needed to do so I can add other things as well.

    I'll paste the reader example here:

    writeln("From: " + msghdr["from"]);
    writeln(" To: " + msghdr["to"]);
    writeln("Subj: " + msghdr["subj"]);
    writeln("-----");

    g00r00,

    I don't see any reference to a command to read the message date from the header. I tried 'msghdr["date"]' but I get an error.

    --- Mystic BBS v1.12 A36 2017/12/03 (Linux/64)
    * Origin: Cyberia BBS | cyberia.darktech.org | San Jose, CA (21:1/120)
  • From g00r00@21:1/108 to Gryphon on Tuesday, December 05, 2017 01:04:19
    I don't see any reference to a command to read the message date from the header. I tried 'msghdr["date"]' but I get an error.

    Not everything is done in the message header. Dates and flags are missing
    and maybe some other things?

    The question is how do I handle that? Do I make the flags boolean variables or text values? Do I give the date and time in a string format (24 May 2017 12:12:12) or a Unix time stamp and make people covert the date themselves?

    I'm leaning towards Boolean for the attributes and text for the time and date.

    I can add them in and it'll only take a few minutes so let me know what you need. Or any functions in general you'd like to see added in feel free to
    let me know so I can prioritize things people actually want to use...

    I think at this point its much easier for me to add things into Python than it is MPL, so I will be working a lot on bringing it up to speed.

    --- Mystic BBS v1.12 A37 2017/12/05 (Windows/32)
    * Origin: Sector 7 [Mystic BBS WHQ] (21:1/108)
  • From Gryphon@21:1/120 to g00r00 on Tuesday, December 05, 2017 16:34:05
    On 12/05/17, g00r00 said the following...

    I don't see any reference to a command to read the message date from header. I tried 'msghdr["date"]' but I get an error.

    Not everything is done in the message header. Dates and flags are
    missing and maybe some other things?

    The question is how do I handle that? Do I make the flags boolean variables or text values? Do I give the date and time in a string
    format (24 May 2017 12:12:12) or a Unix time stamp and make people
    covert the date themselves?

    Part of me thinks that it would be best to go with as pure a python-istic (is that a word?) option as possible. That way things can be manipulated with
    the standard python functions and modules. As such, I'm thinking that date values should be the standard unix time stamp.

    I'm leaning towards Boolean for the attributes and text for the time and date.

    Of course python has some pretty good text manipulation too, so having a date in a text format can be a viable option. The only thing that could get in
    the way of that is the many different date formats that might be used. If
    you stick with one date format that can be utilized for all scenarios, then that might be best.

    I can add them in and it'll only take a few minutes so let me know what you need. Or any functions in general you'd like to see added in feel free to let me know so I can prioritize things people actually want to use...

    There are many mpl functions that I would like to see migrated into MPY. I'm not certain if they have already been done, but I'd like to have some screen functions like getcharxy and getattrxy. I want to make sure that all the
    other CFG variables are availble too, like datapath and textpath and temppath.

    Also, if you can have a function that can post a message to a base, that
    would be great too.

    --- Mystic BBS v1.12 A36 2017/12/03 (Linux/64)
    * Origin: Cyberia BBS | cyberia.darktech.org | San Jose, CA (21:1/120)