Naminari.Auto
2024.11.24.1
dotnet add package Naminari.Auto --version 2024.11.24.1
NuGet\Install-Package Naminari.Auto -Version 2024.11.24.1
<PackageReference Include="Naminari.Auto" Version="2024.11.24.1" />
paket add Naminari.Auto --version 2024.11.24.1
#r "nuget: Naminari.Auto, 2024.11.24.1"
// Install Naminari.Auto as a Cake Addin #addin nuget:?package=Naminari.Auto&version=2024.11.24.1 // Install Naminari.Auto as a Cake Tool #tool nuget:?package=Naminari.Auto&version=2024.11.24.1
Naminari.Auto
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 8, .NET 9
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
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
- Clone "contributors" branch.
- Add some nice features.
- 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 | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0-windows7.0 is compatible. net9.0-windows was computed. net9.0-windows7.0 is compatible. |
-
net8.0-windows7.0
- OpenCvSharp4.Extensions (>= 4.10.0.20241108)
- OpenCvSharp4.Windows (>= 4.10.0.20241108)
-
net9.0-windows7.0
- OpenCvSharp4.Extensions (>= 4.10.0.20241108)
- OpenCvSharp4.Windows (>= 4.10.0.20241108)
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 |
---|---|---|
2024.11.24.1 | 99 | 11/24/2024 |
2024.11.2.1 | 113 | 11/2/2024 |
1.5.3 | 262 | 3/26/2023 |
1.5.2 | 222 | 3/9/2023 |