Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions autobsc.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// @homepageURL https://github.com/LaptopCat/AutoBSC
// @supportURL https://github.com/LaptopCat/AutoBSC/issues
// @license MIT
// @version 0.2.4
// @version 0.2.5
// @description Auto completes Brawl Stars Championship live stream events
// @author laptopcat
// @match https://event.supercell.com/brawlstars/*
Expand Down Expand Up @@ -182,15 +182,15 @@ function purge(elements) {
}

if (lowDetail) {
purge(document.getElementsByClassName("Cheer__gradient"))
purge(document.getElementsByClassName("Cheer__canvas"))
purge(document.getElementsByClassName("cheer__gradient"))
purge(document.getElementsByClassName("cheer__canvas"))
}

if (cheerEnabled && event.payload.typeId !== lastCheerId) {
log("Sending cheer");

setTimeout(() => {
for (let btn of document.getElementsByClassName("cheer-btn-container__cheer-btn")) {
for (let btn of document.getElementsByClassName("cheerButtonContainer__cheerButton")) {
btn.click()
}
}, 500)
Expand All @@ -204,7 +204,7 @@ function purge(elements) {

setTimeout(() => {
try {
for (let que of document.getElementsByClassName("MultiChoiceQuestionCard")) {
for (let que of document.getElementsByClassName("multiChoiceQuestionCard")) {
que.getElementsByTagName("button")[0].click()
}
} catch (e) {
Expand All @@ -226,7 +226,7 @@ function purge(elements) {
continue
}

que.getElementsByClassName("MultiChoiceQuestionCard__button")[event.payload.correctAnswer.alternative].click()
que.getElementsByClassName("multiChoiceQuestionCard__button")[event.payload.correctAnswer.alternative].click()
} catch (e) {
console.error("[AutoBSC]", e)
}
Expand Down Expand Up @@ -266,7 +266,7 @@ function purge(elements) {
break
}
log(`Placing prediction for ${team === 0 ? "blue" : "red"}`)
for (let a of document.getElementsByClassName("MatchPredictionQuestionCard__buttonGroup")) {
for (let a of document.getElementsByClassName("matchPredictionQuestionCard__buttonGroup")) {
try {
a.getElementsByTagName("button")[team].click()
} catch (e) {
Expand All @@ -284,9 +284,9 @@ function purge(elements) {
log("Collecting loot drop")

setTimeout(() => {
for (let drop of document.getElementsByClassName("LootDropCard")) {
for (let drop of document.getElementsByClassName("lootDropCard")) {
try {
drop.getElementsByClassName("RectangleButton")[0].click()
drop.getElementsByClassName("rectangleButton")[0].click()
} catch (e) {
console.error("[AutoBSC]", e)
}
Expand All @@ -301,7 +301,7 @@ function purge(elements) {
log("Collecting slider")

setTimeout(() => {
for (let drop of document.getElementsByClassName("SliderQuestionCard")) {
for (let drop of document.getElementsByClassName("sliderQuestionCard")) {
try {
let elem = drop.getElementsByTagName("input")[0]
elem.value = "100"
Expand Down