Code Monkey home page Code Monkey logo

macrouo's Introduction

MacroUO

Inspired by UO Loop, MacroUO is a simple third party macro utility for Ultima Online. I am still maintaining it because a lot of people I know are still playing Ultima Online and, over the past years, it became very popular on some servers.

Requirements

MacroUO is platform-agnostic, therefore it can be used on both x86 and x64 environments. The solution model targets Visual Studio 2017 and the projects are compiled under .NET Framework 4.7.1, therefore it can run on every machine equipped with Windows 7 or greater.

Usage

Interface

Options

Two different interface options can be toggled on and off through the menu bar. The TopMost option forces the MacroUO window to overlap all the other windows, even when it's not active. The Transparency option makes the MacroUO window slightly transparent.

Clients Panel

The Scan button analyses running processes in order to identify active Ultima Online clients. Only the clients on which an account has been successfully authenticated will show up.

The purpose of the dropdown menu is to select the target client on which the selected macro will be executed.

Macro Panel

This panel holds the macro settings. The Key dropdown sets the keyboard key to send to the target client. The Delay control sets the delay (in milliseconds) between each macro execution. The key modifiers can be turned on and off using their respective checkboxes. A limit to the number of executions can be set through the Runs control: MacroUO will automatically stop once the specified limit has been reached.

On the bottom right of the panel there are two counters: the first one records how many times the current macro has been executed, the second one keeps track of the elapsed time since the start of the process. Pushing the Reset button will immediately reset both counters.

Presets Panel

The purpose of this panel is to manage the preset macros stored in the Presets.xml file. The dropdown menu loads the selected preset into the Macro panel. The Add button, enabled only if no preset is selected, creates a new preset (with a default name) from the current macro settings. The Remove button deletes the currently selected preset. The Reload button forces MacroUO to reload the preset macros from the Presets.xml file.

While a preset is selected in the dropdown menu:

  • changing the Macro panel settings modifies the active preset;
  • pushing F2 opens up a dialog that allows to rename the active preset (the name must be unique and composed of alphanumeric characters separated by single white-space characters).

All the changes to the preset macros are automatically saved when MacroUO is closed.

Buttons

On the bottom of the window there are three buttons. The Start button activates the process that executes the specified macro on the target client, while the Stop button interrupts it. The Collapse button reduces the MacroUO window size, while the Expand button restores it.

Source Code

The classes are completely undocumented and the code contains no descriptive comments; I know it's bad practice, but I really don't have time to create a proper documentation for this project. Nonetheless, everything should be pretty straightforward since it's just a simple form with a few buttons.

The following method (which can be found within the ApplicationDialog class) identifies active Ultima Online clients on which macros can be executed:

private Boolean EnumerateWindow(IntPtr windowHandle, IntPtr lParameter)
{
	String windowClass = NativeMethods.GetWindowClass(windowHandle);

	if (!windowClass.Contains("Ultima Online"))
		return true;

	String windowText = NativeMethods.GetWindowText(windowHandle);

	if (!windowText.Contains("Ultima Online - "))
		return true;

	UInt32 windowThreadId = NativeMethods.GetWindowThreadId(windowHandle);

	m_Clients.Add(new Client(windowText, windowHandle, windowThreadId));

	return true;
}

macrouo's People

Contributors

tommasobelluzzo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

macrouo's Issues

Raise delay

Description

Is it possible to raise the maximum delay (now is 60.000)?

Motivation and Context

With ClassicUO you can create complex macros and their duration could be more than 60.000 ms

I see process but cant send keys

I can see process and select it but it wont send keys. The target windows can be minimized ? should the target be thet top most window?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.