Last active
January 22, 2022 15:29
-
-
Save nos486/c00c7d4ad8e71585f0c082b0809e69a1 to your computer and use it in GitHub Desktop.
Simple Python Skat Clicker
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
#! /usr/bin/python | |
# first create empty "db.txt" file | |
import pyautogui | |
import keyboard | |
import time | |
isActive = False | |
row = 0 | |
key = 0 | |
row_count = 8 | |
max_key = 100 | |
def active(): | |
global isActive, row, key | |
isActive = True | |
db = open("db.txt", "r") | |
line = db.readline() | |
if len(line) > 2: | |
data = line.split(",") | |
row = int(data[0]) | |
key = int(data[1]) | |
db.close() | |
print("active") | |
pass | |
def deActive(): | |
global isActive | |
isActive = False | |
print("deActive") | |
pass | |
keyboard.add_hotkey('ctrl + shift + a', active) | |
keyboard.add_hotkey('ctrl + shift + d', deActive) | |
def numberTo8(number): | |
out = "" | |
for i in range(0, 8 - len(str(number))): | |
out = out + "0" | |
pass | |
return out + str(number) | |
while 1: | |
time.sleep(1) | |
for i in range(row, row_count): | |
if isActive: | |
for j in range(key, max_key + 1): | |
if isActive: | |
for k in range(0, 8): | |
if k == i: | |
pyautogui.write(numberTo8(j)) | |
pyautogui.press("tab") | |
pass | |
else: | |
pyautogui.write("00000000") | |
pyautogui.press("tab") | |
pass | |
pass | |
pyautogui.mouseDown() | |
pyautogui.mouseUp() | |
db = open("db.txt", "w") | |
db.write("%d,%d" % (i, j)) | |
db.close() | |
if j == max_key: | |
key = 1 | |
pass | |
else: | |
break | |
pass | |
pass | |
else: | |
break | |
pass | |
pass | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment