Hide unwanted targets in Golem Overlord - A Tampermonkey script for more gaming fun

in #development2 years ago

You may know the problem: You play the popular browser game Golem and manually search through an endless list of targets that are displayed to you. But not all targets are attackable or of interest. This not only costs you valuable time, but can also be frustrating. This is where a little helper script comes into play that can make your life easier.

I got tired of this annoying manual searching of the target list, especially when many of them are not attackable anyway. So I came up with a simple solution. I asked ChatGPT to write a Tampermonkey script for me that would display a special button with a high Z-index on the Golem page. When you click this button, all uninteresting targets are automatically hidden. This saves time and allows you to focus on those targets that are relevant to your game.

image.png

The script is basically a small piece of code that runs in your browser and changes the way the Golem page is displayed. It adds a button that appears on the right side of the screen. When you click this button, something magical happens: all the targets that you would normally ignore simply disappear from the page. You no longer have to search for them manually or waste valuable time.

The idea behind this script is to improve the user experience and make the game more enjoyable and efficient. Instead of wasting time on unnecessary searches, you can now fully concentrate on the interesting challenges.

The Tampermonkey script is a great example of how technology can help us in our everyday lives, even with seemingly small tasks. It shows how a simple piece of code can greatly increase the usability of a game. If you too are annoyed by repetitive tasks in your online life, it might be worth looking for similar solutions. With a little technical help, you can save time and focus on the things that are really fun.

Overall, this little browser script is a handy tool for all Golem players who want to use their time more efficiently. It shows how technical solutions can improve our daily online experience, even with seemingly mundane challenges. Try it out and see how much time you can save on your next Golem adventure!

ezgif.com-video-to-gif.gif

This little script has already saved me personally a lot of valuable time. I no longer have to look closely to identify the right destinations in the list. Instead, I simply click on the button and the unimportant goals are hidden. This allows me to use my play time more effectively and focus on the challenges that really count.

I don't think this approach should be seen as forbidden. After all, I am merely using the information that the game already provides me with and adapting it to my own needs. It is not cheating or an unfair way of playing. It is simply a clever optimisation of the user experience.

The question is whether the developer itself should integrate such a feature into the game. It is certainly an interesting consideration. An official tool that allows players to increase clarity and focus on relevant goals could improve the overall game experience. It would reduce the need for such scripts and ensure that all players enjoy the same benefits.

What do you think about this? Have you had similar experiences with such scripts? Should the developer officially integrate such features into the game? Leave your opinions and thoughts in the comments.

Actual Version - Works Date September 15th, 2023

// ==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/*
// @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 => {
            div.style.display = 'none';
        });
    }

    // 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;
        }
    `);

    // Create the button and add it to the page
    createHideButton();

})();
Sort:  

Cool will try it.
!BEER


Hey @louis88, here is a little bit of BEER from @mein-senf-dazu for you. Enjoy it!

Learn how to earn FREE BEER each day by staking your BEER.

It is amazing to see how technology particularly AI can make our work easy. No matter now difficult the task might be, AI helps to minimize the stress. Your experience is a testament. Though, i'm not a lover of tampermonkey, but i'm sure it will help users that have already engaged in the adventure.

function hideDivsWithClass() { const divs = document.querySelectorAll('div.protection_remove'); divs.forEach(div => { const tr = div.closest('tr'); if (tr) { tr.style.display = 'none'; } }); }</code> Have tested it, but i prefer to remove whole line.