summaryrefslogtreecommitdiff
path: root/scripts/led.lua
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/led.lua')
-rwxr-xr-xscripts/led.lua45
1 files changed, 45 insertions, 0 deletions
diff --git a/scripts/led.lua b/scripts/led.lua
new file mode 100755
index 0000000..0e5cd1b
--- /dev/null
+++ b/scripts/led.lua
@@ -0,0 +1,45 @@
+-- Part of SLIMax Mgr II - Lua Script v2.2
+-- Copyright (c)2012-2013 by Zappadoc - All Rights Reserved.
+-- Use this script to patch std led behaviors (i.e lowfuel, flags, damage, rev limit, ...)
+-- created by Zappadoc - 2012-11-10
+
+-- SLI-M, SLI-PRO, SLI-F1 led event
+-- params:
+-- idx = led index (assigned in settings)
+-- state = the std state of the led; activated if > 0
+-- ledFunction: the corresponding function
+-- 1=LowFuel
+-- 2=TC
+-- 3=ABS
+-- 4=Green Flag
+-- 5=Yellow flag
+-- 6=Red Flag
+-- 7=Over Heating
+-- 8=Damage
+-- 9=Pit request
+-- 10=Power
+-- 11=Rev Limit
+-- 12=HeadLights
+-- 13=Blue Flag
+-- 14=DRS
+-- 15=Safe Prefs
+
+function ledEvent(idx, ledFunction, state)
+ -- call custom script
+ local result = custom_ledEvent(idx, ledFunction, state)
+ -- if result = 0 bypass the script below and return 0
+ -- if result = 1 bypass the script below and return 1
+ if result <= 1 then return result end
+ -- if result >= 2 continue
+
+ -- call global custom script
+ result = global_custom_ledEvent(idx, ledFunction, state)
+ -- if result = 0 bypass the script below and return 0
+ -- if result = 1 bypass the script below and return 1
+ if result <= 1 then return result end
+ -- if result >= 2 continue
+
+ -- return 0 to use std behaviors
+ return 0
+end
+ \ No newline at end of file