An auto play bot for chrome dinosaur, made with pyautogui, pillow and mss
你需要先安裝pillow、pyautogui以及mss套件
我使用mss去抓取小恐龍前方的特定區域,並使用pillow確認該區域內有幾種不同的顏色,如果多於一種就使用pyautogui按下空白鍵讓小恐龍跳起。
使用顏色數量作為跳躍判斷的好處在於,不論是夜晚模式,或者是日夜交替時的漸層,它都可以處理。
You need to install “pillow”, “pyautogui” and “mss” before run this program
I’m use mss to grab a specfic area in front of the dinosaur, and use pillow check how many color is in this area. If there is more then one color, thn use pyautogui to press the “space” so that the dinosaur will jump.
The advantage of use how many kinds of color in the area as the trigger is that it can handle night mode and gradual change between day and night.