Example #1
0
(function () {
    var tmp=[];

    agml.parse(Fs.readFileSync('./config.agml', 'utf-8'), tmp);

    // bools
    ['debug', 'floodProtection', 'autoRejoin', 'autoConnect', 'trustee']
        .forEach(function (k) {
            config[k] = tmp[0][k] === 'true';
        });

    // ints
    ['floodProtectionDelay']
        .forEach(function (k) {
            config[k] = parseInt(tmp[0][k]);
        });

    // split strings
    config.channels = tmp[0].channels.trim().split(/\s+/);

    // plain old strings
    ['userName']
        .forEach(function (k) {
            config[k] = tmp[0][k].trim();
        });

    /* Now network things... */
    network.nick = tmp[1].nick;
    network.domain = tmp[1].domain;
    network.trigger = tmp[1].trigger || '.';
}());
Example #2
0
 process.stdin.on('data',function(chunk){
     buffer+=(chunk);
     if(/\-{3}/.test(buffer)){
         // there may be a block of AGML present
         if(block.test(buffer)){
             buffer=agml.parse(buffer,target);
         }
     }
 });