My issue is that the tempEmail and tempPass are different. Any suggestions to make it static, so the values never change? I have tried using "let" and "var". This has been made with TamperMonkey javascript. Any help would be appreciated. I am not calling it twice? I don't see why they would have different values. (when i print tempEmail and tempPass at different times, they have different valuyes (??)) I have also tried making tempEmail + tempPass const.
// ==UserScript==
// @name Test
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://*/*
// @grant window.close
// @grant window.focus
// @grant GM_setValue
// ==/UserScript==
const domains = ["@gmail.com", "@hotmail.com", "@outlook.com"];
var username = makeid(getRandomInt(6, 12));
var email = username + domains[Math.floor(Math.random() * domains.length)];
var password = makeid(5);
var tempEmail = email;
var tempPass = password;
function sendMessage() {
console.log(tempEmail + ":" + tempPass);
}
function makeid(length) {
var result = '';
var characters = 'abcdefghijklmnopqrstuvwxyz0123456789';
var charactersLength = characters.length;
for (var i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() *
charactersLength));
}
return result;
}
(function() {
'use strict';
if (/SIGN UP WITH YOUR EMAIL/i.test(document.body.innerHTML)) {
// My automation code here to sign up on the web site.
}
})();