// ==UserScript== // @name automatyczne wypelnianie // @namespace http://tampermonkey.net/ // @version 1.1 // @description Skrypt automatyzujący rejestrację i zdobywanie kodów do Xbox game pass w promocji pringles. // @updateURL http://srv18949.microhost.com.pl/scripts/pringles-bot.user.js // @downloadURL http://srv18949.microhost.com.pl/scripts/pringles-bot.user.js // @match https://gaming.pringles.com/* // @grant none // ==/UserScript== var wersjajezykowa="mk_MK"; //Kod wybranej wersji językowej na której ma działać skrypt (znajduje się w adresie strony). Zalecane "lv_LV" (Łotwa, brak puzzli i brak kodów z puszki). var registertimeout=120; //czas w sekundach po ilu ma być przeładowana strona rejestracji konta (np. w przypadku zamulających serwerów). var firstclicktimeout=3000; //UWAGA!!! Jeśli będziesz miał problem z wczytywaniem wersji niemieckiej (de_DE) mimo ustawienia innej, zwiększ tę wartość na 2000 lub 3000. var gmail_name="pringlesgamepasscodes"; //mail KONIECZNIE na Gmailu (sam alias, bez części po znaku @), do niego będzie doklejany losowy ciąg znaków i na ten adres przyjdą kody do Game Passa. Przykład: dla adresu jankowalski@gmail.com wpisz tu tylko: jankowalski var password="haH432hhbvc32%y"; //hasło do tworzonych kont pringles - minimum 8 znaków, duża i mała litera, cyfra i znak specjalny. function fillform(){ var tempid=makeid(20); document.getElementById("KSTL-Registration-FirstName").value="brave"; document.getElementById("KSTL-Registration-LastName").value="hera"; document.getElementById("KSTL-Registration-City").value="vilno"; document.getElementById("KSTL-Registration-Password").value=password; document.getElementById("KSTL-Registration-PasswordConfirm").value=password; document.getElementById("KSTL-Registration-AddressLine1").value="greta 12"; document.getElementById("KSTL-Registration-PostalCode").value="42-152"; document.getElementById("KSTL-Registration-PhoneNumber2").value="5521356311"; document.getElementById("KSTL-Registration-UserNameConfirm").value=gmail_name+"+"+tempid+"@gmail.com"; document.getElementById("KSTL-Registration-UserName").value=gmail_name+"+"+tempid+"@gmail.com"; document.getElementById("KSTL-Registration-Country-0").click(); document.getElementById("KSTL-Registration-TermsConditions1").click(); document.getElementById("KSTL-Registration-PrivacyPolicy").click(); fireChangeEvents(document.getElementById("KSTL-Registration-FirstName")); fireChangeEvents(document.getElementById("KSTL-Registration-LastName")); fireChangeEvents(document.getElementById("KSTL-Registration-Password")); fireChangeEvents(document.getElementById("KSTL-Registration-PasswordConfirm")); fireChangeEvents(document.getElementById("KSTL-Registration-AddressLine1")); fireChangeEvents(document.getElementById("KSTL-Registration-PostalCode")); fireChangeEvents(document.getElementById("KSTL-Registration-PhoneNumber2")); fireChangeEvents(document.getElementById("KSTL-Registration-City")); fireChangeEvents(document.getElementById("KSTL-Registration-UserName")); fireChangeEvents(document.getElementById("KSTL-Registration-UserNameConfirm")); } function makeid(length) { var result = ''; var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; var charactersLength = characters.length; for ( var i = 0; i < length; i++ ) { result += characters.charAt(Math.floor(Math.random() * charactersLength)); } return result; } function fireChangeEvents(element){ var changeEvent = null; changeEvent = document.createEvent ("HTMLEvents"); changeEvent.initEvent ("input", true, true); element.dispatchEvent (changeEvent); console.debug('input event dispatched for element: '+element.id); changeEvent = document.createEvent ("HTMLEvents"); changeEvent.initEvent ("keyup", true, true); element.dispatchEvent (changeEvent); console.debug('keyup event dispatched for element: '+element.id); changeEvent = document.createEvent ("HTMLEvents"); changeEvent.initEvent ("change", true, true); element.dispatchEvent (changeEvent); console.debug('change event dispatched for element: '+element.id); } function deleteAllCookies() { var cookies = document.cookie.split(";"); for (var i = 0; i < cookies.length; i++) { var cookie = cookies[i]; var eqPos = cookie.indexOf("="); var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie; document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT"; } } function auto(){ if ((document.getElementById("KSTL-Registration-UserName").value=="")&&(document.getElementById("KSTL-Registration-FirstName").value=="")){ fillform(); //window.scrollTo(0,document.body.scrollHeight); window.scrollBy(0,1400); } } (function() { 'use strict'; window.onkeyup = function(e) { var key = e.keyCode ? e.keyCode : e.which; if (key == 192){ deleteAllCookies(); sessionStorage.clear(); window.location.href="https://gaming.pringles.com/"+wersjajezykowa+"/Home"; } else if (key == 17) { if ((window.location.href=="https://gaming.pringles.com/"+wersjajezykowa+"/Login")&&(document.getElementById("KSTL-Registration-UserName").value!="")){ document.getElementById("KSTL-Registration-Password").value=password; fireChangeEvents(document.getElementById("KSTL-Registration-Password")); } else if (window.location.href=="https://gaming.pringles.com/"+wersjajezykowa+"/Register") { if ((document.getElementById("KSTL-Registration-UserName").value!="")&&(document.getElementById("KSTL-Registration-FirstName").value=="")){ fillform(); } } } } setInterval(auto, 1000); })();