Greasemonkey change value by 5

But to add to this… It is a bit stupid to allow an integer to be concatenated to a string. This is what typescript fixes, and I love typescript for the same. :)


Nopes. That should not be a problem. The problem is the event listener I think. Try console logging inside the listener and see whether it indeed fires like you expect it to.

Yes, as an expert in coding stuffs, I agree. Integer, concatenated to a string, typescript fixes, yeah all of that spot on :D

No it should work.

Actually it seems to work now.

This is my GM script:

JavaScript:
// ==UserScript==
// @name        sdf
// @namespace   zxc
// @include     https://www.site.com/page/*
// @version     1
// @grant       none
// ==/UserScript==

var intv = setTimeout(function() {
   
    document.getElementById("reward").value = parseInt(document.getElementById("reward").value) + 5;
   
        }, 3000);

Hold on im gonna do some quick testing to make sure it works between browsers and different values and whatnot...
 
Okay guys, tested across multiple browsers (older Mypal and older Firefox) and multiple accounts and different values, and it works perfectly.

Thanks a lot guys, you're the best :)
 
Back
Top