[HQ] Add auto lifing

This commit is contained in:
vilP1L
2019-08-14 19:04:20 -04:00
parent 4f78cc0e0b
commit 0e16fe08c4
3 changed files with 8 additions and 2 deletions

View File

@@ -29,6 +29,7 @@ Wilder Emu Bot + Trivia Emulator
- [X] Auto Splitting - [X] Auto Splitting
- [X] Auto Split Enhancements (split on last q, prize qs, etc) - [X] Auto Split Enhancements (split on last q, prize qs, etc)
- [X] Auto WS Logger - [X] Auto WS Logger
- [X] Auto Lifing
- [X] HQ Trivia Erasers - [X] HQ Trivia Erasers
### Discord Bot Commands ### Discord Bot Commands

View File

@@ -2,7 +2,7 @@
"discord": { "discord": {
"token": "NTc3OTM5NjA1NjA1ODQyOTQ2.XQa7Aw.fK9YdDKJ4gHxN21sumuYvQh_puA", "token": "NTc3OTM5NjA1NjA1ODQyOTQ2.XQa7Aw.fK9YdDKJ4gHxN21sumuYvQh_puA",
"prefix": ".", "prefix": ".",
"activity": "BETA", "activity": "WATCHING:HQ Die",
"defaultTokenSet": "bots.json", "defaultTokenSet": "bots.json",
"admins": ["471344177045569546", "448294491032518666"], "admins": ["471344177045569546", "448294491032518666"],
"channels": { "channels": {
@@ -94,6 +94,8 @@
"autoSplit": true, "autoSplit": true,
"autoSplitOnPrizeQuestions": true, "autoSplitOnPrizeQuestions": true,
"autoSplitOnLastQuestion": false, "autoSplitOnLastQuestion": false,
"autoLife": true,
"autoLifeQuestionThreshold": 9,
"splitThreshold": 0.65, "splitThreshold": 0.65,
"autoCheckpoints": true, "autoCheckpoints": true,
"checkpointThreshold": 1 "checkpointThreshold": 1

View File

@@ -3,7 +3,7 @@ import WebSocket from 'ws';
import { promisify } from 'util'; import { promisify } from 'util';
import 'colors'; import 'colors';
import faker from 'faker'; import faker from 'faker';
import { discord, proxy } from '../../config'; import { discord, proxy, hq } from '../../config';
import { getTokens, updateTokens } from '../utils/tokens'; import { getTokens, updateTokens } from '../utils/tokens';
import { getPhone, getCode } from '../utils/sms'; 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.master) console.log(`${' HQ '.bgBlue.black}${' Question Summary '.bgGreen.black}`);
if (!this.inTheGame) return; if (!this.inTheGame) return;
this.inTheGame = data.youGotItRight; 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}`); if (!this.inTheGame && this.logging) console.log(`${` Client ${this.index} `.bgBlue.black}${' Eliminated '.bgRed.black}`);
break; break;
case 'gameStatus': case 'gameStatus':