• Creating a database

    From CatX@21:1/112 to All on Sat Nov 17 14:21:06 2018
    Hey all. I'm trying to create a database contained in a file and then read
    from it using MPL. Most of the file functions that I've found documented or that can be read from the sourcecode seem to be removed or not working correctly, for some reason.

    I tried to look at how the blackjack.mps script was made, but it was waaay beyond my level of understanding..

    I want to create a "map", looking somewhat like this:
    ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
    5³ . . . . . + . . . . . ³
    4³ . . . . . . . . . . . ³
    3³ . . . . . . . . . . . ³
    2³ . . Û . . . . . . . . ³
    1³ . . . . . . . . . . . ³
    0³ + . . . . . . . . . + ³
    1³ . . . . . . . ° . . . ³
    2³ . . . . . . . . . . . ³
    3³ . . . . . . . . . . . ³
    4³ . . . . . . . . . . . ³
    5³ . . . . . + . . . . . ³
    ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
    5 4 3 2 1 0 1 2 3 4 5

    Where each dot is representing a coordinate, going from 1 to 1.
    How would I write this data to a file, and then later read from said file and print the map to the screen?

    The reason I can't just create a .ans file or hardcode it is because I want
    to have a script that is able to create different versions on a per-user
    basis.

    |10 ¿ÚÂÄ ³
    |10 ÃÁ´. ³ CatX
    |10 Ù ÀÙ ³

    --- Mystic BBS v1.12 A39 2018/04/21 (Windows/32)
    * Origin: Black Flag <ACiD Telnet HQ> blackflagbbs.com (21:1/112)
  • From garycrunk@21:4/126 to CatX on Sat Nov 17 12:10:24 2018
    I want to create a "map", looking somewhat like this:
    ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
    5³ . . . . . + . . . . . ³
    4³ . . . . . . . . . . . ³
    3³ . . . . . . . . . . . ³
    2³ . . Û . . . . . . . . ³
    1³ . . . . . . . . . . . ³
    0³ + . . . . . . . . . + ³
    1³ . . . . . . . ° . . . ³
    2³ . . . . . . . . . . . ³
    3³ . . . . . . . . . . . ³
    4³ . . . . . . . . . . . ³
    5³ . . . . . + . . . . . ³
    ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
    5 4 3 2 1 0 1 2 3 4 5

    What sort of "Data" is in each location? I noticed you have 2 different "Blocks" to represent something.

    If this is going to be a Database, I will assume that each "Record" in the database is assigned to a "User"...

    So the record should have "UserName"... Maybe Entry_Date, and for the data to be represented for each user, depending on what information is placed in each square, you would use a multi-dimensional array... something like coord : array[1..11, 1,11] of Char;

    coord[6,6] would be the "Center" of the box...

    Then create a procedure that loops through the multi-dimensional array to update the information, then another to read and display the grid above.

    ---=[ Gary Crunk ]=---
    Another F-ing BBS : anotherbbs.ddns.net Port 23
    Quazar BBS Door Game Server: quazarbbs.ddns.net Port 2323

    --- Mystic BBS v1.12 A39 2018/04/21 (Windows/64)
    * Origin: New Mystic BBS (21:4/126)
  • From Gryphon@21:1/120 to CatX on Mon Nov 19 09:30:42 2018
    On 11/17/18, CatX said the following...

    Hey all. I'm trying to create a database contained in a file and then
    read from it using MPL. Most of the file functions that I've found documented or that can be read from the sourcecode seem to be removed or not working correctly, for some reason.

    I tried to look at how the blackjack.mps script was made, but it was
    waaay beyond my level of understanding..

    I want to create a "map", looking somewhat like this:
    ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
    5³ . . . . . + . . . . . ³
    4³ . . . . . . . . . . . ³
    3³ . . . . . . . . . . . ³
    2³ . . Û . . . . . . . . ³
    1³ . . . . . . . . . . . ³
    0³ + . . . . . . . . . + ³
    1³ . . . . . . . ° . . . ³
    2³ . . . . . . . . . . . ³
    3³ . . . . . . . . . . . ³
    4³ . . . . . . . . . . . ³
    5³ . . . . . + . . . . . ³
    ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
    5 4 3 2 1 0 1 2 3 4 5

    Where each dot is representing a coordinate, going from 1 to 1.
    How would I write this data to a file, and then later read from said
    file and print the map to the screen?

    The reason I can't just create a .ans file or hardcode it is because I want to have a script that is able to create different versions on a per-user basis.

    It looks like you have an 11x11 grid. That can be represented by an array:

    Var Grid : Array [1..11,1..11] of Integer
    Var Glyph: String = '.+'+#219+#176+177+178

    For X:=1 To 11 Do Begin
    For Y:=1 To 11 Do Begin
    WriteXY((X*2)+2,Y+4,11,Int2Str((X/2)-1)+' '+Glyph[Grid[X,Y]+1])
    End
    End

    That's untried code but you get the gist.

    --- Mystic BBS v1.12 A39 2018/04/21 (Linux/64)
    * Origin: Cyberia BBS | cyberiabbs.zapto.org | San Jose, CA (21:1/120)
  • From CatX@21:1/112 to garycrunk on Thu Nov 22 12:33:16 2018
    What sort of "Data" is in each location? I noticed you have 2 different "Blocks" to represent something.

    The data will be a series of strings containing color codes and characters, the final result typically occupying 1 or in some cases 2 spaces when drawn.
    The coordinates in my system (represented as dots in the original message) technically are two coordinates in reality, as it has a space after each dot (which in some cases will be a character instead of a space).

    If this is going to be a Database, I will assume that each "Record" in
    the database is assigned to a "User"...

    That's correct. Either all in one file, or each user will have their own file
    - it all depends on what's easiest/most efficient to setup.

    My problem is mostly how to actually write it to a file and then read the
    data into variables (probably arrays as you suggested). I studied mainly blackjack.mpl (included with mystic), but I couldn't make any sense out of
    the file-related part of the code.

    |10 ¿ÚÂÄ ³
    |10 ÃÁ´. ³ CatX
    |10 Ù ÀÙ ³

    --- Mystic BBS v1.12 A39 2018/04/21 (Windows/32)
    * Origin: Black Flag <ACiD Telnet HQ> blackflagbbs.com (21:1/112)
  • From garycrunk@21:4/126 to CatX on Thu Nov 22 15:02:42 2018
    The data will be a series of strings containing color codes and characters, the final result typically occupying 1 or in some cases 2 spaces when drawn. The coordinates in my system (represented as dots in the original message) technically are two coordinates in reality, as it has a space after each dot (which in some cases will be a character instead of a space).

    Okay, since it can be 1 or 2 spaces, the data must reflect 2 spaces all of
    the time, and have a blank space when not needed.

    That's correct. Either all in one file, or each user will have their own file - it all depends on what's easiest/most efficient to setup.

    I think it would be much more effective if you used a single database versus
    a database/file based on individual users. This way the program can just utilize 1 file/database.

    My problem is mostly how to actually write it to a file and then read the data into variables (probably arrays as you suggested). I studied mainly blackjack.mpl (included with mystic), but I couldn't make any sense out
    of the file-related part of the code.

    I would say using 1 Database with a simple array would be recommended.
    Instead of looking at blackjack.mpl, take a look at (I believe it was xqtr) that has a file called gamestub.mpl ... It shows you how to create/manage/update a simple "User" database in which you could place your array as part of the file.

    Not sure how you want to display the Grid. Since it has Color Codes and
    ASCII characters, that the program would require ANSI to run. You could
    create an ANSI screen designed to display the box area for the grid, and then in the program display the file, then draw the contents of the array inside
    of the grid using WriteXY to display the contents of the array.

    The array would be something like grid : array[1..11, 1..11) of string[20]
    (or string[10] depending on how many color codes and other things that would
    be there). Keep in mind that if you want to sometimes display 2 characters
    on the grid, you have to make room in the array for those characters, as well if there is not to be 2 characters, you place a Space character there...

    Gamestub.mpl is in an MPL tutorial and it's a good framework to build your
    MPL program.

    ---=[ Gary Crunk ]=---
    Another F-ing BBS : anotherbbs.ddns.net Port 23
    Quazar BBS Door Game Server: quazarbbs.ddns.net Port 2323

    --- Mystic BBS v1.12 A39 2018/04/21 (Windows/64)
    * Origin: New Mystic BBS (21:4/126)
  • From CatX@21:1/112 to garycrunk on Fri Nov 23 10:43:10 2018
    Instead of looking at blackjack.mpl, take a look at (I believe it was xqtr) that has a file called gamestub.mpl ... It shows you how to create/manage/update a simple "User" database in which you could place your array as part of the file.

    Gamestub.mpl is in an MPL tutorial and it's a good framework to build
    your MPL program.

    I couldn't find gamestub.mpl, not in blackflag's file areas, nor in mystic itself. Upon googling it the file seems to be hosted at cyberia.darktech.org, but I wasn't able to reach it at all. I tried telnet, ftp and http, but all
    of them seemed to be down (unless they changed their domain or something?)..

    In case you have the file I'd be very thankful if you would upload it
    somewhere :)

    |10 ¿ÚÂÄ ³
    |10 ÃÁ´. ³ CatX
    |10 Ù ÀÙ ³

    --- Mystic BBS v1.12 A39 2018/04/21 (Windows/32)
    * Origin: Black Flag <ACiD Telnet HQ> blackflagbbs.com (21:1/112)
  • From CatX@21:1/112 to CatX on Fri Nov 23 10:53:42 2018
    Nevermind, I found it! It seems the address had changed from cyberia.darktech.org to CyberiaBBS.Zapto.Org.

    |10 ¿ÚÂÄ ³
    |10 ÃÁ´. ³ CatX
    |10 Ù ÀÙ ³

    --- Mystic BBS v1.12 A39 2018/04/21 (Windows/32)
    * Origin: Black Flag <ACiD Telnet HQ> blackflagbbs.com (21:1/112)
  • From garycrunk@21:4/126 to CatX on Fri Nov 23 08:18:20 2018
    I couldn't find gamestub.mpl, not in blackflag's file areas, nor in
    mystic itself. Upon googling it the file seems to be hosted at cyberia.darktech.org, but I wasn't able to reach it at all. I tried telnet, ftp and http, but all of them seemed to be down (unless they changed their domain or something?)..

    Log on to my BBS anotherbbs.ddns.net Port 23
    Do a File Search for gamestub.zip .

    ---=[ Gary Crunk ]=---
    Another F-ing BBS : anotherbbs.ddns.net Port 23
    Quazar BBS Door Game Server: quazarbbs.ddns.net Port 2323

    --- Mystic BBS v1.12 A39 2018/04/21 (Windows/64)
    * Origin: New Mystic BBS (21:4/126)
  • From StackFault@21:1/172 to CatX on Fri Nov 23 11:20:12 2018
    Nevermind, I found it! It seems the address had changed from cyberia.darktech.org to CyberiaBBS.Zapto.Org.

    Yes, apparently darktech.org is no longer and everyone had to find a new home :(

    Lots of bookmarks have to be redone...

    RIP...

    Cheers,

    ß Þ
    úúúÄÄÄÄÄúÄÄúúÄÄÄÄúÄú Ý ßúÄúÄÄÄúÄÄÄÄÄÄúúÄÄÄÄÄúÄÄÄÄúÄÄÄÄÄÄúúÄÄÄÄÄÄÄÄÄúÄÄÄÄúúú
    Dave aka Stackfault ß Ýß bbs.bottomlessabyss.net (telnet/2023 þ ssh/2222)
    Bottomless Abyss BBS ÜßÞ https://bbs.bottomlessabyss.net for info
    -úúú --- - - --- -- ú-úú ú úúú úúú ú- -úúú -ú-- úúú úúú -úúú -úúú úúú

    --- Mystic BBS v1.12 A39 2018/04/21 (Linux/64)
    * Origin: The Bottomless Abyss BBS (21:1/172)
  • From Gryphon@21:1/120 to CatX on Sat Nov 24 11:32:20 2018
    On 11/22/18, CatX said the following...

    What sort of "Data" is in each location? I noticed you have 2 differ "Blocks" to represent something.

    The data will be a series of strings containing color codes and characters, the final result typically occupying 1 or in some cases 2 spaces when drawn. The coordinates in my system (represented as dots in the original message) technically are two coordinates in reality, as it has a space after each dot (which in some cases will be a character instead of a space).

    If this is going to be a Database, I will assume that each "Record" i the database is assigned to a "User"...

    That's correct. Either all in one file, or each user will have their own file - it all depends on what's easiest/most efficient to setup.

    My problem is mostly how to actually write it to a file and then read the data into variables (probably arrays as you suggested). I studied mainly blackjack.mpl (included with mystic), but I couldn't make any sense out
    of the file-related part of the code.

    I wrote an MPL a long time ago called gamestub.mps. It has many examples of how to write a full mpl app, including file functions. You can get it at http://cyberiabbs.zapto.org. Browse to Free Files -> free/mpl and download gamestub.mps

    --- Mystic BBS v1.12 A39 2018/04/21 (Linux/64)
    * Origin: Cyberia BBS | cyberiabbs.zapto.org | San Jose, CA (21:1/120)
  • From Gryphon@21:1/120 to CatX on Sat Nov 24 13:01:26 2018
    On 11/23/18, CatX said the following...

    Instead of looking at blackjack.mpl, take a look at (I believe it was xqtr) that has a file called gamestub.mpl ... It shows you how to create/manage/update a simple "User" database in which you could plac your array as part of the file.

    Gamestub.mpl is in an MPL tutorial and it's a good framework to build your MPL program.

    I couldn't find gamestub.mpl, not in blackflag's file areas, nor in
    mystic itself. Upon googling it the file seems to be hosted at cyberia.darktech.org, but I wasn't able to reach it at all. I tried telnet, ftp and http, but all of them seemed to be down (unless they changed their domain or something?)..

    In case you have the file I'd be very thankful if you would upload it somewhere :)

    You couldn't get there because what you found is the old darktech address.
    The new address is cyberiabbs.zapto.org.

    --- Mystic BBS v1.12 A39 2018/04/21 (Linux/64)
    * Origin: Cyberia BBS | cyberiabbs.zapto.org | San Jose, CA (21:1/120)