Now that we better understand the layout of TRX, let’s make our first t script. To begin, we’ll need an on-event hook or “event hook” for short. Put simply, these are functions that state, “on the occurrence of an event, we would like to take an action.” Thus, an on-event hook acts much like a fishing hook, waiting for the moment it receives a catch before acting. And when that event occurs, the t script will go right to work, performing the actions laid out in the event hook.
For our first script, let’s start with the on start event hook. This event hook will activate when our t script starts. Now that we know which event we will be acting on, we need our action that we want the script to perform. For our action, let’s take the classic standby example of a quick “hello world” print statement. If this is your first time writing code, then allow us to welcome you to the long-standing tradition in software development of the “hello world example.” Now, let’s take a look at our code.