Skip to content

chung03/scriptable-input-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This program is used for scripting input simulation and repeating it as many times as you would like. Please note that there is no GUI, this program is only usable on the command line.

For precompiled versions, please check the "precompiled_executables" directory

The program works by reading a script file and then executing the commands in the file. Badly formatted lines are omitted.

The files are formatted in the following way:

COMMAND: <PARAMETERS>


The following commands are accepted:

key_sequence: <letters_to_type>
    - The program will type the letters specified in <letters_to_type>

key: <key> <button_action>
    - The program will do the <button_action> with the <key> button on your keyboard
    - <button_action> can be one of the following:
        - press
            - This action is the same as pushing the button down on your keyboard

        - release
            - This action is the same as releasing a pushed button on your keyboard

        - click
            - click is equivalent to pressing and then releasing soon after

wait: <amount_of_milliseconds>
    - The program will do nothing for <amount_of_milliseconds> milliseconds

mouse_click: <mouse_button>
    - Clicks <mouse_button> at its current location
    - <mouse_button> can be one of the following:
        - left
        - right
        - middle

mouse_down: <mouse_button>
    - Presses and holds <mouse_button> at its current location
    - <mouse_button> can be one of the following:
        - left
        - right
        - middle

mouse_release: <mouse_button>
    - Releases <mouse_button> at its current location
    - <mouse_button> can be one of the following:
        - left
        - right
        - middle

mouse_move: <mouse_x> <mouse_y>
    - Moves the mouse cursor to the point specified on the screen
    - Where the mouse moves is determined by the resolution of the screen. Please check your screen resolution when using this command
        - <mouse_x> should be between 0 and the horizontal resolution of your screen
            - 0 is left. Higher numbers are right

        - <mouse_y> should be between 0 and the vertical resolution of your screen
            - 0 is up. Higher numbers are down

mouse_move_relative: <mouse_x> <mouse_y>
    - Moves the mouse cursor relative to its current position
    - Where the mouse moves is determined by the resolution of the screen. Please check your screen resolution when using this command
        - For <mouse_x>, negative numbers are left. Positive numbers are right

        - For <mouse_y>, negative numbers are up. Positive numbers are down

screen_compare_key_click: <key> <start_x> <start_y> <match_threshold> <image_file_path>
    - The program will compare an area of the screen to the image at <image_file_path>
    - The compare area is a rectangle with width and height matching the image at <image_file_path>. The top left corner is at <start_x> <start_y>
    - The image comparison is done pixel-by-pixel. This means that if the screen compare area is off by a pixel or more, you will match less than expected
    - If the images share at least <match_threshold>% pixels, then the program will click <key>


Example of a file that moves a mouse to a location on the screen, clicks, then pressed a and then tabs and then presses b:

mouse_move: 500 500
wait: 100
mouse_click: left
wait: 100
key: a click
wait: 100
function_key: tab click
wait: 100
key: b click

For more examples, please see the "examples" directory

---------------

Command line usage:

Usage: scriptable_input_simulator.exe [OPTIONS] --file_name <file>

Options:
  -f, --file_name <file>

  -s, --start_delay <start_delay_ms>
          The program will wait this long before executing the commands. This is in milliseconds [default: 0]
  -t, --times_to_execute_commands <times_to_execute_commands>

  -d, --duration_to_execute_commands <duration_to_execute_commands_ms>

  -h, --help
          Print help (see more with '--help')
  -V, --version
          Print version

The file name option is required.


Example usage:

scriptable_input_simulator.exe --file_name fishing_automation.txt -t 9999999
    - This program reads the script file fishing_automation.txt and repeats the commands 9999999 times

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages