Is there a way to click a link only once using Greasemonkey?
Script is (e.g.):
var evt = document.createEvent ("HTMLEvents");
evt.initEvent ("click", true, true);
document.getElementById('DailyConsumtionTrigger').dispatchEvent(evt);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If the click is just time based (EG every 12 hours) then something like this will work:
Note that GM_setValue stores information semi-permanently, per script.
If the click is state or event based (EG Only click when gauge X nears zero), then test for the appropriate condition instead.
IMPORTANT:
The above was based on the stated question of “clicking only once”.
It assumes that the user will be browsing the target (game) site frequently and doesn’t want to over trigger the target button across page loads.
To trigger repeatedly, use setInterval();