- 1,295
- 249
ВНИМАНИЕ! гавнокод
Привет. Это мой первый скрипт на питоне. Пишу для себя (правилами игры запрещено, но не чит). Как можно улучшить скрипт? Ато я знаю что пишу через жопы. По идее пофиг, т.к. и так работает, и "и так сойдет", но хочу для далнейшего прогресса как то повторные действия поменять. Жду ваших мнении.
Python:
import time
from pynput.mouse import Button, Controller
from pynput.keyboard import Key, Listener
mouse = Controller()
from myscript import *
def on_press(F4):
try:
mouse.position = (1750, 50)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1578, 445)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1578, 660)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1578, 780)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1578, 850)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1578, 920)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1578, 990)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1895, 985)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1578, 595)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1578, 665)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1578, 780)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1578, 850)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1578, 920)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1578, 990)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1830, 50)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1576, 605)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1579, 816)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1577, 887)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1577, 954)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1898, 998)
time.sleep(0.2)
mouse.click(Button.left, 22)
time.sleep(0.2)
mouse.position = (1578, 196)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1578, 266)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1576, 337)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1578, 403)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1577, 473)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1577, 542)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1576, 609)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1576, 825)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1578, 894)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1577, 964)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1896, 998)
time.sleep(0.2)
mouse.click(Button.left, 21)
time.sleep(0.2)
mouse.position = (1578, 197)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1579, 261)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1578, 381)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1579, 449)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1576, 518)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1577, 585)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1577, 705)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1577, 775)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1575, 845)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1578, 914)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1898, 1004)
time.sleep(0.2)
mouse.click(Button.left, 13)
time.sleep(0.2)
mouse.position = (1577, 526)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1576, 592)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1578, 664)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1580, 784)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1577, 851)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1576, 920)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
mouse.position = (1578, 990)
time.sleep(0.2)
mouse.click(Button.left, 1)
time.sleep(0.2)
return False
except AttributeError:
return False
with Listener(on_press=on_press) as listener:
listener.join()