Skip to content

Commit

Permalink
initial warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbots committed Jul 15, 2022
1 parent e9bb446 commit e6e9b04
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion app/config/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"whitelistWords": "",
"whiteListBlueGreen": false,
"whitelistLanguage": "eng",
"threshold": 60
"threshold": 60,
"initial": true
}
12 changes: 9 additions & 3 deletions app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ const createWindow = async () => {
win.webContents.send('set-version', version);
});

ipcMain.on("start-bot", async (event, settings) => {
ipcMain.on("start-bot", async () => {
const config = getJson("./config/bot.json");
const settings = getJson("./config/settings.json");

const log = createLog((data) => {
win.webContents.send("log-data", data);
});
Expand Down Expand Up @@ -167,10 +169,14 @@ const createWindow = async () => {
log.ok(`Found ${games.length} window${games.length > 1 ? `s` : ``} of the game!`);
}

if ((settings.game == "Retail" || settings.game == "Classic") &&
showChoiceWarning(win, `Using bots on official servers is prohibited. Your account might be banned for a long time.`)) {
if (settings.initial && (settings.game == "Retail" || settings.game == "Classic")) {
if(showChoiceWarning(win, `Using bots on official servers is prohibited. Your account might be banned for a long time.`)) {
win.webContents.send('stop-bot');
return;
} else {
settings.initial = false;
writeFileSync(path.join(__dirname, "./config/settings.json"), JSON.stringify(settings));
}
}

if(settings.fishingKey === `` || settings.luresKey === ``) {
Expand Down

0 comments on commit e6e9b04

Please sign in to comment.