Skip to content

Commit

Permalink
Merge pull request #10 from hiroto-takatoshi/dev
Browse files Browse the repository at this point in the history
works after 0313 update
  • Loading branch information
Hiroto.Takatoshi authored Mar 13, 2018
2 parents 2d2320a + df965e4 commit f3929ab
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import win32gui
import win32con
import win32process
import pywintypes

m = PyMouse()
k = PyKeyboard()
Expand All @@ -24,18 +23,10 @@
hdc = user32.GetDC(None)

def enum_window_callback(hwnd, pid):
tid, current_pid = win32process.GetWindowThreadProcessId(hwnd)
if pid == current_pid and win32gui.IsWindowVisible(hwnd):
jobdone = False
while not jobdone:
try:
jobdone = True
win32gui.SetForegroundWindow(hwnd)
except pywintypes.error:
jobdone = False


print("window activated")
tid, current_pid = win32process.GetWindowThreadProcessId(hwnd)
if pid == current_pid and win32gui.IsWindowVisible(hwnd):
win32gui.SetForegroundWindow(hwnd)
print("window activated")

def opengame():
webbrowser.open('steam://rungameid/578080')
Expand Down Expand Up @@ -237,13 +228,13 @@ def color(clr, x, y):
time.sleep(15)

#on the plane
if ( ingame == 0 ) and ( color("0xf2f3f2",960,20) and color("0xf2f3f2",961,21) and color("0xf2f3f2",963,23)):
if ( ingame == 0 ) and ( color("0xf2f2f2",1071,624) and color("0xf2f3f2",961,21) and color("0xf2f3f2",963,23)):
print("on the plane")
ingame = 1
s = int(time.time())
lastgame = time.time()
if(stayseconds > 15):
time.sleep(25)
time.sleep(15)
k.press_key('F')
time.sleep(0.2)
k.release_key('F')
Expand Down

0 comments on commit f3929ab

Please sign in to comment.