• Stupid Oneliner Tricks

    From Mindless Automaton@VERT/ELDRITCH to DOVE-Net.Programming_(Javascript) on Friday, April 10, 2015 15:58:09
    var initJSON = function() {
    try {
    oneliners = new Oneliners(settings.server, settings.port, putOneliner);
    var count = oneliners.count;
    if(count > onelinersFrame.height)
    var lines = oneliners.read(count - onelinersFrame.height);
    else
    var lines = oneliners.read(0);
    for(var line in lines)
    putOneliner(lines[line]);
    oneliners.callback = putOneliner;

    var count = oneliners.count;
    if(count > 17)
    var lines = oneliners.read(count - 17);
    else
    var lines = oneliners.read(0);
    for(var line in lines)
    putBarOneliner(lines[line]);
    oneliners.callback = putBarOneliner;

    } catch(err) {
    log(LOG_ERR, "Oneliners error: " + err);
    exit();
    }
    }

    var putBarOneliner = function(oneliner) {
    oneliner.oneliner = strip_exascii(oneliner.oneliner);
    if(oneliner.oneliner.length < 1)
    return;

    var f=new File(system.exec_dir + "../xtrn/DOS/L/lord/bar.txt");
    if(f.open("a", true)) {
    f.writeln(
    format(
    " `7%s@%s:\r\n `2%s",
    oneliner.alias,
    oneliner.qwkid,
    pipeToCtrlA(
    ( oneliner.oneliner.length
    +
    oneliner.alias.length
    +
    oneliner.qwkid.length
    +
    3
    >
    onelinersFrame.width
    )
    ?
    oneliner.oneliner.substr(
    0,
    onelinersFrame.width
    -
    ( oneliner.alias.length
    +
    oneliner.qwkid.length
    +
    3
    )
    )
    :
    oneliner.oneliner
    )
    )
    );
    f.close();
    }

    if(onelinersFrame.data_height > 34)
    onelinersFrame.scroll(0, 1);
    }
    ---
    � Synchronet � Eldritch Clockwork BBS - eldritch.darktech.org
  • From Mindless Automaton@VERT/ELDRITCH to Mindless Automaton on Friday, April 10, 2015 16:07:44
    On 4/10/2015 3:58 PM, "Mindless Automaton" wrote:
    var initJSON = function() {

    I was bored with the same all bar talk in LORD so I screwed this script
    up. ;P

    Changing/adding the code to framed.js appends the oneliners into your
    bar.txt for your LORD game.

    LORD has some issues if the file has a certain number of lines I think.

    Also I didnt do anything to account for lines added by players in the
    game. They only show up in game, they dont get posted to onelines.

    Probably need some kind of cleanup to trim the bar.txt down.

    Enjoy!

    -Mindless Automaton
    ---
    � Synchronet � Eldritch Clockwork BBS - eldritch.darktech.org