Skip to content

Instantly share code, notes, and snippets.

@matsub
Created June 21, 2015 10:52
Show Gist options
  • Save matsub/a42bf1df6af924e2cc70 to your computer and use it in GitHub Desktop.
Save matsub/a42bf1df6af924e2cc70 to your computer and use it in GitHub Desktop.
windows、python用クリッカーです。e(keycode=69)押すと実行/停止の切り替え。waiting中にq(keycode=81)押すと終了。
# coding: utf-8
import sys
import time
from ctypes import windll
user32 = windll.user32
def detector(keycode=69):
return user32.GetKeyState(keycode)
def run(delay):
print "running"
while( detector() ):
user32.mouse_event(2, 0, 0, 0, 0)
time.sleep(delay)
user32.mouse_event(4, 0, 0, 0, 0)
def wait():
print "waiting"
while( not detector() ):
if detector(81):
sys.exit(0)
time.sleep(0.05)
if __name__ == "__main__":
while(True):
wait()
run(0.05)
@matsub
Copy link
Author

matsub commented Jun 21, 2015

めっちゃクリックしなきゃいけないゲームのおともにどうぞ。
e、qを使いたくない時はdetector関数の引数keycodeの既定値69をキーF10(keycode=121)、wait関数中でdetectorに渡してる引数をキーF11(keycode=122)なんかにしてみてね。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment