Task Processing
A Bespoke Event consists of a number of individual tasks. When a Bespoke Event runs, tasks are processed starting with the first task, followed by the next task until the last one is processed. This process flow can be altered by using Goto tasks that alter the flow of the Bespoke Event and force processing to jump to the Label specified in the Goto task. E.g.
- Task1
- Task2
- Task3
- Goto Divert
- Task4
- Task5
- :Divert
- Task6
Initially Task1 would be processed, then Task2, then Task3. The next Task is a Goto task so processing would then commence at Task6 and once complete the Bespoke Event would end. Task4 and Task5 would never be processed.
Task Types
There are 3 types of Tasks:
- Event/Command Tasks
- Variable/Dataref Tasks
- Control Tasks
When creating tasks, the currently high-lighted Event or Variable in the Events Area or Variable Area will be used.
Event/Command Tasks
These task types are primary about sending Commands to the flight sim.
Send sends the high-lighted Event to the flight sim.
SendKey sends a specified combination of key-presses to the flight sim. To define a key combination, press and hold any combination of CTRL, ALT, SHIFT, and TAB along with another key. You can also string a large key combination together by creating multiple Key Press tasks in a Bespoke Event. E.g. SendKey LMENU VK_W followed by SendKey VK_M which would bring up the map. Note LMENU stands for the Left ALT key. VK_ stands for virtual keyboard.
SendKey* is the same as above except it uses a slightly different method of transmitting a key press. Use this if SendKey does not work.
SendKeyDn sends a specified combination of key-presses to the flight sim as per SendKey however the keys remain pressed until a SendKeyUp command is sent to release them.
SendKeyUp releases the specified combination of key-presses to X-Plane from a previous SendKeyDn task.
Variable/Dataref Tasks
Set sets the value of the selected Variable/Dataref to a specified number.
Set + increments the value of the selected Variable/Dataref by a specified number.
Set - decrements the value of the selected Variable/Dataref by a specified number.
Set = sets the value of the selected Variable/Dataref to the value of another specified Variable/Dataref.
Set * multiples the value of the selected Variable/Datarefby a specified number.
Set / divides the value of the selected Variable/Dataref by a specified number.
Control Tasks
If allows a logical comparison with the selected Variable/Dataref and a specified Value. If the result is True, the next Task is processed otherwise it is skipped*.
If Var allows a logical comparison with the selected Variable/Dataref and a subsequently selected Variable/Dataref. If the result is True, the next Task is processed otherwise it is skipped*.
*These particular tasks require the selection of logical comparison operators. They are:
- EQUALS (=): The values are the same.
- NOT EQUALS (!=): The values are not the same
- GREATER_THAN (>): The first items value is greater than the second items value
- LESS_THAN (<): The first items value is less than the second items value
Label defines a place in the list of Tasks that can be jumped too by a Goto Task.
Goto allows the Task flow to be diverted to the specified Label Task.
Sleep allows Task processing to pause for a specified amount of milliseconds, allowing flight sim activity to proceed before the Task processing restarts.
Call allows another Bespoke Event to be executed. Once the called Bespoke Event has finished executing, control returns back to the calling Bespoke Event and any remaining tasks are executed.
SettOffSet sets an FSUIPC memory offset. Not available for X-Plane.
ReadOffset reads an FSUIPC memory offset and stores the result in the selected variable. Not available for X-Plane.
ExecLUA runs a chosen Lua script located in the Modules directory via FSUIPC. If the Lua script sets the existing global Lua variable "sendIOResult" to true, then the script can return a value back to the selected Variable by setting the existing global Lua variable "ioResult" to a numeric value. Not available for X-Plane.
Switch, Case, EndSwitch allows for advanced control and must be used together. Switch requires a Variable/Dataref to be chosen and then any subsequent Case tasks use a value to match against the Variable in Switch. When a value matches, any tasks following the Case task are executed until another Case task is reached or EndSwitch is reached. The layout within a Bespoke Event should look as follows:
Switch <Variable>
Case <Value>:
<Task or Tasks>
Case < Value>:
<Task or Tasks>
repeat as required ......
<EndSwitch>
An Example that turns on/off the Flight Director when the auto throttle switch is used. When the throttle is armed, the speed is also set:
Switch at_arm
Case 1:
Set fd_switch = 1
Set speed = 160
Case 0:
Set fd_switch = 0
EndSwitch
Misc Tasks
Remark allows you to add comments into your Bespoke Event. They do nothing except save and display a text comment.