Screen Time Feature - gnh1201/welsonjs GitHub Wiki
Screen Time Feature
Starting from WelsonJS version 0.2.7.34, a feature called 'Screen Time' is supported.
This was introduced to enable integration with highly restrictive applications. It is useful in cases where integration methods like APIs are not supported, and the status can only be checked visually on the computer screen.
This feature does not allow operation in the background. It only functions in User Interactive
mode, where users can monitor the progress.
How to Use
-
Configure the
settings.ini
file as follows:[Service] DISABLE_SCREEN_TIME=true ; SCREEN_TIME_PARAMS=backward,save,sample_ocr,sample_clipboard SCREEN_TIME_PARAMS=save
The
save
parameter is used when you need to save screenshots. The save directory is located atapp/assets/img/_captured
. -
Place the template (image fragment) you want to match in PNG format in the
app/assets/img/_templates
directory. If you need to ignore color values (grayscale), prefix the file name withbinary_
. -
Run the service in
User Interactive
mode. Execute thestartInteractiveService.bat
file. -
Through the
onServiceScreenTime()
event, you can receive the name of the matched template (image fragment) and the coordinates where it was matched. You can find an example of usage indefaultService.js
.
Available options
backward
: Searches the image from the end.save
: Saves the screenshot for storage. The save path isapp/assets/img/_captured
.sample_ocr
: Performs OCR (Use Tesseract OCR) in a 128x128 pixel area around the detected coordinates of the template (image fragment).sample_clipboard
: Copies to the clipboard a 128x128 pixel area around the detected coordinates of the template (image fragment).