Skip to content

Commit 8f6fa06

Browse files
committed
experimentals
1 parent cd6ccd9 commit 8f6fa06

File tree

24 files changed

+7045
-0
lines changed

24 files changed

+7045
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,6 @@ ENV/
109109
*.idea*
110110

111111
*.tex
112+
duplicate.db
113+
duplicate.sqlite
114+
Trash

autoclicker/autoclicker/__init__.py

Whitespace-only changes.
9.07 KB
Loading

autoclicker/autoclicker/main.py

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
import sys
2+
import time
3+
4+
import pyautogui
5+
from pyautogui import Point
6+
7+
times_per_second = 20
8+
delay_between_clicks = 1 / times_per_second
9+
10+
x_offset = 30
11+
12+
13+
def __initial_delay(delay: int):
14+
time.sleep(delay)
15+
print("finished delay")
16+
17+
18+
def clicks(click_times: int = 10, delay_before_start: int = 3):
19+
global delay_between_clicks
20+
if delay_before_start != 0:
21+
__initial_delay(delay_before_start)
22+
23+
start_position: pyautogui.Point = pyautogui.position()
24+
for i in range(0, click_times):
25+
pyautogui.click()
26+
time.sleep(delay_between_clicks)
27+
current_position: pyautogui.Point = pyautogui.position()
28+
# print("current position = " + str(current_position))
29+
# print("start position: " + str(start_position))
30+
if current_position != start_position:
31+
print("not equal position")
32+
break
33+
34+
35+
def click_image_mode(delay_before_start: int = 3):
36+
__initial_delay(delay_before_start)
37+
global x_offset
38+
image_abs_path = '/Users/amitseal/git/' \
39+
'automating-boring-tasks-using-python/' \
40+
'autoclicker/autoclicker/images/eye.png'
41+
42+
try:
43+
print("entering while")
44+
for i in range(0, 5):
45+
print("in while")
46+
47+
print("trying to find image")
48+
start_x = 79
49+
end_x = 1346
50+
start_y = 152
51+
end_y = 871
52+
width = end_x - start_x
53+
height = end_y - start_y
54+
image_location: Point = pyautogui.locateOnScreen(
55+
image_abs_path,
56+
region=(start_x, width, start_y, height),
57+
confidence=0.6)
58+
pyautogui.screenshot('img{}.png'.format(str(i)),
59+
region=(
60+
start_x, start_y, width * 2, height * 2))
61+
62+
print("found image!")
63+
print(image_location)
64+
break
65+
continue
66+
start_position = Point(image_location.x - x_offset,
67+
image_location.y)
68+
pyautogui.moveTo(start_position, image_location.y)
69+
current_position: pyautogui.Point = pyautogui.position()
70+
time.sleep(delay_between_clicks)
71+
pyautogui.click()
72+
if current_position != start_position:
73+
print("not equal position")
74+
break
75+
break
76+
except pyautogui.ImageNotFoundException:
77+
print("image not found, break")
78+
79+
80+
def find_current_position():
81+
__initial_delay(2)
82+
while True:
83+
current = pyautogui.position()
84+
print(current)
85+
time.sleep(1)
86+
87+
88+
if __name__ == '__main__':
89+
if len(sys.argv) > 1:
90+
print(sys.argv)
91+
# exit()
92+
clicks(1000, int(sys.argv[1]))
93+
else:
94+
clicks(1000, 2)
95+
# click_image_mode()
96+
# find_current_position()

clipboard_modifier/__init__.py

Whitespace-only changes.

clipboard_modifier/init.py

Whitespace-only changes.

clipboard_modifier/main.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import pyperclip
2+
3+
def main():
4+
clip = pyperclip.paste()
5+
lines = clip.splitlines()
6+
new_lines = ""
7+
for line in lines:
8+
line = line.replace("[00 --> 00]","")
9+
if "->" in line:
10+
if "[" in line and "]" in line:
11+
line = line[25:]
12+
else:
13+
continue
14+
new_lines += line.replace("\n", " ").replace(" ", " ").replace("’", "'") + " "
15+
print(new_lines)
16+
pyperclip.copy(new_lines.replace(" ", " "))
17+
18+
if __name__ == "__main__":
19+
main()

clipboard_modifier/runme.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
/Users/amit/git/automating-boring-tasks-using-python/clipboard_modifier/venv/bin/python /Users/amit/git/automating-boring-tasks-using-python/clipboard_modifier/main.py

gplay_apk_download_multidex/LOG.csv

Lines changed: 5844 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Users/amitseal/git/automating-boring-tasks-using-python/image_sort_landscape_portrait/src/venv/bin/python /Users/amitseal/git/automating-boring-tasks-using-python/image_sort_landscape_portrait/src/main.py

0 commit comments

Comments
 (0)