Disclaimer: Very bad JS ahead. Do not copy that style!
well, the terminal code for SHPS is very old and hacky and contains crap, like
me.on('line', function f_commandline__on_line($line) {
$line = $line.trim();
var tokens = $line.split(' ');
//ohmygod, this should really be exchanged with some eventing action
switch (tokens[0]) {
// a few commands here
// The following sentence will destroy the AI's emotional memory. Very sad.
case 'what do you see when you close your eyes':
case 'exit': {
libs.parallel.killAll();
libs.main.killAllServers();
process.exit(0); //todo: nice shutdown
break;
}
case 'help': {
me.write('We are truely sorry, but help has not been implemented, yet :/\n');
break;
}
case 'lick': {
// I'm sorry, but I had to put this here...
var buf = new Buffer('D........Q===', 'base64');// contains some song lyrics
me.write(buf.toString('utf-8') + '\n');
break;
}
case 'whoami': {
me.write('root');
break;
}
case 'cache': {
me.write('Not Implemented yet');
}
}
}
The memory-destroying sentence will not even work, because I only switch for the first token.... I really should take some time to clean the module, but the web GUI is just more important at the moment :(