• Re: Stupid javascript tri

    From Mindless Automaton@VERT/ELDRITCH to Mindless Automaton on Wed Jul 26 07:47:00 2006
    Mindless Automaton wrote:
    Alrighty, there's a thread in Sync Discussion base about no one sharing javascript, so I thought I'd share mine and show you why I don't share
    them? Check this out..

    I use this to display a random logoff.ans. You have your logoff menu
    and use this as the option to logoff the user.


    //Here comes the script..//

    fname="logoff";
    var num = random(5)+1; //Change the number in the parenthesis to
    the number of ansis you have.
    fname+=num;
    bbs.menu(fname);
    bbs.hangup();

    //End of script//


    Even better, using a few lines from logon.js v1.7 by Digital Man, you get:

    //Start script//

    console.clear();
    var random_list = directory(system.text_dir + "menu/logoff*.*"); if(random_list.length)
    bbs.menu(file_getname(random_list[random(random_list.length)]).slice(0,-4));
    bbs.hangup();

    //End Script//

    This little tidbit can be used to display any random ansi. You can sub bulletin*.* or whatever for logoff*.* and have a random bulletin or
    somesuch.

    Thanks Digital Man!

    -Mindless Automaton
    ---
    þ Synchronet þ Eldritch Clockwork BBS