Skip to content
Snippets Groups Projects
Commit 92225858 authored by echicken's avatar echicken :chicken:
Browse files

Command line arguments no longer supported, use modopts instead.

See readme.txt for details on modopts.d/wttr.ini.
parent 068f8b1f
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
require('sbbsdefs.js', 'P_UTF8');
const wttr = load({}, js.exec_dir + 'wttr-lib.js');
function parseArgs() {
const ret = {
qs: 'https://wttr.in/?AFn',
ttl: 0, // Seconds
};
for (var n = 0; n < argc; n++) {
const arg = parseInt(argv[n], 10);
if (isNaN(arg)) {
ret.qs = arg;
} else {
ret.ttl = arg;
}
}
return ret;
}
function main() {
const args = parseArgs();
const ansi = wttr.getWeather(args.qs, args.ttl);
const ansi = wttr.getWeather();
const attr = console.attributes;
console.clear(BG_BLACK|LIGHTGRAY);
console.putmsg(ansi, P_UTF8);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment