|
| 1 | +import subprocess |
| 2 | +from time import sleep |
| 3 | + |
| 4 | +from je_auto_control import locate_and_click, executor |
| 5 | + |
| 6 | +# 開啟windows 計算機 |
| 7 | +# 並累加1至9 |
| 8 | +# open windows calc.exe |
| 9 | +# and calculate 1 + 2 .... + 9 |
| 10 | + |
| 11 | +test_list = [ |
| 12 | + ["AC_add_package_to_executor", {"package": "subprocess"}], |
| 13 | + ["subprocess_Popen", {"args": "calc"}], |
| 14 | + ["AC_add_package_to_executor", {"package": "time"}], |
| 15 | + ["time_sleep", [3]], |
| 16 | + ["AC_locate_and_click", |
| 17 | + {"image": "./test_source/1.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}], |
| 18 | + ["AC_locate_and_click", |
| 19 | + {"image": "./test_source/plus.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}], |
| 20 | + ["AC_locate_and_click", |
| 21 | + {"image": "./test_source/2.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}], |
| 22 | + ["AC_locate_and_click", |
| 23 | + {"image": "./test_source/equal.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}], |
| 24 | + ["AC_locate_and_click", |
| 25 | + {"image": "./test_source/plus.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}], |
| 26 | + ["AC_locate_and_click", |
| 27 | + {"image": "./test_source/3.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}], |
| 28 | + ["AC_locate_and_click", |
| 29 | + {"image": "./test_source/equal.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}], |
| 30 | + ["AC_locate_and_click", |
| 31 | + {"image": "./test_source/plus.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}], |
| 32 | + ["AC_locate_and_click", |
| 33 | + {"image": "./test_source/4.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}], |
| 34 | + ["AC_locate_and_click", |
| 35 | + {"image": "./test_source/equal.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}], |
| 36 | + ["AC_locate_and_click", |
| 37 | + {"image": "./test_source/plus.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}], |
| 38 | + ["AC_locate_and_click", |
| 39 | + {"image": "./test_source/5.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}], |
| 40 | + ["AC_locate_and_click", |
| 41 | + {"image": "./test_source/equal.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}], |
| 42 | + ["AC_locate_and_click", |
| 43 | + {"image": "./test_source/plus.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}], |
| 44 | + ["AC_locate_and_click", |
| 45 | + {"image": "./test_source/6.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}], |
| 46 | + ["AC_locate_and_click", |
| 47 | + {"image": "./test_source/equal.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}], |
| 48 | + ["AC_locate_and_click", |
| 49 | + {"image": "./test_source/plus.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}], |
| 50 | + ["AC_locate_and_click", |
| 51 | + {"image": "./test_source/7.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}], |
| 52 | + ["AC_locate_and_click", |
| 53 | + {"image": "./test_source/equal.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}], |
| 54 | + ["AC_locate_and_click", |
| 55 | + {"image": "./test_source/plus.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}], |
| 56 | + ["AC_locate_and_click", |
| 57 | + {"image": "./test_source/8.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}], |
| 58 | + ["AC_locate_and_click", |
| 59 | + {"image": "./test_source/equal.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}], |
| 60 | + ["AC_locate_and_click", |
| 61 | + {"image": "./test_source/plus.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}], |
| 62 | + ["AC_locate_and_click", |
| 63 | + {"image": "./test_source/9.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}], |
| 64 | + ["AC_locate_and_click", |
| 65 | + {"image": "./test_source/equal.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}] |
| 66 | +] |
| 67 | + |
| 68 | +executor.execute_action(test_list) |
| 69 | + |
0 commit comments