Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- // PD5.1 Roll Hunter (really, really crude)
- // Created by Serlite
- //
- // - Allows autobet to be stopped in the browser if a roll number meets the hunt requirements.
- //
- // Usage Requirements:
- // - All autobet parameters should be set up before starting this.
- // - My Bets should be selected in the bets section.
- // - To start, call startHunt(), and to stop, call stopHunt().
- // - If autobet starts and you start seeing "Checking for hits..." printed repeatedly to your console, it's working!
- // - The script will stop automatically when it detects a target number, and will print the number and bet ID to the console.
- // - After it hits a number and stops, 10 manual bets will need to be made to clear My Bets before starting again.
- //
- // NOTE: Only compatible with modern browsers, as no backwards compatibility is implemented.
- */
- var huntInterval;
- var checkDelay = 1000;
- // These selectors may change with updates to PD - if they don't match in the future, you may need to change the classes accordingly
- var betButton = document.querySelector(".Button__Button-eELvBW.jplDNk");
- var betNumberColumnSelector = ".styles__StyledTable-cMeZPi.eNDaaT tr td:nth-child(6)";
- function startHunt(){
- toggleBetting();
- huntInterval = setInterval(checkIfHitNumber, checkDelay);
- }
- function stopHunt(){
- toggleBetting();
- clearInterval(huntInterval);
- }
- function toggleBetting(){
- betButton.click();
- }
- function hitNumber(givenNumber){
- return givenNumber == "13.31" || givenNumber == "24.42" || givenNumber == "57.75" || givenNumber == "68.86";
- }
- function stopBettingIfHitNumber(givenNumber){
- if (hitNumber(givenNumber)){
- stopHunt();
- return true;
- }
- return false;
- }
- function checkIfHitNumber(){
- var hitFound = false;
- console.log("Checking for hits...");
- document.querySelectorAll(betNumberColumnSelector).forEach(function(e){
- var rolledNumber = e.innerText.trim();
- if (!hitFound && stopBettingIfHitNumber(rolledNumber)){
- console.log("Number hit: " + rolledNumber + ", Bet ID: " + e.parentElement.children[0].innerText.trim());
- hitFound = true;
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment