diff options
author | Hugues Hiegel <hugues@hiegel.fr> | 2013-02-13 16:57:23 +0100 |
---|---|---|
committer | Hugues Hiegel <hugues@hiegel.fr> | 2013-02-13 17:01:34 +0100 |
commit | ab9f1ff8ebd3c56c2c9942013d8520af6b6ca444 (patch) | |
tree | 93fc4f55b3b2edfaebf56d5136cc021c9372c5b5 /scripts/devhook.lua |
Default SLIMaxManager II scripts
Diffstat (limited to 'scripts/devhook.lua')
-rwxr-xr-x | scripts/devhook.lua | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/scripts/devhook.lua b/scripts/devhook.lua new file mode 100755 index 0000000..90a8099 --- /dev/null +++ b/scripts/devhook.lua @@ -0,0 +1,40 @@ +-- SLIMax Mgr Lua Script v2
+-- Copyright (c)2011-2013 by EK and Zappadoc - All Rights Reserved.
+-- Use this script to bypass any previous functions and show what
+-- you want onto your device.
+
+
+-- param = device type (integer - see mDeviceType table)
+-- return 1 to send processed data to the device and bypass Mgr
+-- return 0 to skip and give the control to Mgr
+function deviceReport(devType)
+ -- call custom script
+ local result = custom_deviceReport(devType)
+ -- 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_deviceReport(devType)
+ -- 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
+
+
+ -- sim paused?
+ local paused = GetContextInfo("paused")
+ -- limiter ON?
+ local spdLmt = GetCarInfo("speedlimiter")
+ if paused or spdLmt == 0 then
+ -- reset value
+ SetDigitsAllowed(true)
+ end
+
+
+ -- skip and give the control to Mgr
+ return 0
+
+end
+
|