• New 132x37 .mpl question

    From The Godfather@21:1/165 to All on Saturday, November 21, 2020 18:45:16
    Hey all,

    ok another stupid question time....

    I'm really trying wrap my head around .mpl but the uncle google youtube wizards with hours of tutorials just don't exist. So here I am .. sucking in my pride, and asking for help.

    I'm starting with one of Dan's mods, the RCSLC.MP (10 Last Callers ..)

    What I want to do is create a conditional procedure and/or boolean that basically does this ..

    if (users terminal size (don't know the variable for this = 80 x25) then do this procedure ....
    else (132x37) do this ...


    This is actually for just about EVERY .MPL I have as I want to have a single theme instead of two where the mpl's x/y coordinates
    and or a WriteLn('|01-------------- etc.....') would be appropriate for either 79 lines and or 131 lines. Same with the rows,
    at either 23 or 36.


    Here is g00r00's whatsnew.txt but I just don't get how to use these ..... or interpret what he's referring to regarding how to
    reference terminal sizes.

    Note that if you have enabled creation of "node windows" when running the
    Windows version of Mystic, you will want to right click your command
    prompt window, select "Defaults", and set the window/buffer size to
    default to 160x60. Mystic creates node windows using the default settings
    so if you don't select the largest window a user can use then the screen
    will not look correct when a user is in a terminal mode larger than the
    node window.

    + User terminal size is no longer stored in the user record, and Mystic
    always uses the detected terminal size (or the default terminal size
    defined in System Configuration if no graphics detected on connection).

    + New MPL variables "TermSizeX" and "TermSizeY" tell you the size of the
    user's terminal.

    And the procedure I'd like to add the if/then conditions within

    Procedure Drawscreen
    Var count : integer = 1
    Begin dispfile('lastten') // this line would auto detect lasten.ans .msg or lastten.c132.ans .. however below is where I need

    //here I need condition: if 80x25 then do

    WriteLn('|CR|09 User Node Location
    Date Time') WriteLn('|01---------------|03----|11----|10----|15---------------------|15----|10----|11----|03----|01---------------|11')
    forcount:=1 to 10 do
    WriteLn(' '+PadRt(Call[count].Handle,25,' ')+Int2Str(Call[count].Node)+' '+PadRt(Call[count].City,25,'')+' ' +DateSTR(Call[count].MDateTime,1)+' '
    +TimeStr(Call[count].MDateTime,False)) WriteLn('|15----|10----|11----|03----|01-------------------------------------------|01----|03----|11----|10----|15----') gotoxy(1,21) WriteLn('|01|BN - |SN') gotoxy(58,21) WriteLn('|01'+prog+' '+ver) gotoxy(1,23) pause progexitEnd

    // here I need an else (132x37) then do

    I'd replicate the code above but to be proportionate to a 132x37 terminal size (and within an ANSI using x/y coordinates ..)

    Any input would be awesome. Go easy on me .. :)

    -tG

    --- Mystic BBS v1.12 A47 2020/11/17 (Windows/32)
    * Origin: The Underground [@] theunderground.us:10023 <-port (21:1/165)
  • From Adept@21:2/108 to The Godfather on Sunday, November 22, 2020 11:58:29
    ok another stupid question time....

    Okay, since I don't see other answers, I'm going to ask stupid questions, and give stupid answers, because I very definitely _can_ figure this out; I just haven't programmed MPLs or Pascal and likely will be a bit lazy with my
    answer.

    What I want to do is create a conditional procedure and/or boolean that

    if (users terminal size (don't know the variable for this = 80 x25) then

    So you want to write an if statement based on terminal size?

    + New MPL variables "TermSizeX" and "TermSizeY" tell you the size of the
    user's terminal.

    So theoretically, you'd have, (in C-style) if(TermSizeX == 137 && TermSizeY
    == 37) (do stuff)

    ...though I'd probably write that using "> 80" or whatever is appropriate.

    Looking at a random .mps file, my guess would be:

    If TermSizeX = 137 Then
    If TermSizeY = 37 Then
    DispFile (MenuName)
    Else
    DispFile (defaultMenuName)

    ...But I don't really know if If blocks are denoted by the areas that have
    the same indentation, if that's the correct way to nest an If statement, or
    if you could just write "If TermSizeX = 137 && TermSizeY = 37", of if I have the wrong usage of "Then", etc.

    Anyway, I'm not sure if that was the extent of your sticking points. I'm not really sure what next to ask, either, for figuring out what it is that you don't know. Do share more of what small next task you're getting stuck on.

    --- Mystic BBS v1.12 A46 2020/08/26 (Linux/64)
    * Origin: Storm BBS (21:2/108)
  • From The Godfather@21:1/165 to Adept on Monday, November 23, 2020 09:57:38
    Okay, since I don't see other answers, I'm going to ask stupid
    questions, andgive stupid answers, because I very definitely _can_
    figure this out; I justhaven't programmed MPLs or Pascal and likely will be a bit lazy with myanswer.

    Thank you Adept,

    Yes I agree it should work that way, and like you I'm more familiar with C and javascript now, but never used pascal.
    The syntax is different which is what I'm really looking for.

    If TermSizeX = 137 Then
    If TermSizeY = 37 Then
    DispFile (MenuName)
    Else
    DispFile (defaultMenuName)

    So yeah, this is where I'm confused ... that totally makes sense other then the fact that Mystic supports more then just 132x37 screen formats. And why the X and Y are separate make it confusing to me. As I may have ANSI's that are 132x24, or whatever .. Mystic supports up to 160x? ... so I think the best way is to basically say if ! Termsize 80x25 do ... but combining the separate functions into a flexible condition is where I hope I can find an answer .. Once I get it from g00r00 or some of the ArakNet guru's .. I'll post here ...

    -tG

    --- Mystic BBS v1.12 A47 2020/11/17 (Windows/32)
    * Origin: The Underground [@] theunderground.us:10023 <-port (21:1/165)
  • From paulie420@21:2/150 to The Godfather on Monday, November 23, 2020 07:55:32
    Thank you Adept,

    Yes I agree it should work that way, and like you I'm more familiar with
    C andjavascript now, but never used pascal.
    The syntax is different which is what I'm really looking for.

    If TermSizeX = 137 Then
    If TermSizeY = 37 Then
    Begin
    DispFile (MenuName)
    End
    Else
    Begin
    DispFile (defaultMenuName)
    End

    So yeah, this is where I'm confused ... that totally makes sense other then thefact that Mystic supports more then just 132x37 screen formats. And why the Xand Y are separate make it confusing to me. As I may have ANSI's that are132x24, or whatever .. Mystic supports up to 160x? ...
    so I think the best wayis to basically say if ! Termsize 80x25 do ...
    but combining the separatefunctions into a flexible condition is where I hope I can find an answer ..Once I get it from g00r00 or some of the ArakNet guru's .. I'll post here ...

    Each part, the if and the else must be wrapped in:
    Begin
    End



    |07p|15AULIE|1142|07o
    |08.........

    --- Mystic BBS v1.12 A47 2020/10/23 (Raspberry Pi/32)
    * Origin: 2o fOr beeRS bbs>>>20ForBeers.com:1337 (21:2/150)
  • From Adept@21:2/108 to The Godfather on Monday, November 23, 2020 18:59:07
    so I think the best way is to basically say if ! Termsize 80x25 do ...
    but combining the separate functions into a flexible condition is where

    I thought the difficulty was writing the various different displays for screens.

    Otherwise you may as well have various lines that take the terminalX size and space things based on percentage of how far across the screen you are, so far.

    But I guess I don't really see what the issue is, since it seems much more of
    a content or, "how do I have a flexible display size like CSS?" issue.

    --- Mystic BBS v1.12 A46 2020/08/26 (Linux/64)
    * Origin: Storm BBS (21:2/108)