def get_result(path): log("Getting data in " + path + " ...") try: file = open(path, "r") file.close() except: return "undefined" file = open(path, "r") l = file.readline() file.close() try: return str(int(l)) except: return "Invalid litteral, not int value"
def main_file_config_init(path): log("Veryfing and creating main config file ...") try: file = open(path, "r") file.close() except: pass if True: file = open(path, "w") file.write("""[MUSIC]:1 [AUTOMAINTENANCE]:1 [WIDTH_LETTER_IN_PIX]:10 [CORRECTOR]:0 """) file.close()
def check(): if int( lib.read_file_config(var.REGISTERY().main_file_config_path, "[AUTOMAINTENANCE]")): try: if list( requests.get("https://www.projet-voltaire.fr/").text.split( "maintenance")[0].replace(" ", ""))[-1] == 'n': return True else: return False except: return False else: log("Cancelling maintenance checking ...")
def copyfile(path1, path2): log("Copying file ...") try: file = open(path1, "r") file.close() except: return "Error " + str(path1) + ", unable to access" try: file = open(path1, "r") file2 = open(path2, "w") file2.write("".join(file.readlines())) file.close() file2.close() return "Success from " + str(path1) + " to " + str(path2) except: return "Error during process"
def select_text(x0=R.x0_select_text, y0=R.y0_select_text, x1=R.x0_select_text + 1000, y1=R.y0_select_text): if x0 == R.x0_select_text and y0 == R.y0_select_text and x1 == R.x0_select_text + 1000 and y1 == R.y0_select_text: log("Using default configuration you might have errors !") else: pass text_pointeur.position = (x0, y0) text_pointeur.press(Button.left) text_pointeur.position = (x1, y1) text_pointeur.release(Button.left) sleep(.01) with keyboard.pressed(Key.ctrl): keyboard.press('c') keyboard.release('c') return clipboard.paste()
def __init__(self): log("Starting a new registery session ...") self.main_file_config_path = "conf/main.conf" self.x0_select_text = 530 self.y0_select_text = 299 self.packages_necessary = [ 'pygame', 'pynput', 'Cx_freeze', 'clipboard', 'requests', 'beautifulsoup4', 'colorama', 'selenium' ] self.linux_commands = [ 'sudo apt-get update -y', 'sudo apt-get install python3 -y', 'sudo apt-get install python3-pip -y', 'sudo apt-get install xclip -y', 'sudo apt-get install git -y', 'sudo apt-get install firefox-geckodriver' ] self.ponctuation = [',', '.', '?', ':', '/', '!', ';'] self.url = "https://www.google.com/search?channel=fs&client=android&q=" self.voltaire_url = "https://www.projet-voltaire.fr/"
def save_preset(): log("Saving preset as archive ...") try: os.mkdir("presets") except: pass log(copyfile("files/x.preset", "presets/x.preset")) log(copyfile("files/y.preset", "presets/y.preset"))
def doc(): log("Starting documentation menu ...") pygame.init() dim = (largeur, hauteur) = (900, 900) win = pygame.display.set_mode(dim) pygame.display.set_caption( "VOLTAIRE PROJECT HACK BY BAALBAKYA | DOCUMENTATION") font = pygame.font.Font(None, 24) while True: for i in range(1, 5): win.fill((0, 0, 0)) background = pygame.image.load("doc/doc" + str(i) + ".png") fond = background.convert() win.blit(fond, (0, 0)) pygame.display.update() for j in range(0, 500): for event in pygame.event.get(): if event.type == QUIT: pygame.quit() return True else: pass pygame.time.wait(10)
def settings(): log("Starting settings menu ...") pygame.init() dim = (largeur, hauteur) = (800, 600) win = pygame.display.set_mode(dim) pygame.display.set_caption("VOLTAIRE PROJECT HACK BY BAALBAKYA | SETTINGS") font = pygame.font.Font(None, 30) log("Setting up direcories ...") try: os.mkdir("settings") except: pass try: file = open("settings/time_click.set", "r") file.close() except: file = open("settings/time_click.set", "w") file.write("0") file.close() try: file = open("settings/time_btw_clicks.set", "r") file.close() except: file = open("settings/time_btw_clicks.set", "w") file.write("0") file.close() try: file = open("settings/overclock.set", "r") file.close() except: file = open("settings/overclock.set", "w") file.write("100") file.close() log("Launching gui ...") time_click = get_result("settings/time_click.set") time_btw_clicks = get_result("settings/time_btw_clicks.set") overcloking = get_result("settings/overclock.set") count = 0 path = REGISTERY().main_file_config_path while True: win.fill((0, 0, 0)) background = pygame.image.load("files/voltaire_hack.png") fond = background.convert() win.blit(fond, (0, 0)) text = font.render("Paramètres du logiciel", 1, (255, 255, 255)) win.blit(text, (300, 20)) text = font.render( "Délai (ms) pendant le click : " + time_click + " ms => settings/time_click.set", 1, (255, 255, 255)) win.blit(text, (50, 125)) text = font.render( "Délai (ms) entre les clicks : " + time_btw_clicks + " ms => settings/time_btw_clicks.set", 1, (255, 255, 255)) win.blit(text, (50, 165)) text = font.render( "Vitesse d'éxécution : " + overcloking + " ms => settings/overclock.set", 1, (255, 255, 255)) win.blit(text, (50, 205)) text = font.render("Modifier les paramètres globaux : " + path, 1, (255, 255, 255)) win.blit(text, (50, 245)) if count == 100: log("Refreshing value ...") count = 0 time_click = get_result("settings/time_click.set") time_btw_clicks = get_result("settings/time_btw_clicks.set") overcloking = get_result("settings/overclock.set") for event in pygame.event.get(): if event.type == QUIT: pygame.quit() return True pygame.time.wait(100) pygame.display.update() count += 1 pygame.quit()