• Re: JS: Exec, Load or DIE

    From Tracker1@TRN to Mindless Automaton on Monday, June 20, 2005 07:44:00
    Mindless Automaton wrote:
    I've been doing some fiddlin' with js menus and was wondering if someone could give me the correct syntax to call another js.

    Ie.

    I have default.js which has most of the menu options in it, but it was getting rather large, so I created an additional js for external programs
    and such (xtrn.js).

    I've tried a few things, but I seem to fail.

    USE:
    load("xtrn.js");
    or
    bbs.exec("?xtrn.js");

    use the load if you can... it will give you less headaches in the end, trust me... if you need params, load("xtrn.js","param1","param2"...);

    --
    Michael J. Ryan - tracker1(at)theroughnecks(dot)net - www.theroughnecks.net icq: 4935386 - AIM/AOL: azTracker1 - Y!: azTracker1 - MSN/Win: (email)

    ---
    ■ Synchronet ■ theroughnecks.net - you know you want it
  • From Mindless Automaton@ELDRITCH to Tracker1 on Wednesday, September 14, 2005 19:08:00
    Tracker1 wrote:
    I've tried a few things, but I seem to fail.


    USE:
    load("xtrn.js");
    or
    bbs.exec("?xtrn.js");

    use the load if you can... it will give you less headaches in the end, trust me... if you need params, load("xtrn.js","param1","param2"...);


    Alrighty, I changed the logon.js? (login, logon, I get the names confused) to have it run bullseye.js using load("bullseye.js") instead of the regular way bullseye.bin was set up to run. However, when I hit enter to continue from bullseye, I am get bullseye again and I can't escape!

    Therefore, there is probably a way to execute a js from the original file and return to the original file when that script is done that I haven't figured out.

    Right now I split the logon/login one in two so it loads log?n, loads bullseye,
    loads the other half, which is probably not the best way to go.

    If I switch back to loading bullseye as a logon event (set up through scfg) should the command line be ?bullseye.js or ?

    Also how/when do you know to use a ? or * in something like bbs.exec("?xtrn.js"); and why isn't it used in load("xtrn.js");?

    Many thanks,

    -Mindless Automaton
    ---
    ■ Synchronet
  • From Melkor@STARFRON to Mindless Automaton on Wednesday, September 14, 2005 22:22:00

    If I switch back to loading bullseye as a logon event (set up through scfg) should the command line be ?bullseye.js or ?
    I changed mine in scfg to ?bullseye.js and it runs perfectly..


    ...First secure an independent income, then practice virtue.
    Join StarNet today.. Http://starfrontiers.dyndns.org


    ---
    ■ Synchronet ■ Star Frontiers Home of StarNet Telnet://starfrontiers.dyndns.org
  • From Digital Man to Mindless Automaton on Wednesday, September 14, 2005 22:47:54
    Re: Re: JS: Exec, Load or DIE
    By: Mindless Automaton to Tracker1 on Wed Sep 14 2005 07:08 pm

    Also how/when do you know to use a ? or * in something like bbs.exec("?xtrn.js"); and why isn't it used in load("xtrn.js");?

    bbs.exec() can be used to run all kinds of modules:
    * 16-bit DOS applications
    * 32-bit native applications
    * Baja modules
    * JavaScript modules

    '?' is used to indicate that the module being executed is a JavaScript module. '*' is used to indicate that the module being executed is a Baja (.bin) module.

    load() can only be used to execute other JavaScript modules, so no '?' is needed.

    digital man

    Snapple "Real Fact" #25:
    The only food that does not spoil is honey.
  • From Mindless Automaton@ELDRITCH to Melkor on Thursday, September 15, 2005 10:18:00
    Melkor wrote:

    If I switch back to loading bullseye as a logon event (set up through scfg)
    should the command line be ?bullseye.js or ?
    I changed mine in scfg to ?bullseye.js and it runs perfectly..


    Alrighty, I'll probably go back and try that then.

    Thanks,

    Mindless Automaton
    ---
    ■ Synchronet
  • From Mindless Automaton@ELDRITCH to Digital Man on Thursday, September 15, 2005 10:18:00
    Digital Man wrote:
    Re: Re: JS: Exec, Load or DIE
    By: Mindless Automaton to Tracker1 on Wed Sep 14 2005 07:08 pm

    Also how/when do you know to use a ? or * in something like bbs.exec("?xtrn.js"); and why isn't it used in load("xtrn.js");?

    bbs.exec() can be used to run all kinds of modules:
    * 16-bit DOS applications
    * 32-bit native applications
    * Baja modules
    * JavaScript modules

    '?' is used to indicate that the module being executed is a JavaScript module.
    '*' is used to indicate that the module being executed is a Baja (.bin) module.

    load() can only be used to execute other JavaScript modules, so no '?' is needed.

    digital man

    Excellent. Thanks for the clarification.

    -Mindless Automaton
    ---
    ■ Synchronet