1

So at first I was trying to make this script to make evony accounts by using xampp but instead now im trying to use tampermonkey but I cant seem to get any of it to work for some reason :/

// ==UserScript==
// @name     Evony account maker
// @include  http://www.user.evony.com/index.do?PageModule=ForgetPassword
// @grant    GM_addStyle
// ==/UserScript==
window.location = "http://www.user.evony.com/index.do?PageModule=ForgetPassword";
var email = rpplaysevony;
var password = daxter23;
var accnumber = 0;
function createaccount(){   
document.getElementById("tab2").click()//trying to click a button with 
// the id of tab2
document.getElementById('username').value = email + accnumber + "@yahoo.com";
}
window.onload = function () { createaccount() }

Any help would be awesome :) also tried

// ==UserScript==
// @name     Evony account maker
// @include  http://www.user.evony.com/index.do?PageModule=ForgetPassword
// @grant    GM_addStyle
// ==/UserScript==
window.location = "http://www.user.evony.com/index.do? PageModule=ForgetPassword";
    //var email = rpplaysevony;
    //var password = daxter23;
    //var accnumber = 0;
    function createaccount(){   
    document.getElementById("tab2").click();
   // document.getElementById('username').value = email + accnumber + "@yahoo.com";
    }
    window.onload = function () { createaccount();}
mrbad315
  • 23
  • 5
  • What are you trying to do? it looks like, to me, as soon as you set the window.location, it's going to ignore the rest of the script and load the page. – Guy Schalnat Jul 14 '15 at 04:10
  • I am not sure that you still can access `window` object from the time you use any `@grant` function. See [How to access window (Target page) objects from a GM content script (@grant other than none)](http://stackoverflow.com/questions/25778469/how-to-access-window-target-page-objects-from-a-gm-content-script-grant) – Delgan Jul 14 '15 at 05:29
  • Im trying to make it click on a button so that the register account stuff shows up – mrbad315 Jul 14 '15 at 06:24

2 Answers2

0

you've set the script to run on

http://www.user.evony.com/index.do?PageModule=ForgetPassword

your first line changes the page to

http://www.user.evony.com/index.doPageModule=ForgetPassword

the script wont run on'

http://www.user.evony.com/index.doPageModule=ForgetPassword

Hope that helps

OK - so that was a typo

where is the value of 'email' set?

edit 2 -

You have the following:

var email = rpplaysevony;
var password = daxter23;

Are rpplaysevony and daxter23 supposed to be strings or do they refer to some vars you're not showing?

Jaromanda X
  • 53,868
  • 5
  • 73
  • 87
  • sorry its a typo on here on the act. code the links are the same – mrbad315 Jul 14 '15 at 04:00
  • forgot to put it in added it now - also will the code that is correct run if theres errors? – mrbad315 Jul 14 '15 at 04:14
  • they should be strings - even not lookin at that part whats wrong with the click? document.getElementById("tab2").click()//trying to click a button with // the id of tab2 – mrbad315 Jul 14 '15 at 04:57
0
// ==UserScript==
// @name     Evony account maker
// @include  http://user.evony.com/index.do?PageModule=ForgetPassword
// @grant    none
// ==/UserScript==

document.getElementById('username').value = 'rpplaysevony0@yahoo.com';
document.getElementById('pwd').value = 'daxter23';
document.getElementById('pwd2').value = 'daxter23';
document.getElementsByClassName('btn')[0].firstChild.click();
zanetu
  • 3,740
  • 1
  • 21
  • 17