Skip to content

Instantly share code, notes, and snippets.

@nickshanks347
Created July 27, 2023 13:18
Show Gist options
  • Save nickshanks347/9b73f1dd5b998a46f68bd339a6416104 to your computer and use it in GitHub Desktop.
Save nickshanks347/9b73f1dd5b998a46f68bd339a6416104 to your computer and use it in GitHub Desktop.
Press any key to initiate login on Synchronet
// place this snippet before for(var c=0; c < options.login_prompts; c++)
console.center("\1n\1h\1cPress \1h\1wESC\1n\1h\1c or \1h\1w%\1n\1h\1c now to login\1n\1w.\1h");
console.up();
var keypressed = console.inkey(0, 10000); // wait ten seconds (10 thousand milliseconds)
if (ascii(keypressed) != 27 && ascii(keypressed) != 37) {
console.clearline();
console.center("\x01n\x01r\x01h\x01iFailed. \x01n\x01k\x01hDisconnecting.");
log(LOG_WARNING,"Failed; key pressed: " + keypressed);
bbs.hangup();
} else {
console.clearline();
console.center("\x01n\x01g\x01h\x01iLogin initiated\x01n\x01w\x01h");
console.inkey(0, 2000); // wait two seconds (2 thousand milliseconds)
console.up();
console.clearline();
// for(var c=0; c < options.login_prompts; c++) {
// existing login code...
// }
}
// Login failure
bbs.hangup();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment