You can create new leds datasource using the ncalc syntax :
Go into lnto the ncalcscript folder and add a new empty ini file like "myleds.ini"
Then type in something like this :
[ExportLed]
name='IsInPit'
value=if([DataCorePlugin.GameData.NewData.IsInPit],1,0)
Save and restart SimHub,
This example will create a led value which is 0 when out of pit lane and 1 when in pit lane.
For ets2 specific example :
Enable developer tools in settings, go in properties and seek for an interesting value :
View attachment 188339
Let's say you want to map the parking brake, you can see that the current value is a boolean meaning "true/false" value, so to show it on leds we need it to be a number, so we have to convert it from "true/false" to 0/1 for example, we use the if :
if(
my value is true,
then use this value,
else use this value) :
[ExportLed]
name='ParkingBrake'
value=if([DataCorePlugin.GameRawData.Drivetrain.ParkingBrake],1,0)
Little addition : if you play multi game the ParkingBrake won't exists on other games and eventually slowdown SimHub, simply decorate the property with isnull(property,defaultvalue)
So it becomes : value=if(isnull([DataCorePlugin.GameRawData.Drivetrain.ParkingBrake],0),1,0)
It will tell SimHub to use "0" as a default value when the data is not available instead of crashing it's internal engine.
Hope it helps