Skip to content

Commit c466068

Browse files
committed
fix: nicks count check and option rename
1 parent 22c05d1 commit c466068

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ When running, you can write a chat message to the terminal to send it by all bot
3636
`-t` Set proxy type - SOCKS4 or SOCKS5
3737
`-l` Set proxy list file
3838
`-g` Try to simulate gravity by falling down
39-
`-nicks` Set nicknames file
39+
`--nicks` Set nicknames file
4040

4141
## ⚠ DISCLAIMER
4242
**This app is made for educational and testing purposes only.

src/main/java/me/creepermaxcz/mcbots/Main.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public static void main(String[] args) throws Exception {
6363
options.addOption("l", "proxy-list", true, "Path or URL to proxy list file with proxy:port on every line");
6464
options.addOption("t", "proxy-type", true, "Proxy type: SOCKS4 or SOCKS5");
6565

66-
options.addOption("nicks", true, "Path to nicks file with nick on every line");
66+
options.addOption(null, "nicks", true, "Path to nicks file with nick on every line");
6767

6868
options.addOption("g", "gravity", false, "Try to simulate gravity by falling down");
6969

@@ -198,6 +198,12 @@ public static void main(String[] args) throws Exception {
198198
if (cmd.hasOption("nicks")) {
199199
Log.info("Loading nicknames from specified file");
200200
int nicksCount = nickGen.loadFromFile(cmd.getOptionValue("nicks"));
201+
202+
if (nicksCount == 0) {
203+
Log.error("No valid nicknames loaded");
204+
System.exit(1);
205+
}
206+
201207
if (nicksCount < botCount) {
202208
Log.warn("Nickname count is lower than bot count!");
203209
Thread.sleep(3000);

0 commit comments

Comments
 (0)