· 9 years ago · Aug 15, 2017, 05:32 AM
1document.querySelector("#start-control").addEventListener("click", function() {
2 var button = document.querySelector("#start-control");
3 if (button.innerHTML == "START") {
4 button.innerHTML = "STOP";
5 startGen();
6 } else {
7 button.innerHTML = "START";
8 stopGen();
9 }
10});
11
12function startGen() {
13 if (document.querySelector("#use-words-in-username").checked) {
14 leagueUsername = wordGen("username");
15 } else {
16 leagueUsername = randomGen("username", "", "");
17 }
18 if (document.querySelector("#username-as-password").checked) {
19 leaguePassword = leagueUsername;
20 } else if (document.querySelector("#use-words-in-password").checked) {
21 leaguePassword = wordGen("username");
22 } else {
23 leaguePassword = randomGen("password", "", "");
24 }
25 createAccount();
26}
27
28function stopGen() {
29 var location = document.querySelector("#webview");
30 clearTimeout(checkViewer);
31 location.innerHTML = "";
32}
33
34function randomGen(type, charlist, text) {
35 var leg = document.querySelector("#" + type + "-length").innerHTML;
36 var charArray = ["abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "1234567890"]
37 var typeArray = ["lowercase", "capitals", "numbers"];
38
39 for (var num = 0; num < 3; num++) {
40 if (document.querySelector("#" + type + "-" + typeArray[num]).checked) {
41 charlist += charArray[num];
42 };
43 };
44 for (var i = 0; i < leg; i++) {
45 text += charlist.charAt(Math.floor(Math.random() * charlist.length));
46 }
47 var res = text.substring(0, (text.length - 1)) + Math.floor(Math.random() * 10);
48 return res;
49}
50
51function wordGen(type) {
52 var user = wordlist[Math.floor(Math.random() * wordlist.length)] + wordlist[Math.floor(Math.random() * wordlist.length)];
53 var leg = document.querySelector("#" + type + "-length").innerHTML;
54 if (user.length <= leg) {
55 dif = leg - user.length;
56 for (dif >= leg; dif--;) {
57 user += Math.floor(Math.random() * 10);
58 };
59 return user;
60 } else {
61 var res = user.substring(0, leg - 1);
62 res += Math.floor((Math.random() * 10));
63 return res;
64 }
65}
66
67function createAccount() {
68 if (document.querySelector("#amount-remaining").innerHTML > 0) {
69 var location = document.querySelector("#webview");
70 location.innerHTML = "";
71 var webview = document.createElement("webview");
72 webview.setAttribute("class", "viewer");
73 webview.setAttribute("src", "https://signup2.na.leagueoflegends.com/en/signup/index?leagueUsername=" + leagueUsername + "&leaguePassword=" + leaguePassword);
74 webview.setAttribute("preload", "controller.js");
75 webview.setAttribute("disablewebsecurity", "true");
76 location.appendChild(webview);
77 checkViewer = setTimeout(chckViewer, 4000);
78 }
79}
80
81function chckViewer() {
82 if (document.querySelector(".viewer").src == "https://signup2.na.leagueoflegends.com/en/signup/download") {
83 clearTimeout(checkViewer)
84 var d = new Date();
85 var date = d.getMonth() + 1 + "/" + d.getDate() + "/" + d.getFullYear();
86 var table = document.querySelector("table");
87 var tableArray = [leagueUsername, leaguePassword, leagueUsername + "@gmail.com", date, "11/7/1993", "Coming Soon...", "Coming Soon...", "Coming Soon..."];
88 var row = table.insertRow(table.rows.length);
89 tableArray.forEach(function(item, index) {
90 var cell = row.insertCell(index);
91 var text = document.createTextNode(item);
92 cell.appendChild(text);
93 });
94 if (document.querySelector("#amount-remaining").innerHTML > 0) {
95 postRateLimit();
96 createAccount();
97 startGen();
98 } else {
99 clearSettings();
100 }
101 } else {
102 checkViewer = setTimeout(chckViewer, 4000);
103 }
104}
105
106function postRateLimit() {
107 var rateXHR = new XMLHttpRequest();
108 rateXHR.open("POST", "http://TOj2EMmPGXBwjB:S0g9HYUTgNY6l6@plag-database.000webhostapp.com/rate_limit/get.php", true);
109 rateXHR.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
110 rateXHR.onreadystatechange = function() {
111 if (rateXHR.readyState == XMLHttpRequest.DONE) {
112 document.querySelector("#amount-remaining").innerHTML = rateXHR.response;
113 }
114 }
115 rateXHR.send("username=" + username + "&mode=post");
116}