Skip to content

Latest commit

 

History

42 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

Naminari.Auto

NuGet Version (Naminari.Auto) NuGet Download (Naminari.Auto) Azure DevOps Releases

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

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

About

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.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages