Naminari.Auto 1.5.3

dotnet add package Naminari.Auto --version 1.5.3
NuGet\Install-Package Naminari.Auto -Version 1.5.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Naminari.Auto" Version="1.5.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Naminari.Auto --version 1.5.3
#r "nuget: Naminari.Auto, 1.5.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Naminari.Auto as a Cake Addin
#addin nuget:?package=Naminari.Auto&version=1.5.3

// Install Naminari.Auto as a Cake Tool
#tool nuget:?package=Naminari.Auto&version=1.5.3

logo

Naminari.Auto nuget

Naminari.Auto is a library designed to simplify task automation by providing users with the ability to control their mouse and keyboard inputs. With Naminari.Auto, you can easily create scripts that simulate user input without the need for manual input.

Prerequisites

  • Windows: .NET 7

Installation and sources

Usage

Import package

using AutoClicker.Actions;

Support for mouse input:

Get the Mouse position

var position = Mouse.GetPosition();

Get the pixel color at the mouse position

var color = Mouse.GetPosition().GetPixelColor();

Excute the Mouse click

Task.Run(async () =>
{
    // Left Click
    await Naminari.Auto.Mouse.ClickAsync(mouseButtons: MouseButtons.Left);

    // Left Double Click
    await Naminari.Auto.Mouse.ClickAsync(mouseButtons: MouseButtons.Left, clickTypes: Naminari.Auto.Models.ClickTypes.Double);
});

Excute the Mouse hold & release

Task.Run(async () =>
{
    // Hold Left Click
    await Naminari.Auto.Mouse.HoldAsync(mouseButtons: MouseButtons.Left);

    // Release Left Click
    await Naminari.Auto.Mouse.ReleaseAsync(mouseButtons: MouseButtons.Left);
});

Support for keyboard input:

Obtain the process list by clicking

// Declare
Keyboard keyboard = new Keyboard();

// Only keep lastest process
keyboard.IsKeepLatestProcess = true;

// Click to any proccess windows and get list
keyboard.Processes

Send raw text input to the selected process

Task.Run(async () =>
{
    await Naminari.Auto.Keyboard.TypingAsync("Hello World!!!", "notepad++");
});

Send command key input to the process

// To select all text in Notepad++, hold down the Ctrl key and press the A key.
Task.Run(async () =>
{
    await Auto.Keyboard.CommandAsync("Ctrl+A", "notepad++");
});

// To open Test Explorer in Visual Studio 2022, hold down the Ctrl key and press the A key, then release both keys and press the T key
Task.Run(async () =>
{
    await Auto.Keyboard.CommandAsync("Ctrl+E,T", "devenv");
});

Support for image:

Capture a screenshot in Windows

Naminari.Auto.Utils.GetScreenShot()

Obtain an image from a selected area

Rectangle area = new Rectangle
                (Math.Min(startPoint.X, e.Location.X),
                Math.Min(startPoint.Y, e.Location.Y),
                Math.Abs(startPoint.X - e.Location.X),
                Math.Abs(startPoint.Y - e.Location.Y));

Bitmap bmp = Naminari.Auto.Utils.GetImageFromSelect(area);
pictureBox.Image = bmp;

Locate the position of a small image within a larger image

var bigImage = new Bitmap(bigSource);
var smallImage = new Bitmap(smallSource);
var position = Utils.FindImagePosition(smallImage, bigImage);

The Sample App

Naminari.Auto.SampleApp

Take a look at the sample app that is included with the source code

Contributing Guide

We welcome contributions to our project! Before getting started, please take a moment to read through the following guidelines:

Reporting Bugs

If you have found a bug in our project, please open an issue on GitHub. When reporting a bug, please include as much detail as possible about the issue and steps to reproduce it.

Submitting Changes

  1. Clone "contributors" branch.
  2. Add some nice features.
  3. Create a Pull Request to "develop" branch.

License

By contributing to our project, you agree that your contributions will be licensed under the LICENSE.txt

Product Compatible and additional computed target framework versions.
.NET net7.0-windows7.0 is compatible.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.5.3 223 3/26/2023
1.5.2 193 3/9/2023