قالب وردپرس درنا توس
Home / Apple / macos – How can I make this script faster?

macos – How can I make this script faster?



Below is a script intended to press the up arrow key each time a pixel on # 535353 occurs on 555,888 . This is supposed to create a fine for the Chrome dino game. But for some reason the script does not always press up the arrow when a cactus goes through 555,888 . I am the reason why this is because the script does not run the shell command to test the pixel often enough.

Is there a more effective way to test the color of a screen pixel so that I can test for it several times per second?

  repeat
set px to ""
set px to (make shell script "screencapture -R555,888,1,1 -t bmp $ TMPDIR / test.bmp &&
xxd -p-1
3-s 54 $ TMPDIR / test.bmp | sed (s) - (i) (i) (i) t if px contains "535353" then tell the program "System Events" key code 126 Finally tell end up Finally repeat


Source link