Hello, world!

Step-by-step guide to creating the legendary Hello, world script in C# and setting it to run on a hotkey press.

Hello, World - Printing the Legendary Hello, World

You can import the ready-made example from here: Hello, World Example

Creating an Aura

Well, a screenshot is a must here, sorry.

Creating a C# Script Action

Typing in the Code (in some fresh versions, the newly created script may already contain this code)

Log.Info("Hello, world!");

Pressing Run

Voila!

Congratulations, this was officially the first step towards mighty scripts of the future.

Run the script with a hotkey

To make it a bit more interesting, let's set up our script to run only when a specific key, for example, F1, is pressed.

Adding the HotkeyIsActive Trigger to the Aura

Select Click/Hold mode and F1

That's It!

Now, every time you press F1, your script will print in the Event Log. Of course, this might not be the most exciting thing we can do, but more on that in the following examples.

Run Log.Info("Hello, world!"); in the top-level C# Script Action. EyeAuras supplies Log; no package or input is needed. The message appears in that Action's Event Log. Ordinary classes receive a logger explicitly. A fresh script's default template can vary by version.

The current tracker sets Hold active on KeyDown and inactive on KeyUp. Click (Toggle in the UI) toggles on KeyUp. For an On Enter action, two press/release cycles produce two entries in Hold; in Toggle the second cycle turns the state off. This is a state-transition contract, not ordering of long-running actions.

HotkeyTracker implementation.