Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Aliexpress profile filler for Game
- // @namespace http://tampermonkey.net/
- // @version 0.2
- // @description Изменяет страну на USA и заполняет поля
- // @author Andronio
- // @match https://accounts.aliexpress.com/user/organization/manage_person_profile.htm?isEdit=true
- // @grant none
- // ==/UserScript==
- var myCountry = "KZ";
- (function() {
- 'use strict';
- // Your code here...
- var div = document.createElement('div');
- div.className = 'mybox';
- div.innerHTML += `
- <input type="button" id="usa" class="mybutton" value="Fill USA">
- <input type="button" id="kaz" class="mybutton" value="Fill ${myCountry}">
- `;
- // Стили
- var styles = `
- .mybox {
- position: fixed;
- top: 0;
- right: 0;
- background: white;
- box-shadow: 1px -1px 4px 1px;
- max-width: 40%;
- max-height: 400px;
- padding: 10px 20px;
- overflow-y: auto;
- overflow-x: hidden;
- z-index:9999;
- }
- .mybutton {
- display: inline;
- padding: 10px 20px;
- margin-right:auto;
- cursor:pointer;
- }`
- var styleSheet = document.createElement("style")
- styleSheet.type = "text/css"
- styleSheet.innerText = styles
- document.head.appendChild(styleSheet)
- document.body.appendChild(div);
- let mybutton1 = document.getElementById("usa");
- mybutton1.addEventListener('click', fillUSA);
- let mybutton2 = document.getElementById("kaz");
- mybutton2.addEventListener('click', fillKAZ);
- })();
- async function fillUSA() {
- let genderMale = document.getElementById("mr");
- let genderFemale = document.getElementById("ms");
- let countrySel = document.getElementById("countrySelect");
- let allInput = document.querySelectorAll("input");
- let submitButton = document.getElementById("formSubmit");
- if (genderMale.checked == false && genderFemale.checked == false) {
- if (Math.random() > 0.5) {
- genderMale.checked = true;
- } else {
- genderFemale.checked = true;
- }
- }
- if (allInput[10].value == "") allInput[10].value = randomString(9);
- if (allInput[11].value == "") allInput[11].value = randomString(9);
- countrySel.value = "US";
- countrySel.onchange();
- await sleep(500);
- let province = document.getElementById("usProvinceList");
- province.selectedIndex = Math.floor(Math.random() * province.length);
- if (allInput[13].value == "") allInput[13].value = getRandomInt(999999);
- allInput[14].value = "1";
- allInput[15].value = getRandomInt(999);
- allInput[16].value = getRandomInt(99999999);
- allInput[17].value = "1";
- submitButton.click();
- }
- async function fillKAZ() {
- let genderMale = document.getElementById("mr");
- let genderFemale = document.getElementById("ms");
- let countrySel = document.getElementById("countrySelect");
- let allInput = document.querySelectorAll("input");
- let submitButton = document.getElementById("formSubmit");
- if (genderMale.checked == false && genderFemale.checked == false) {
- if (Math.random() > 0.5) {
- genderMale.checked = true;
- } else {
- genderFemale.checked = true;
- }
- }
- if (allInput[10].value == "") allInput[10].value = randomString(9);
- if (allInput[11].value == "") allInput[11].value = randomString(9);
- countrySel.value = myCountry;
- countrySel.onchange();
- await sleep(500);
- allInput[12].value = randomString(9);
- allInput[13].value = getRandomInt(999999);
- allInput[14].value = "7";
- allInput[15].value = getRandomInt(999);
- allInput[16].value = getRandomInt(99999999);
- allInput[17].value = "7";
- submitButton.click();
- }
- function randomString(i)
- {
- var text = "";
- var possible = "abcdefghijklmnopqrstuvwxyz";
- while (text.length < i)
- text += possible.charAt(Math.floor(Math.random() * possible.length));
- return text;
- }
- function sleep(ms) {
- return new Promise(resolve => setTimeout(resolve, ms));
- }
- function getRandomInt(max) {
- return Math.floor(Math.random() * Math.floor(max)).toString();
- }
Add Comment
Please, Sign In to add comment