Skip to content

Instantly share code, notes, and snippets.

@sl5net
Created November 7, 2020 01:29
Show Gist options
  • Save sl5net/52beaf50501a55e98a556b407ef7508f to your computer and use it in GitHub Desktop.
Save sl5net/52beaf50501a55e98a556b407ef7508f to your computer and use it in GitHub Desktop.
0 A.D. pause - p
from autopilot.input import Mouse
doOnlyPreview = True
doOnlyPreview = False
# winTitle = window.get_active_title()
# winClass = window.get_active_class()
# if winTitle != "0 A.D." or winClass != 'pyrogenesis.pyrogenesis':
# keyboard.send_keys("p") # ü
# quit()
# öüöüöü öüöüöüöüöüöüöüöppppp
mouseObj = Mouse.create()
x, y = mouseObj.position()
xMenue = 3565
yMenue = 50
y2plus = 35
sleepBehindClick = 0.05
if False:
for i in range(390):
time.sleep(0.2)
mouse.click_relative_self(10 , 0, 1)
#mouseObj.move(xMenue, yMenue)
#quit()
if doOnlyPreview:
mouseObj.move(xMenue , yMenue) # open menu
mouseObj.move(xMenue , yMenue + y2plus) # open next menu
mouseObj.move(xMenue , yMenue + y2plus + 10) # select 0.1
else:
for i in range(2):
# select 0.1 speed
# time.sleep(.1)
mouse.click_relative_self(xMenue-x , yMenue-y, 1) # open menu
time.sleep(sleepBehindClick)
# mouse.click_relative_self(xMenue-x , yMenue-y, 1)
time.sleep(sleepBehindClick)
mouse.click_relative_self(xMenue-x , yMenue-y + y2plus, 1) # open next menu
time.sleep(sleepBehindClick)
mouse.click_relative_self(xMenue-x , yMenue-y + y2plus + 10, 1) # select 0.1
time.sleep(sleepBehindClick)
# mouseObj.move(xMenue, yMenue)
# time.sleep(0.1)
if not doOnlyPreview:
mouse.click_absolute(x, y, 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment