• Free Pascal

    From ignatius@VERT/CYBERIA to All on Monday, March 02, 2015 20:38:00
    Hi, all.

    First off, let me say that i'm a total newbie to (Free) Pascal.
    As you may know, I ported Impulse BBS to Linux. I'm having problems getting door games working. For some reason they do not run from a menu. I have to
    hard code them into the source code. The code runs fine, however, no matter which door game I choose to run, it runs the last one in the case statement. Here is that code, if you can help out, i'd be very thankful.

    --//-- snip ------------------------------------------

    rundoor1:=TRUE;
    rundoor2:=FALSE;
    if (rundoor1) and not (rundoor2) then begin

    c:=1;
    case c of
    1 : shell('/home/imp/door/door 1 USURPER');
    end;
    end;

    rundoor1:=FALSE;
    rundoor2:=TRUE;
    if (rundoor2) and not (rundoor1) then begin

    c:=2;
    case c of
    2 : shell('/home/imp/door/door 1 PIT');
    end;
    end;

    rundoor1:=FALSE;
    rundoor2:=FALSE;
    rundoor3:=TRUE;

    if (rundoor3) and not (rundoor1) and not (rundoor2) then begin

    c:=3;
    case c of
    3 : shell('/home/imp/door/door 1 DF');
    end;
    end;

    --//--- snip ---------------------------------------------

    TIA,
    -ig

    --- Mystic BBS v1.10 (Linux)
    * Origin: Cyberia BBS | Cyberia.Darktech.Org | Kingwood, TX
  • From Gryphon@VERT/CYBERIA to ignatius on Monday, March 02, 2015 21:27:00
    On 03/02/15, ignatius said the following...


    Hi, all.

    First off, let me say that i'm a total newbie to (Free) Pascal.
    As you may know, I ported Impulse BBS to Linux. I'm having problems getting door games working. For some reason they do not run from a menu.
    I have to hard code them into the source code. The code runs fine, however, no matter which door game I choose to run, it runs the last one in the case statement. Here is that code, if you can help out, i'd be
    very thankful.

    I'm not entirely certain what it is that you are trying to do. The case statements seem unneeded, since you separate them out in different if statements.

    --- Mystic BBS v1.10 (Linux)
    * Origin: Cyberia BBS | Cyberia.Darktech.Org | Kingwood, TX
  • From ignatius@VERT/CYBERIA to Gryphon on Monday, March 02, 2015 23:59:00
    I'm not entirely certain what it is that you are trying to do. The case statements seem unneeded, since you separate them out in different if statements.


    I'm trying to launch a (door game) script with the "1", "2", and "3" keys.

    -ig

    --- Mystic BBS v1.10 (Linux)
    * Origin: Cyberia BBS | Cyberia.Darktech.Org | Kingwood, TX
  • From ignatius@VERT/CYBERIA to Gryphon on Tuesday, March 03, 2015 00:14:00
    I'm not entirely certain what it is that you are trying to do. The case statements seem unneeded, since you separate them out in different if statements.

    You're right. The case statements weren't needed at all. The original problem still remains, however. "1", "2" and "3" all launch "shell('/home/imp/door 1 DF')". Not sure what i'm doing wrong.

    TIA,
    -ig

    --- Mystic BBS v1.10 (Linux)
    * Origin: Cyberia BBS | Cyberia.Darktech.Org | Kingwood, TX
  • From Gryphon@VERT/CYBERIA to ignatius on Tuesday, March 03, 2015 09:02:00
    On 03/02/15, ignatius said the following...


    Hi, all.

    First off, let me say that i'm a total newbie to (Free) Pascal.
    As you may know, I ported Impulse BBS to Linux. I'm having problems getting door games working. For some reason they do not run from a menu.
    I have to hard code them into the source code. The code runs fine, however, no matter which door game I choose to run, it runs the last one in the case statement. Here is that code, if you can help out, i'd be
    very thankful.

    I would think the following would work. Does it not work like that? Is it possible that your /home/imp/door/door script is not coded correctly?

    c:=1;
    case c of
    1 : shell('/home/imp/door/door 1 USURPER');
    2 : shell('/home/imp/door/door 1 PIT');
    3 : shell('/home/imp/door/door 1 DF');
    end;

    --- Mystic BBS v1.10 (Linux)
    * Origin: Cyberia BBS | Cyberia.Darktech.Org | Kingwood, TX
  • From Accession@VERT/PHARCYDE to ignatius on Tuesday, March 03, 2015 11:51:36
    Hello ignatius,

    On 03 Mar 15 00:14, ignatius wrote to Gryphon:

    I'm not entirely certain what it is that you are trying to do.
    The case statements seem unneeded, since you separate them out in
    different if statements.

    You're right. The case statements weren't needed at all. The original problem still remains, however. "1", "2" and "3" all launch "shell('/home/imp/door 1 DF')". Not sure what i'm doing wrong.

    Does it have anything to do with you using "shell('/home/imp/door 1 DF')" in all three? Shouldn't "1" be either a variable to be able to pass each number, or "1", "2" and "3" respectively?

    Regards,
    Nick

    --- GoldED+/LNX 1.1.5-b20130910
    * Origin: thePharcyde_ telnet://bbs.pharcyde.org (Wisconsin) (723:1/701)
    þ Synchronet þ thePharcyde_ telnet://bbs.pharcyde.org (Wisconsin)
  • From ignatius@VERT/CYBERIA to Gryphon on Tuesday, March 03, 2015 15:57:00
    I would think the following would work. Does it not work like that? Is it possible that your /home/imp/door/door script is not coded correctly?


    It doesn't work. That's just simply hard coding it, and telling it to execute "1". Yes, my /home/imp/door/door script is fine.

    -ig

    --- Mystic BBS v1.10 (Linux)
    * Origin: Cyberia BBS | Cyberia.Darktech.Org | Kingwood, TX
  • From ignatius@VERT/CYBERIA to Accession on Tuesday, March 03, 2015 16:01:00
    Does it have anything to do with you using "shell('/home/imp/door 1
    DF')" in all three? Shouldn't "1" be either a variable to be able to
    pass each number, or "1", "2" and "3" respectively?

    In all three?

    -ig

    --- Mystic BBS v1.10 (Linux)
    * Origin: Cyberia BBS | Cyberia.Darktech.Org | Kingwood, TX
  • From Gryphon@VERT/CYBERIA to ignatius on Tuesday, March 03, 2015 16:11:00
    On 03/03/15, ignatius said the following...

    Does it have anything to do with you using "shell('/home/imp/door 1 DF')" in all three? Shouldn't "1" be either a variable to be able to pass each number, or "1", "2" and "3" respectively?

    In all three?

    What does the command line parameter '1' refer to for the door script? I'm assuming it means the node number?

    --- Mystic BBS v1.10 (Linux)
    * Origin: Cyberia BBS | Cyberia.Darktech.Org | Kingwood, TX
  • From ignatius@VERT/CYBERIA to Gryphon on Tuesday, March 03, 2015 17:39:00
    What does the command line parameter '1' refer to for the door script? I'm assuming it means the node number?

    You are correct, sir.

    -ig

    --- Mystic BBS v1.10 (Linux)
    * Origin: Cyberia BBS | Cyberia.Darktech.Org | Kingwood, TX
  • From ignatius@VERT/CYBERIA to ignatius on Tuesday, March 03, 2015 23:48:00
    I'm assuming it means the node number?

    You are correct, sir.


    Somehow, I need to insert some "else"'s, but with my limited knowledge, I
    don't know where to put them.

    -ig

    --- Mystic BBS v1.10 (Linux)
    * Origin: Cyberia BBS | Cyberia.Darktech.Org | Kingwood, TX
  • From Accession@VERT/PHARCYDE to ignatius on Wednesday, March 04, 2015 17:57:08
    Hello ignatius,

    On 03 Mar 15 16:01, ignatius wrote to Accession:

    Does it have anything to do with you using "shell('/home/imp/door
    1 DF')" in all three? Shouldn't "1" be either a variable to be
    able to pass each number, or "1", "2" and "3" respectively?

    In all three?

    I was basically wondering why you were using "1" in all three doors. Now that you've answered Gryphon by saying that it's the node number, this will only work if someone on node 1 is running the door, or you only run a 1 node BBS, or
    you run separate scripts for each node. You may want to change that to a variable that can be passed by the BBS.

    This, however, most likely doesn't fix your original issue.

    Regards,
    Nick

    --- GoldED+/LNX 1.1.5-b20130910
    * Origin: thePharcyde_ telnet://bbs.pharcyde.org (Wisconsin) (723:1/701)
    þ Synchronet þ thePharcyde_ telnet://bbs.pharcyde.org (Wisconsin)
  • From ignatius@VERT/PHARCYDE to Accession on Wednesday, March 04, 2015 21:51:29
    will only work if someone on node 1 is running the door, or you only run a 1 node BBS, or you run separate scripts for each node. You may want to change that to a variable that can be passed by the BBS.

    Actually, I have it set up to read the drop file after the user decides to run the door. Thus, if someone on node 1 runs "PIT" it will read the drop file and run the door as that user. And if, at the same time someone on node 2 runs the same door, it will create and read the drop file and run it for that user, too. At least in my tests this is how it works. Since i'm running and executing the door from the BBS source code, there is no way (at least, not that I know of) to pass the node parameter to the door being launched. :/

    -ig

    ---
    þ Synchronet þ thePharcyde_ telnet://bbs.pharcyde.org (Wisconsin)