From 0e16fe08c411da5a9b6c9382bd0b92c970f71635 Mon Sep 17 00:00:00 2001 From: vilP1L Date: Wed, 14 Aug 2019 19:04:20 -0400 Subject: [PATCH] [HQ] Add auto lifing --- README.md | 1 + config.json | 4 +++- src/classes/Client.js | 5 ++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bdda7ea..47afefa 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ Wilder Emu Bot + Trivia Emulator - [X] Auto Splitting - [X] Auto Split Enhancements (split on last q, prize qs, etc) - [X] Auto WS Logger +- [X] Auto Lifing - [X] HQ Trivia Erasers ### Discord Bot Commands diff --git a/config.json b/config.json index d11e8d9..7dda63a 100644 --- a/config.json +++ b/config.json @@ -2,7 +2,7 @@ "discord": { "token": "NTc3OTM5NjA1NjA1ODQyOTQ2.XQa7Aw.fK9YdDKJ4gHxN21sumuYvQh_puA", "prefix": ".", - "activity": "BETA", + "activity": "WATCHING:HQ Die", "defaultTokenSet": "bots.json", "admins": ["471344177045569546", "448294491032518666"], "channels": { @@ -94,6 +94,8 @@ "autoSplit": true, "autoSplitOnPrizeQuestions": true, "autoSplitOnLastQuestion": false, + "autoLife": true, + "autoLifeQuestionThreshold": 9, "splitThreshold": 0.65, "autoCheckpoints": true, "checkpointThreshold": 1 diff --git a/src/classes/Client.js b/src/classes/Client.js index 852738a..ebd0ab4 100644 --- a/src/classes/Client.js +++ b/src/classes/Client.js @@ -3,7 +3,7 @@ import WebSocket from 'ws'; import { promisify } from 'util'; import 'colors'; import faker from 'faker'; -import { discord, proxy } from '../../config'; +import { discord, proxy, hq } from '../../config'; import { getTokens, updateTokens } from '../utils/tokens'; import { getPhone, getCode } from '../utils/sms'; @@ -176,6 +176,9 @@ export default class Client { if (this.master) console.log(`${' HQ '.bgBlue.black}${' Question Summary '.bgGreen.black}`); if (!this.inTheGame) return; this.inTheGame = data.youGotItRight; + if (!this.inTheGame && hq.autoLife && this.hasExtraLife) { + if (this.questionNumber > hq.autoLifeQuestionThreshold) this.useExtraLife(); + } if (!this.inTheGame && this.logging) console.log(`${` Client ${this.index} `.bgBlue.black}${' Eliminated '.bgRed.black}`); break; case 'gameStatus':