Skip to content

Commit 6a98fd8

Browse files
committed
Version 1.4
Fix extension to work for new keydrop layout, Note: extension sometimes joins to 100,1000 ticket battles for now i leave it, maybe in future update to join only for 1 ticket battles
1 parent 0cae3e0 commit 6a98fd8

File tree

4 files changed

+21
-18
lines changed

4 files changed

+21
-18
lines changed

extension/manifest.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,5 @@
2727
"open_in_tab": true,
2828
"page": "options.html"
2929
}
30-
3130

3231
}

extension/popup.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
<div class="text">
1616
Use code tutek
1717
</div>
18+
1819
<div class="btn" id="join-button">
19-
<span>Join Battle</span>
20+
<span id="txtbtl" data-after="Join Battle" isActive="false"></span>
2021
</div>
2122
</div>
2223
<div class="bar">
@@ -41,7 +42,7 @@
4142
</div>
4243
</div>
4344
<div class="madeby">
44-
<span>Version 1.3 - By Shkyyl / UI-UX by Walison Martins</span>
45+
<span>Version 1.3 - By Shkyyl / UI-UX by walyin#2365 on DC</span>
4546
</div>
4647
</div>
4748
</body>

extension/popup.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
function joinCaseBattle(){
2-
3-
chrome.storage.local.get(["TARGETS"], function(result){
1+
function joinCaseBattle() {
2+
chrome.storage.local.get(["TARGETS"], function(result) {
43
const targets = result.TARGETS || ['TOXIC', 'DIABLO', 'SPARK', 'ICE BLAST', 'TEETH', 'BEAST', 'SERENITY', 'JOY', 'PROGRESS', 'KITTY', 'ONYX'];
54
(async () => {
65
while (true) {
76
await new Promise(r => setTimeout(r, 100));
87
try {
9-
const caseNames = (([...document.querySelectorAll('p.max-w-full.px-1.overflow-hidden')]).splice(0, 10)).map(e => e.textContent);
10-
const casePrices = (([...document.querySelectorAll('div.flex.items-center.justify-center.rounded-tl-lg')]).splice(0, 10)).map(e => e.textContent);
11-
if (casePrices[caseNames.indexOf(caseNames.find(name => targets.includes(name)))] === 'FREE' && caseNames.some(str => targets.includes(str))) {
8+
const caseNames = [...document.querySelectorAll('p.max-w-full.px-1.overflow-hidden')].splice(0, 5).map(e => e.textContent);
9+
const casePrices = [...document.querySelectorAll('div.w-fit p.text-center.font-semibold.leading-none')].splice(0, 5).map(e => e.textContent);
10+
const targetIndex = caseNames.findIndex(name => targets.includes(name));
11+
if (casePrices[targetIndex] === 'x1' && targetIndex !== -1) {
1212
const btns = [...document.querySelectorAll('a.button.mr-5')];
13-
const btn = btns[caseNames.indexOf(caseNames.find(name => targets.includes(name)))];
13+
const btn = btns[targetIndex];
1414
btn.click();
15-
}
15+
}
1616
} catch {null;}
1717
}
1818
})();
19-
})
19+
});
2020
}
2121

22-
document.addEventListener("DOMContentLoaded", function(){
23-
document.getElementById("join-button").addEventListener('click', function(){
22+
document.addEventListener("DOMContentLoaded", function() {
23+
document.getElementById("join-button").addEventListener('click', function() {
2424
chrome.tabs.query({ active: true, currentWindow: true }, function(tabs) {
2525
if (tabs.length > 0) {
2626
var tabId = tabs[0].id;
@@ -32,8 +32,8 @@ document.addEventListener("DOMContentLoaded", function(){
3232
console.error("No active tab found.");
3333
}
3434
});
35-
})
36-
document.getElementById("options-button").addEventListener('click', function(){
35+
});
36+
document.getElementById("options-button").addEventListener('click', function() {
3737
chrome.runtime.openOptionsPage();
38-
})
39-
})
38+
});
39+
});

extension/style.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ body{
6464
background-color: #ffcc00;
6565
box-shadow: 5px 5px 12px #ffcc004d;
6666
}
67+
.btn span::after{
68+
content: attr(data-after);
69+
}
6770
.bar{
6871
display: flex;
6972
flex-direction: row;

0 commit comments

Comments
 (0)