forked from duyss/minegen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathminegen.py
31 lines (30 loc) · 1.06 KB
/
minegen.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import pyautogui
import time
layout = dict(zip(map(ord, "йцукенгшщзхъфывапролджэячсмитьбю.ё"
'ЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ,Ё:–"'),
"qwertyuiop[]asdfghjkl;'zxcvbnm,./`"
'QWERTYUIOP{}ASDFGHJKL:"ZXCVBNM<>?~^-@'))
pyautogui.FAILSAFE = True
print('Введите текст\nEnter your text')
txt = str(input())
txeng = txt.translate(layout)
print('Можете переключить окно\nNow you can switch the window')
print('Время ожидания - 10 секунд\nTimeout - 10 seconds')
time.sleep(10)
lenght = len(txeng)
x = lenght
i = 0
j = 220
if lenght < 255:
pyautogui.typewrite(txeng, interval=0.02)
else:
kord1, kord2 = pyautogui.position()
while x > 0:
tx255 = txeng[i:j]
pyautogui.typewrite(tx255, interval=0.02)
pyautogui.click(kord1, kord2)
pyautogui.move(100,0)
i = j
j=j+220
x=x-220
time.sleep(0.5)