Highlight cancelled Rentals on PeakMonsters - A small Helper for Splinterland Rentals

avatar

image.png

Since some of us own a few thousand Splinterlands cards and also actively have these cards on the rental market at Splinterlands/Peakmonsters, the rentals need to be optimized from time to time. Unfortunately, I have not yet found a function at Peakmonsters that allows me to hide rentals that have already terminated when I work with the many cards. Normally, I go from top to bottom and click through all the checkboxes with the shift function. Unfortunately, some rental offers that have already been cancelled always end up in the selection, which in turn means that you either have to look again more closely or start again from the beginning.

For this reason, I just had my dear friend @snackaholic write me a little helper script that highlights all already ended rental offers with a red background when scrolling through the Peakmonsters view. With this visual advantage, it's now much faster and easier to optimize your rentals, since you don't have to focus on the little exclamation mark when scrolling and clicking.

All you need is the browser extension Tampermonkey and install the following Javascript as userscript in the extension. In the line // @match you change the username from @YOURUSERNAME to your username, so that the script is only called when you look at your own card collection.

You can download and install Tampermonkey here:

If u have installed the Script, head back to Peakmonsters, Filter your Collection and start Scroll down the Page. And see.. the Magic happen :)

Tampermonkey Userscript

// ==UserScript==
// @name         PeakMonsters_Highlight_cancelled
// @version      0.1
// @description  Install this Script using Tampermonkey. First Edit URL to Match your Useraccount on Peakmonsters. Head over to Peakmonsters and Start Scroll your Collection. Cancelled Rentals get highlighted. Thanks to @snackaholic for this little Helperscript.
// @author       @snackaholic
// @match        https://peakmonsters.com/@YOURUSERNAME/cards
// @icon         https://www.google.com/s2/favicons?domain=peakmonsters.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

let lastKnownScrollPosition = 0;
let ticking = false;

function doSomething(scrollPos) {
  document.querySelectorAll('[data-original-title*="Rental cancelled"]').forEach((item) => {item.parentElement.parentElement.parentElement.style = "background:red"})
}

document.addEventListener('scroll', function(e) {
  lastKnownScrollPosition = window.scrollY;

  if (!ticking) {
    window.requestAnimationFrame(function() {
      doSomething(lastKnownScrollPosition);
      ticking = false;
    });

    ticking = true;
  }
});
})();

Looks like this:

image.png

Script for the Developer Console

Go To Peakmonsters, go to your cards, check the Rentals. Press F12 and start the Developer Console. Paste the following Code and hit enter. (Have to be repeated when refreshing the site)

let lastKnownScrollPosition = 0;
let ticking = false;

function doSomething(scrollPos) {
  document.querySelectorAll('[data-original-title*="Rental cancelled"]').forEach((item) => {item.parentElement.parentElement.parentElement.style = "background:red"})
}

document.addEventListener('scroll', function(e) {
  lastKnownScrollPosition = window.scrollY;

  if (!ticking) {
    window.requestAnimationFrame(function() {
      doSomething(lastKnownScrollPosition);
      ticking = false;
    });

    ticking = true;
  }
});

image.png

Let me know if you can use the little helper and if you have the script in use. Also if you have any questions about it, feel free to post them in the comments. Also, if you might need a different kind of helpers, feel free to write it in the comments. 50% of the post payout goes to @snackaholic.

Greetings



0
0
0.000
3 comments
avatar

Oh I like that!

I actually limit my selections to 50 or less because it's so hard to see that damned exlamantion mark that usually signfifies an already cancelled card (first world problemss!)

!PIZZA

0
0
0.000
avatar

The lack of this functionality is frustrating. Thank you for a workaround!

0
0
0.000