Created
November 1, 2020 21:31
-
-
Save sl5net/27ddd787d588f60d54f0233af5f2081d to your computer and use it in GitHub Desktop.
fast short loop through 0 A.D. - Scenarios
This file contains hidden or 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
from autopilot.input import Mouse | |
#quit() | |
for i in range(50): | |
winTitle = window.get_active_title() | |
winClass = window.get_active_class() | |
if winTitle != "0 A.D." or winClass != 'pyrogenesis.pyrogenesis': | |
keyboard.send_keys(" ") | |
quit() | |
if False:#folowing.hast.now.effect | |
for i in range(5): | |
time.sleep(1) | |
keyboard.send_key("<ctrl>+<down>") | |
for i in range(5): | |
keyboard.press_key("<down>") | |
time.sleep(0.2) | |
keyboard.release_key("<down>") | |
quit() | |
mouseObj = Mouse.create() | |
x, y = mouseObj.position() | |
xMenue = 3700 | |
yMenue = 50 | |
y2plus = 35 | |
# quit() | |
# mouseObj.move(xMenue, yMenue) | |
mouse.click_absolute(xMenue, yMenue, 1) | |
time.sleep(0.3) | |
# mouseObj.move(xMenue, yMenue + 9 * 32) # exit | |
mouse.click_absolute(xMenue, yMenue + 9 * 32, 1) # exit | |
# yes exit | |
time.sleep(0.15) | |
# mouseObj.move(xMenue - 680, 620) | |
mouse.click_absolute(xMenue - 680, 620, 1) | |
# continue / start Game : | |
x = xMenue | |
y = 1040 | |
time.sleep(0.15) | |
# mouseObj.move(x, y) | |
time.sleep(2) # time to read title name | |
mouse.click_absolute(x, y, 1) | |
# Accept Terms | |
x = xMenue - 550 | |
y = 810 | |
time.sleep(0.1) | |
# mouseObj.move(x, y) | |
mouse.click_absolute(x, y, 1) | |
# quit() | |
# single player | |
x = xMenue - 1670 | |
y = 240 | |
time.sleep(0.18) | |
# mouseObj.move(x, y) | |
mouse.click_absolute(x, y, 1) | |
# Matches | |
x = xMenue - 1670 + 300 | |
y = 240 | |
time.sleep(0.1) | |
# mouseObj.move(x, y) | |
mouse.click_absolute(x, y, 1) | |
# continue / start Game : | |
x = xMenue | |
y = 1040 | |
time.sleep(0.18) | |
# mouseObj.move(x, y) | |
mouse.click_absolute(x, y, 1) | |
time.sleep(12) | |
if False: | |
#quit() | |
# slow speed: | |
time.sleep(4) | |
x, y = mouseObj.position() | |
xMenue = 3565 | |
yMenue = 50 | |
y2plus = 35 | |
for i in range(2): | |
# select 0.1 speed | |
mouse.click_relative_self(xMenue-x , yMenue-y, 1) # open menu | |
time.sleep(0.1) | |
# mouse.click_relative_self(xMenue-x , yMenue-y, 1) | |
#time.sleep(.1) | |
mouse.click_relative_self(xMenue-x , yMenue-y + y2plus, 1) # open next menu | |
# time.sleep(.01) | |
mouse.click_relative_self(xMenue-x , yMenue-y + y2plus + 10, 1) # select 0.1 | |
# mouse.move(xMenue, yMenue) | |
# time.sleep(9) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment