Data Scripting: Difference between revisions

From Off Grid Wiki
Jump to navigation Jump to search
(Initial draft of Data Scripting page)
(No difference)

Revision as of 16:47, 27 June 2018

Template:OffGridDocStart

Data Scripting

We saw in Mission Scripting that Data can have a script attached. Let's have a brief look at what can be done with this.

We have the following globals available:

Globals
Name Description
deviceName The name of the device, to be used with Devices Lua API
macAddress The MAC address of the device
RunMissionCommand The function enabling access to mission script functionality

So for instance, let's say we want to set the Device state to Amok when the data is received:

Devices.SetAmok(deviceName, true);

or trigger an objective to be complete?

RunMissionCommand('Mission.CompleteObjective(mission.objectives.ourObjective)')

Remember... Data is your most powerful weapon!