Package: clickomat
Clickomat 1.0.7Python-Script for automated click-sequences and text entry.Building on top of the brilliant lib "pyautogui" byAl Sweigartit offers the possibility to perform mouse clicks, text input and more with very simplified commands.The purpose of Clickomat is to map the sometimes relatively long python commands from pyautogui with short,
single-line commands that are processed in a simple text list.Installation$ pip install clickomatWatch how easy it is to get started:FOR MAC USERS:Unfortunately, one of the used modules (tkinter) caused problems in previous versions.
If you have Monterey installed clickomat crashed with a long, cryptic exception.
I changend the module and v1.0.3 or higher is now working on mac again!Run TestscriptOpenhttps://checkboxolympics.com/in Firefox (other browsers render differently so targets are not recognized).It must now be ensured that ALT-TAB (Win) or CMD-TAB (Mac) can be used to switch directly back and forth between the terminal and the website.Install Clickomat package$ pip install clickomatChange directory into testcases/checkboxolympics/$ cd [path-to-clickomat-folder]/testcases/checkboxolympicsRun the script by typing$ python c.pyOR simply put$ pip install clickomat
...
$ clickomat -p [path-to-clickomat-folder]/testcases/checkboxolympicsRun ClickomatFrom command-line as CLIIf run directly from command-line Clickomat takes arguments like this:$ clickomat -p C:/path/to/case/dir -c clicklist.txt -i imagefolderDefaults would simply be '.','t1.txt','images' if called w/o arguments.If you only like to change the clicklist-file:$ clickomat -c clicklist.txtMore details in theDocs -> CLIFrom python-fileTo run from python-script you need to have at least this construct:fromclickomatimportClickomatc=Clickomat('.','t1.txt',"images")c.main()You have to specify the location of your clicklist with the first param. Here it is a dot because the python file is in the same directory as the Clickomat script txt-file (clicklist).Next is the name of the clicklist (text-file) to read instructions fromt1.txtYou CAN specify a folder for your target-images but those can also be located on txt-file level. Then you would write a dot here.More details in theDocs -> PythonCommandsCommandResult##SECTIONyou can divide your script into sectionsswitchAlt-Tab on WIN / Command-Tab on Macclicknormal click at current positionclick -imagesclick on imagename.png if presentclick ! -imagesforced click on imagename.pngdoubleclicknormal doubleclick at current positiondoubleclick -imagesdoubleclick on imagename.png if presentdoubleclick ! -imagesforced doubleclick on imagename.pngshiftclickshift-click at current positionshiftclick -imagesshift-click on imagename.png if presentshiftclick ! -imagesforced shift-click on imagename.pngrightclickright-click at current positionrightclick -imagesright-click on imagename.png if presentrightclick ! -imagesforced right-click on imagename.pngmdownMouse-Down - Stays down until released bymup!mupMouse-Uppos -imageplace mouse on imagename.pngposX20move mouses X-coordinate to 20px from leftposY20move mouses Y-coordinate to 20px from topright20pushes mouse 20px to the rightleft20pushes mouse 20px to the leftup20pushes mouse 20px updown20pushes mouse 20px downdrag -imageclick-drag across imagename.png (top/left to bottom/right)drag up -imageclick-drag across imagename.png (bottom/left to top/right)await -imageswaits for image to appearwrite "text"types textpop "text"pops up a message, pauses until button is pressedenterpress enterscroll20scroll 20 steps upscroll-20scroll 20 steps downstopbreaks the script (for debugging)deldeletes filedel dirdeletes directory[number]pauses for [number] seconds#you can comment-out lines by using hash as first char (followed by space)#commandyou can also comment-out lines by using hash as first char followed by command (no space)lookup -image ->SECTIONset a target to lookout for the entire runtime. If found -> end current section, start SECTION (name)if -images->SECTIONIf (multiple possible) target found -> end current section, start SECTION (name)go ->SECTIONend current section, start SECTION (name)endyou CAN pop a message when script is finished - optionalImages:-imagename can either be a single image or a list of images separated by/. The list will be iterated and the first finding will be used. See example incheckboxolympics testcase.ShorthandsCommandShorthandCommandShorthandCommandShorthandswitch>posXxawaitaclickcposYywritewdoubleclickdcrightrenter.shiftclickscleftlscrollslrightclickrcupudeldmdownmddownddel dirddmupmulookupluMore commands coming...Full DocumentationDependencies:* pyautogui
* keyboard
* pynput
* click
* pyperclip
* opencv-python (on windows pyautogui works only with opencv)
* pillow (on windows pyautogui works only with pillow)Examples:examplescript.txtTestcase:checkboxolympicsOn the Websitehttps://checkboxolympics.com/you can run the very simplyfied script of the testcase and get a score around 2.2 seconds...