Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- import subprocess
- import pyautogui
- import pyperclip
- import psutil
- import os
- from selenium import webdriver
- from selenium.webdriver.common.by import By
- from selenium.webdriver.support.ui import WebDriverWait
- from selenium.webdriver.support import expected_conditions as EC
- import http.client
- def send_get_request(url):
- conn = http.client.HTTPConnection("185.117.153.138")
- conn.request("GET", url)
- response = conn.getresponse()
- return response.read().decode()
- def get_cookie_from_file():
- with open('cookie.txt', 'r') as file:
- return file.read()
- def update_cookie():
- while True:
- try:
- response = send_get_request("/cookie.php")
- if response != "0":
- with open('cookie.txt', 'w') as file:
- file.write(response)
- break
- except:
- pass
- time.sleep(30)
- return response
- def get_link():
- try:
- response = send_get_request("/link.php")
- return response
- except:
- return ""
- def get_word():
- try:
- response = send_get_request("/word.php")
- return response
- except:
- return ""
- def click_button(x, y):
- pyautogui.moveTo(x, y)
- pyautogui.click()
- def scan_pixel(color, x_start=0, y_start=0, x_end=50, y_end=70, retries=20, wait=10):
- for attempt in range(retries):
- for x in range(x_start, x_end):
- for y in range(y_start, y_end):
- try:
- if pyautogui.pixelMatchesColor(x, y, color, tolerance=10):
- return True
- except:
- pass
- time.sleep(wait)
- return False
- def restart_script():
- subprocess.call(["pkill", "-9", "Roblox"])
- subprocess.call(["pkill", "-9", "Vinegar"])
- subprocess.call(["pkill", "-9", "Authentication Failed"])
- subprocess.call(["pkill", "-9", "Error"])
- time.sleep(2)
- subprocess.call(["python3", "/home/oem/Desktop/1.py"])
- def check_elements(driver):
- try:
- driver.find_element(By.XPATH, "/html/body/div[3]/div/div[1]/div/div[2]/div[2]/ul/li[1]/a")
- return True
- except:
- pass
- try:
- driver.find_element(By.XPATH, "//*[@id='logout-button']")
- return True
- except:
- pass
- return False
- def is_disk_space_low(disk_path="/", threshold=95):
- disk_usage = psutil.disk_usage(disk_path)
- return disk_usage.percent >= threshold
- def main():
- try:
- while True:
- if is_disk_space_low():
- print("Недостаточно места на диске, перезагрузка системы...")
- os.system('echo 1 | sudo -S reboot')
- time.sleep(60)
- cookie = get_cookie_from_file()
- link = get_link()
- if not link:
- raise Exception("Не удалось получить ссылку")
- restart_script()
- options = webdriver.ChromeOptions()
- options.add_argument("--window-size=1280,720")
- options.add_extension('/home/oem/mod.crx') # Добавление расширения
- driver = webdriver.Chrome(options=options)
- driver.maximize_window()
- driver.get("https://www.roblox.com")
- driver.add_cookie({"name": ".ROBLOSECURITY", "value": cookie, "domain": ".roblox.com", "path": "/"})
- driver.get(link)
- time.sleep(20)
- if check_elements(driver):
- driver.quit()
- update_cookie()
- continue
- play_button_xpath = "//*[@id='game-details-play-button-container']/button"
- play_button = WebDriverWait(driver, 20).until(
- EC.element_to_be_clickable((By.XPATH, play_button_xpath))
- )
- play_button.click()
- time.sleep(7)
- click_button(844, 244)
- driver.quit()
- color = (170, 182, 195)
- if not scan_pixel(color):
- print("Цвет пикселя не найден.")
- driver.quit()
- restart_script()
- continue
- time.sleep(10)
- word = get_word()
- if not word:
- raise Exception("Не удалось получить слово")
- restart_script()
- pyperclip.copy(word)
- for _ in range(3):
- click_button(606, 363)
- time.sleep(8)
- pyautogui.press('/')
- time.sleep(8)
- pyautogui.hotkey('ctrl', 'v')
- time.sleep(10)
- pyautogui.press('enter')
- time.sleep(4)
- restart_script()
- except Exception as e:
- print(f"Произошла ошибка: {e}")
- restart_script()
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement