User Tools

Site Tools


python_devnotes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
python_devnotes [2017/12/05 01:47] – intro updated avonpython_devnotes [2017/12/05 02:07] – added python examples link avon
Line 70: Line 70:
              
   + Mystic now logs whenever a Python script is executed.   + Mystic now logs whenever a Python script is executed.
 +  
 +  + New Python function "getuserid(ID)" returns a user dictionary of the user
 +   associated with ID.  If no user is found it will return None:
 +  
 +     import mystic_bbs as bbs;
 +  
 +     user = bbs.getuserid(1)
 +  
 +     if not user is None:
 +       bbs.writeln(user["handle"]);
 +    
 +  + New Python function "getmbase(num)" returns a Message Base dictionary of
 +   the record physically located at (num).  This example will print all of
 +   the message bases out:
 +  
 +     import mystic_bbs as bbs;
 +  
 +     count = 0;
 +  
 +     while not bbs.shutdown():
 +       mbase = bbs.getmbase(count);
 +  
 +       if mbase is None:
 +         break;
 +  
 +       bbs.writeln(mbase["name"]);
 +  
 +       count = count + 1;
 +  
 +     bbs.writeln("List complete. |PA");
 +  
 +  + New Python function "getmbaseid(ID)" returns a Message Base dictionary of
 +   the Message Base with ID of (ID).
 +  
 +  + New Python functions for reading Message Bases:
 +  
 +     msg_open, msg_seek, msg_found, msg_next, msg_prev, msg_gethdr,
 +     msg_gettxt, msg_close
 +  
 +    Rather than try to document them all here I've included a "msgread.mpy""]]
 +    in the default installation as an example of how to use these functions.
 +    This example implments a very basic message reader using the user's current
 +    message base.
          
  
 +=== Related Links ===
  
 +  * [[python_examples|Mystic BBS Python Examples]] 
python_devnotes.txt · Last modified: 2017/12/05 13:01 by avon

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki