-
Notifications
You must be signed in to change notification settings - Fork 3
/
start-aucgbot
executable file
·45 lines (40 loc) · 1.21 KB
/
start-aucgbot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env jsdb
// -*- Mode: JavaScript; tab-width: 4 -*- vim:tabstop=4 syntax=javascript:
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*jshint expr: true */
/*global aucgbot: false, print: false, println: false, readln: false, run: false, sleep: false, system: false */
system.cwd = system.script.replace(/[^\\\/]+?$/, "");
run("aucgbot.js");
if (!this.aucgbot) {
println("aucgbot could not be loaded.");
println("system.cwd = ", system.cwd);
sleep(750);
system.exitCode = 1;
system.exit();
}
print("\nLoad modules: ");
for (let s = readln().trim().split(","); m=s.shift();) {
try {
aucgbot.loadModule(m);
} catch (ex) {
println(ex);
println(ex.stack);
}
}
{
let servers = [];
for (let s = true, server; s;) {
server = [];
for (let i = 0, prompts = ["\nHostname", "Port", "Nickname", "Ident", "Pass", "Channels", "SASL user", "SASL pass"]; i < prompts.length; i++) {
print(prompts[i], ": ");
server.push(readln());
}
servers.push(server);
print("Add another server? ");
s = readln()[0] == "y";
println();
}
aucgbot.start.apply(aucgbot, servers);
}