Execute LUA
You can combine official LUA commands with custom LUA commands (line by line).
Index
Official Commands
Copy the following command into the LUA event text field.
print("My name is "..UnitName("player")..".")

Click on the "Test" button to test the command.
The output in your in-game chat should look like this:

Since this command doesn't really give us anything, we'll build ourselves a little conditional query to check if we have a Hearthstone in our bags:
if GetItemCount(6948) == 1 then
print("Yay, i have a Hearthstone in my bag.")
else
print("I have no Hearthstone in my bag ;(")
end

Also possible as a function:
function CheckMyHearthstone()
if GetItemCount(6948) >= 1 then
print("Yay, i have a Hearthstone in my bag.")
else
print("I have no Hearthstone in my bag ;(")
end
end
CheckMyHearthstone()
Alternatively, we can trigger commands or a conditional query as a Key Press event by placing a /run in front of it.
/run print("My name is "..UnitName("player")..".")
Enter commands line by line if you want to execute several in a row:
/run print("My name is "..UnitName("player")..".")
/dance
Custom Commands
Click on "Show custom commands" to display a list and descriptions of all custom commands.

Name of the command.
Duty Argument.
Optional arguments.
WaitForNPC("NameOrID" [, "MaximumWaitTime", "DistanceInYards", "DeadOrAlive"])

Description of the command and what it does.
Description of all arguments and what influence they can have.
Example(s) of correct execution of the command.
The simplest execution of the command would now look like this:
WaitForNPC("12345")
If we now want to change the maximum waiting time, we extend the command and specify a waiting time of 30 seconds:
WaitForNPC("12345", "30")
We would now like to extend the maximum search radius to 60 yards:
WaitForNPC("12345", "30", "60")
If we assume that we are looking for a dead target, we set the DeadOrAlive argument to "0":
WaitForNPC("12345", "30", "60", "0")
Custom LUA commands cannot be tested.