• MPL Scripting

    From bamageek@21:1/140 to All on Tuesday, February 11, 2020 16:57:35
    I'm playing around with some MPL scripting and I read somewhere that somebody had some good documentation and/or maybe some good API references for Mystic Scripting. Does anyone know where I can find that?

    I'm wanting to write a script that can invoke HTTP requests and also do
    telnet. I know there are some components you can "use" but I'm really not
    sure whats available.

    Any help would be appreciated!

    --- Mystic BBS v1.12 A44 2020/02/04 (Windows/32)
    * Origin: Dave's BBS (21:1/140)
  • From g00r00@21:1/108 to bamageek on Tuesday, February 11, 2020 20:12:34
    I'm playing around with some MPL scripting and I read somewhere that somebody had some good documentation and/or maybe some good API
    references for Mystic Scripting. Does anyone know where I can find that?

    I'm wanting to write a script that can invoke HTTP requests and also do telnet. I know there are some components you can "use" but I'm really not sure whats available.

    Sounds like you'd want to use Mystic Python for that. MPL is pretty locked down as far as getting outside of the BBS. Python gives you more control.

    --- Mystic BBS v1.12 A45 2020/02/09 (Linux/64)
    * Origin: Sector 7 (21:1/108)
  • From bamageek@21:1/140 to g00r00 on Tuesday, February 11, 2020 22:03:42
    Sounds like you'd want to use Mystic Python for that. MPL is pretty locked down as far as getting outside of the BBS. Python gives you more control.

    Are there some API references/documentation for this? Sounds like I've got a lot to learn! :)

    --- Mystic BBS v1.12 A44 2020/02/04 (Windows/32)
    * Origin: Dave's BBS (21:1/140)
  • From bamageek@21:1/140 to bamageek on Wednesday, February 12, 2020 06:48:20
    Sounds like you'd want to use Mystic Python for that. MPL is pretty locked down as far as getting outside of the BBS. Python gives you m control.

    Are there some API references/documentation for this? Sounds like I've
    got a lot to learn! :)

    --- Mystic BBS v1.12 A44 2020/02/04 (Windows/32)
    * Origin: Dave's BBS (21:1/140)

    Ok did some more looking turns out in my very own BBS file library (Thanks to the great folks here on FSX Net) there was a MPL Scripting tutorial. Also dug around on google and found some information on the Mystic BBS Wiki about Embedded Python so I'm gonna start digging around on that!

    --- Mystic BBS v1.12 A44 2020/02/04 (Windows/32)
    * Origin: Dave's BBS (21:1/140)
  • From g00r00@21:1/108 to bamageek on Wednesday, February 12, 2020 11:38:31
    Sounds like you'd want to use Mystic Python for that. MPL is pretty locked down as far as getting outside of the BBS. Python gives you m control.

    Are there some API references/documentation for this? Sounds like I've
    got a lot to learn! :)

    Python is Python, so there are plenty of resources on how to do stuff with Python 2.7 on the interwebs along with packages to do various things. All of the Python 2.7 stuff applies to Mythic too.

    As far as the Mystic-specific functions there is msgread.mpy and filelist.mpy that come with Mystic as examples of read messages and listing files. I believe the whatsnew files have all of the functions documented in them, and there is a page on the Wiki that is being built with a function reference (but mostly unfinished - ask me to document a function and I will)

    http://wiki.mysticbbs.com/doku.php?id=python_functions

    --- Mystic BBS v1.12 A45 2020/02/11 (Linux/64)
    * Origin: Sector 7 (21:1/108)
  • From bamageek@21:1/140 to g00r00 on Thursday, February 13, 2020 06:49:38
    Are there some API references/documentation for this? Sounds like I'v got a lot to learn! :)

    Python is Python, so there are plenty of resources on how to do stuff
    with Python 2.7 on the interwebs along with packages to do various
    things. All of the Python 2.7 stuff applies to Mythic too.

    Thanks I've been goign through the documentation and wrote a little script to test things out. So I can use regular python code along with the mystic functins from within my MPY script? This is pretty powerful!

    --- Mystic BBS v1.12 A44 2020/02/04 (Windows/32)
    * Origin: Dave's BBS (21:1/140)
  • From g00r00@21:1/108 to bamageek on Thursday, February 13, 2020 12:26:16
    Thanks I've been goign through the documentation and wrote a little
    script to test things out. So I can use regular python code along with
    the mystic functins from within my MPY script? This is pretty powerful!

    Yes you can!

    You should have access to the Python 2.x language and any of the Python 2.x modules out in the wild, plus whatever Mystic-specific functions I build into it.

    The combination should be incredibly powerful.

    --- Mystic BBS v1.12 A45 2020/02/11 (Linux/64)
    * Origin: Sector 7 (21:1/108)
  • From bamageek@21:1/140 to g00r00 on Saturday, February 15, 2020 14:17:14
    As far as the Mystic-specific functions there is msgread.mpy and filelist.mpy that come with Mystic as examples of read messages and listing files. I believe the whatsnew files have all of the functions documented in them, and there is a page on the Wiki that is being built with a function reference (but mostly unfinished - ask me to document a function and I will)

    OK I'm lokoing through the Functin List on the wiki site. One of the commands is menucmd. If I'm correct in my assuption, I could use this to execute an Outbound telnet command to connect to a remote system? Would the command and the data for the IT command be in seperate parameters? I tried a few
    different variations but didn't get any sort of response.

    --- Mystic BBS v1.12 A44 2020/02/04 (Windows/32)
    * Origin: Dave's BBS (21:1/140)
  • From g00r00@21:1/108 to bamageek on Saturday, February 15, 2020 15:56:54
    OK I'm lokoing through the Functin List on the wiki site. One of the commands is menucmd. If I'm correct in my assuption, I could use this to execute an Outbound telnet command to connect to a remote system? Would the command and the data for the IT command be in seperate parameters? I tried a few different variations but didn't get any sort of response.

    Yes, you could do the IT with menucmd in MPL or MPY if you wanted to (or directly from a menu of course). In MPL it would be:

    Begin
    MenuCmd('IT', '/addr=mybbs.com');
    End.

    --- Mystic BBS v1.12 A45 2020/02/14 (Windows/64)
    * Origin: Sector 7 (21:1/108)
  • From bamageek@21:1/140 to bamageek on Saturday, February 15, 2020 20:08:04
    execute an Outbound telnet command to connect to a remote system? Would the command and the data for the IT command be in seperate parameters? I tried a few different variations but didn't get any sort of response.

    I figured it out:
    menucmd("IT", "/addr=games.bbslink.net /port=23")

    One more question; Is there a way to pass arguments in to a .mpy script via data on a menu command?

    --- Mystic BBS v1.12 A44 2020/02/04 (Windows/32)
    * Origin: Dave's BBS (21:1/140)
  • From bamageek@21:1/140 to g00r00 on Saturday, February 15, 2020 20:11:21
    Yes, you could do the IT with menucmd in MPL or MPY if you wanted to (or directly from a menu of course). In MPL it would be:

    Begin
    MenuCmd('IT', '/addr=mybbs.com');
    End.

    Thanks I got it to work with the IT. Thought I tried it before but I got it
    to work. Never used Python before but its a really cool and powerful
    language!

    --- Mystic BBS v1.12 A44 2020/02/04 (Windows/32)
    * Origin: Dave's BBS (21:1/140)
  • From g00r00@21:1/108 to bamageek on Saturday, February 15, 2020 21:21:21
    I figured it out:
    menucmd("IT", "/addr=games.bbslink.net /port=23")

    One more question; Is there a way to pass arguments in to a .mpy script via data on a menu command?

    Yep. It should be:

    Menu command: GY (Execute Mystic Python)
    Data: myscript option1 option2 option3

    And then in the script param_count gives you the number of options passed to the script, and param_str(number) should return the requested option number.

    --- Mystic BBS v1.12 A45 2020/02/15 (Windows/64)
    * Origin: Sector 7 (21:1/108)
  • From Analog@21:2/123 to bamageek on Saturday, February 15, 2020 19:45:06
    One more question; Is there a way to pass arguments in to a .mpy script via data on a menu command?

    Yes, you can just add the arguments after the script name on the DATA
    command. Inside Python, just use "param_str" from mystic_bbs. For instance:

    Command: GY
    Data: script_name arg1 arg2

    Then in the script:

    value1 = param_str(1)
    value2 = param_str(2)

    NOTE: param_str(0) is the name of the script. This is useful for displaying usage notes.

    Enjoy.

    |20|15ÚÄ|16|08´ |08De|07ad|15be|07a|08tz b|07b|15s
    |08ÀÄÙÃÄ¿ |08:>.|07A|08rk |0710|08:|07101|08/|0714|08.
    |04þ |08À|20|15Ä|16|08Ù |08:>.|10A|02gn |1046|08:|101|08/|10123|08.
    |04A|07n|15al|07o|08g |08:>.|12F|04sx |1221|08:|122|08/|12123|08.
    |08:>.|15S|07ci |1577|08:|151|08/|15131|08. |04°±°|08±ÛÛÜÝ|08:>.|11T|03qw |111337|08:|113|08/|1113|08.

    --- Mystic BBS v1.12 A45 2020/02/09 (Linux/64)
    * Origin: deadbeatz.org (21:2/123)
  • From ryan@21:1/168 to g00r00 on Saturday, February 15, 2020 21:45:30
    MenuCmd('IT', '/addr=mybbs.com');

    This hasn't ever worked for me, btw. It works in MPY, I think, but not MPL.

    --- Mystic BBS v1.12 A44 2020/02/04 (Linux/64)
    * Origin: monterey bbs (21:1/168)
  • From bamageek@21:1/140 to Analog on Sunday, February 16, 2020 08:16:39

    Yes, you can just add the arguments after the script name on the DATA command. Inside Python, just use "param_str" from mystic_bbs. For instance:

    Command: GY
    Data: script_name arg1 arg2

    Then in the script:

    value1 = param_str(1)
    value2 = param_str(2)


    I think I was trying to use brackets earlier. I think I got it working:

    if param_str(1) is None:
    doorcode="menu"
    else:
    doorcode = param_str(1)

    --- Mystic BBS v1.12 A44 2020/02/04 (Windows/32)
    * Origin: Dave's BBS (21:1/140)
  • From g00r00@21:1/108 to ryan on Sunday, February 16, 2020 11:41:57
    MenuCmd('IT', '/addr=mybbs.com');

    This hasn't ever worked for me, btw. It works in MPY, I think, but not MPL.

    I can't seem to reproduce that issue. I tested telnet, rlogin and SSH with A45 in Linux and Windows yesterday from both a menu and MPL. I am not sure where to go with it. I did find that SSH outbound was broken at one point recently and I have fixed that part but it wasn't specific to MPL.

    I'm not sure what else to do.

    --- Mystic BBS v1.12 A45 2020/02/15 (Windows/64)
    * Origin: Sector 7 (21:1/108)
  • From ryan@21:1/168 to g00r00 on Sunday, February 16, 2020 14:46:17
    I can't seem to reproduce that issue. I tested telnet, rlogin and SSH with A45 in Linux and Windows yesterday from both a menu and MPL. I am not sure where to go with it. I did find that SSH outbound was broken
    at one point recently and I have fixed that part but it wasn't specific
    to MPL.

    Excellent! I'll test it out in that case to see if it's also fixed on my end. Thanks! Perhaps it was something that was fixed at some point and I wasn't tracking.

    --- Mystic BBS v1.12 A44 2020/02/04 (Linux/64)
    * Origin: monterey bbs (21:1/168)
  • From g00r00@21:1/108 to ryan on Sunday, February 16, 2020 19:50:33
    I can't seem to reproduce that issue. I tested telnet, rlogin and SS with A45 in Linux and Windows yesterday from both a menu and MPL. I not sure where to go with it. I did find that SSH outbound was broke at one point recently and I have fixed that part but it wasn't specif to MPL.

    Excellent! I'll test it out in that case to see if it's also fixed on my end. Thanks! Perhaps it was something that was fixed at some point and I wasn't tracking.

    Very possible. I think the SSH thing was fixed in A45 so at least for SSH it will probably be broken in A44 but I think the rest should work.

    The SSH thing was broken everywhere because I changed my SSH code and forgot to touch up the outbound SSH code.

    I'm planning to release A45 within the next 2 days or so and I want to try to fix everything I can before I start making sweeping changes again as I tend
    to do lol

    --- Mystic BBS v1.12 A45 2020/02/15 (Windows/64)
    * Origin: Sector 7 (21:1/108)