Skip to content

Instantly share code, notes, and snippets.

@pythonlessons
Created October 1, 2020 13:26
Show Gist options
  • Select an option

  • Save pythonlessons/f2434199f834e86a678ba27336d1693e to your computer and use it in GitHub Desktop.

Select an option

Save pythonlessons/f2434199f834e86a678ba27336d1693e to your computer and use it in GitHub Desktop.
YOLO_aimbot_main
def getwindowgeometry():
while True:
output = subprocess.getstatusoutput(f'xdotool search --name Counter-Strike getwindowgeometry')
if output[0] == 0:
t1 = time.time()
LIST = output[1].split("\n")
Window = LIST[0][7:]
Position = LIST[1][12:-12]
x, y = Position.split(",")
x, y = int(x), int(y)
screen = LIST[1][-2]
Geometry = LIST[2][12:]
w, h = Geometry.split("x")
w, h = int(w), int(h)
outputFocus = subprocess.getstatusoutput(f'xdotool getwindowfocus')[1]
if outputFocus == Window:
return x, y, w, h
else:
print("Waiting for window")
time.sleep(5)
continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment