SPlex.gg Attack-Hide and Sort -Update
DE (EN below)
Hallo liebe Community,
mein letzter Beitrag ist schon wieder über 2 Wochen her, den ich eigentlich schon wenige Zeit nach dem Veröffentlichen überarbeiten wollte. Leider kam ich dann ins Krankenhaus.
Da es eine Änderung bei Golem Overlord gab, funktionierte das Script nicht mehr.
Hier nun endlich das Update dazu:
// ==UserScript==
// @name SPlex.gg Attack-Hide
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Add a button to hide divs with class "protection_remove" on https://go.splex.gg/
// @author louis88 + ChatGPT
// @match https://go.splex.gg/*
// @require https://cdn.rawgit.com/thekit/jquery.waitforkeyelements/1.4.0/dist/jquery.waitForKeyElements.min.js
// @require https://code.jquery.com/jquery-3.6.0.min.js
// @grant GM_addStyle
// ==/UserScript==
(function() {
'use strict';
// Function for hiding divs with the "protection_remove" class
function hideDivsWithClass() {
const divs = document.querySelectorAll('div.protection_remove');
divs.forEach(div => {
const tr = div.closest('tr');
if (tr) {
tr.style.display = 'none';
}
});
sortTableByStealValue();
}
function sortTableByStealValue() {
console.log("tablesort");
var table = document.querySelector("table.go_menu_no_pad"); // Die Tabelle auswählen
var rows = Array.from(table.querySelectorAll("tr.attack_lb")); // Alle Zeilen auswählen und in ein Array umwandeln
// Die Zeilen sortieren
rows.sort(function (a, b) {
console.log(a,b);
var spanA = a.querySelector(".lb_steal span"); // Das span-Element in der ersten Zeile
var spanB = b.querySelector(".lb_steal span"); // Das span-Element in der zweiten Zeile
var valueA = parseFloat(spanA.textContent.replace("~","")); // Den Wert in der ersten Zeile extrahieren und in eine Fließkommazahl umwandeln
var valueB = parseFloat(spanB.textContent.replace("~","")); // Den Wert in der zweiten Zeile extrahieren und in eine Fließkommazahl umwandeln
// Vergleiche die Werte und sortiere die Zeilen aufsteigend
return valueB - valueA;
});
// Die sortierten Zeilen zur Tabelle hinzufügen
var tbody = table.querySelector("tbody");
rows.forEach(function (row) {
tbody.appendChild(row);
});
}
// Function to create the button and define the click behaviour
function createHideButton() {
const button = document.createElement('button');
button.innerText = 'Hide Players';
button.style.position = 'fixed';
button.style.top = '50%';
button.style.right = '10px';
button.style.transform = 'translateY(-50%)';
button.style.zIndex = '9999'; // Hocher Z-Index
button.addEventListener('click', hideDivsWithClass);
document.body.appendChild(button);
}
// Add CSS styles to format the button
GM_addStyle(`
button {
padding: 25px;
background-color: #007BFF;
color: white;
border: none;
cursor: pointer;
}
`);
function addMaxUpgrade(){
$(".upgrade").on("click", function() {
waitForKeyElements("div.go_menu_body > div.row > div > img.small_upgrade_skill_2",addMaxUpgradeOnclick);
});
}
function addMaxUpgradeOnclick(){
$("div.go_menu_body > div.row > div > img.small_upgrade_skill_2").on("click", function() {
console.log("blub");
});
}
// Create the button and add it to the page
createHideButton();
addMaxUpgrade();
console.log("Blub",window.jQuery);
})();
Das Update findet ihr hier:
https://jsfiddle.net/hive_coding/dn2q075g/3/
Es ist ein Script für Tampermonkey!
EN
Hello dear community,
my last post was more than 2 weeks ago, which I actually wanted to revise a short time after publishing it. Unfortunately I ended up in hospital.
Since there was a change at Golem Overlord, the script didn't work anymore.
Here is the update at last:
// ==UserScript==
// @name SPlex.gg Attack-Hide
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Add a button to hide divs with class "protection_remove" on https://go.splex.gg/
// @author louis88 + ChatGPT
// @match https://go.splex.gg/*
// @require https://cdn.rawgit.com/thekit/jquery.waitforkeyelements/1.4.0/dist/jquery.waitForKeyElements.min.js
// @require https://code.jquery.com/jquery-3.6.0.min.js
// @grant GM_addStyle
// ==/UserScript==
(function() {
'use strict';
// Function for hiding divs with the "protection_remove" class
function hideDivsWithClass() {
const divs = document.querySelectorAll('div.protection_remove');
divs.forEach(div => {
const tr = div.closest('tr');
if (tr) {
tr.style.display = 'none';
}
});
sortTableByStealValue();
}
function sortTableByStealValue() {
console.log("tablesort");
var table = document.querySelector("table.go_menu_no_pad"); // Die Tabelle auswählen
var rows = Array.from(table.querySelectorAll("tr.attack_lb")); // Alle Zeilen auswählen und in ein Array umwandeln
// Die Zeilen sortieren
rows.sort(function (a, b) {
console.log(a,b);
var spanA = a.querySelector(".lb_steal span"); // Das span-Element in der ersten Zeile
var spanB = b.querySelector(".lb_steal span"); // Das span-Element in der zweiten Zeile
var valueA = parseFloat(spanA.textContent.replace("~","")); // Den Wert in der ersten Zeile extrahieren und in eine Fließkommazahl umwandeln
var valueB = parseFloat(spanB.textContent.replace("~","")); // Den Wert in der zweiten Zeile extrahieren und in eine Fließkommazahl umwandeln
// Vergleiche die Werte und sortiere die Zeilen aufsteigend
return valueB - valueA;
});
// Die sortierten Zeilen zur Tabelle hinzufügen
var tbody = table.querySelector("tbody");
rows.forEach(function (row) {
tbody.appendChild(row);
});
}
// Function to create the button and define the click behaviour
function createHideButton() {
const button = document.createElement('button');
button.innerText = 'Hide Players';
button.style.position = 'fixed';
button.style.top = '50%';
button.style.right = '10px';
button.style.transform = 'translateY(-50%)';
button.style.zIndex = '9999'; // Hocher Z-Index
button.addEventListener('click', hideDivsWithClass);
document.body.appendChild(button);
}
// Add CSS styles to format the button
GM_addStyle(`
button {
padding: 25px;
background-color: #007BFF;
color: white;
border: none;
cursor: pointer;
}
`);
function addMaxUpgrade(){
$(".upgrade").on("click", function() {
waitForKeyElements("div.go_menu_body > div.row > div > img.small_upgrade_skill_2",addMaxUpgradeOnclick);
});
}
function addMaxUpgradeOnclick(){
$("div.go_menu_body > div.row > div > img.small_upgrade_skill_2").on("click", function() {
console.log("blub");
});
}
// Create the button and add it to the page
createHideButton();
addMaxUpgrade();
console.log("Blub",window.jQuery);
})();
You can find the update here:
https://jsfiddle.net/hive_coding/dn2q075g/3/
It is a script for Tampermonkey!
Leave SPlex.gg Attack-Hide and Sort -Update to:
Read more #hive-169321 posts
Best Posts From hive-coding
We have not curated any of hive-coding's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From hive-coding
- Google VS ChatGPT (Plesk), and the winner is
- HiveSQL: Time of posts / Uhrzeit der Posts
- HiveSQL: Unused Hivepower - Ungenutze Hivepower
- HiveSQL: Age of active accounts
- HiveSQL: Monthly Active Users / User Registrations / Monthly Posts & Comments
- beneficiaries from DHF- begünstigte vom DHF
- HiveSQL: Top 100 HBD holders HiveSQL: Top 100 HBD Besitzer
- Which frontend ist used for Posting - Welches Frontend wird fürs Posten genutzt?
- KE with hive.min.js not possible - KE mit hive.min.js nicht möglich
- Get KE in HiveSQL - KE mit HiveSQL abfragen
- SPlex.gg Attack-Hide and Sort -Update
- SPlex.gg Attack-Hide and Sort
- hive-engine: How to retrieve data - Wie Daten abrufen
- Hivekeychain: how to send a comment - Wie sendet man ein Kommentar
- Keychain: How to sell your Dust Token - Wie verkauft man seine Staub-Token #19
- Hive-Engine: How to sell your Dust Token - Wie verkauft man seine Staub-Token
- HSBI API: Show Sponsor with HSBI unit and Date - Sponsoren anzeigen mit der HSBI Anzahl und dem Datum
- HiveJS: How to get current Voting Power ? - Wie erhält man die aktuelle Voting Power? #17
- HiveJS: get info and vote for witness - Informationen erhalten und für Witness voten #16
- Hivejs: How to delegtae hivepower - Wie delegiert man Hivepower? # 15