Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- import sys
- import time
- import math
- from selenium import webdriver
- from selenium.webdriver.chrome.service import Service as ChromeService
- from selenium.webdriver.firefox.service import Service as FirefoxService
- from selenium.webdriver.common.by import By
- from selenium.webdriver.support.ui import WebDriverWait
- from selenium.webdriver.support import expected_conditions as EC
- from selenium.common.exceptions import ElementClickInterceptedException
- # Set recursion limit (be cautious with very high limits)
- sys.setrecursionlimit(1000)
- # Function to initialize WebDriver
- def init_driver(browser='firefox'):
- if browser == 'chrome':
- service = ChromeService()
- options = webdriver.ChromeOptions()
- driver = webdriver.Chrome(service=service, options=options)
- elif browser == 'firefox':
- service = FirefoxService(executable_path=r'K:\DOWNLOADS\geckodriver-v0.34.0-win32\geckodriver.exe')
- options = webdriver.FirefoxOptions()
- options.add_argument("--headless")
- options.binary_location = r'C:\Program Files\Mozilla Firefox\firefox.exe' # Update this path
- driver = webdriver.Firefox(service=service, options=options)
- else:
- raise ValueError("Unsupported browser: {}".format(browser))
- return driver
- driver = init_driver('firefox')
- try:
- print("please wait loading page and login")
- driver.get("https://just-dice.com")
- WebDriverWait(driver, 20).until(
- EC.element_to_be_clickable((By.CSS_SELECTOR, "a.fancybox-item.fancybox-close"))
- ).click()
- # Wait for the overlay to disappear
- WebDriverWait(driver, 10).until(
- EC.invisibility_of_element_located((By.CLASS_NAME, "fancybox-overlay"))
- )
- account_link = driver.find_element(By.LINK_TEXT, "Account")
- # Try clicking, with JavaScript fallback
- try:
- account_link.click()
- except ElementClickInterceptedException:
- driver.execute_script("arguments[0].click();", account_link)
- WebDriverWait(driver, 5).until(
- EC.element_to_be_clickable((By.ID, "myuser"))
- ).clear()
- driver.find_element(By.ID, "myuser").send_keys("username")
- driver.find_element(By.ID, "mypass").clear()
- driver.find_element(By.ID, "mypass").send_keys("password")
- driver.find_element(By.ID, "myok").click()
- WebDriverWait(driver, 20).until(
- EC.presence_of_element_located((By.ID, "pct_balance"))
- )
- print("logged in")
- balance = float(driver.find_element(By.ID, "pct_balance").get_attribute("value"))
- base = 6e-7
- fumble = base
- tens = base * 10
- sevens = base * 6.9
- eights = base * 7.9
- gold = balance
- good = math.floor(gold / tens) * tens
- print("should see bets")
- def go():
- global base, tens, sevens, eights, fumble, good, balance
- balance = float(driver.find_element(By.ID, "pct_balance").get_attribute("value"))
- if (balance > (math.floor(balance / tens) * tens + sevens) and
- balance < (math.floor(balance / tens) * tens + eights)):
- fumble *= 2
- if (balance >= good + tens and balance < (math.floor(balance / tens) * tens + sevens)):
- fumble = base
- good = math.floor(balance / tens) * tens
- number = fumble
- rounded_number = f"{number:.8f}"
- driver.find_element(By.ID, "pct_chance").clear()
- driver.find_element(By.ID, "pct_chance").send_keys("49.5000")
- driver.find_element(By.ID, "pct_bet").clear()
- driver.find_element(By.ID, "pct_bet").send_keys(rounded_number)
- driver.find_element(By.ID, "a_lo").click()
- time.sleep(0.08)
- while True:
- go()
- except Exception as e:
- print(f"An error occurred: {e}")
- finally:
- driver.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement