diff options
author | Hugues Hiegel <hugues@hiegel.fr> | 2013-11-15 12:24:10 +0100 |
---|---|---|
committer | Hugues Hiegel <hugues@hiegel.fr> | 2013-11-15 12:35:51 +0100 |
commit | 9d1de325216b89a6682a639fe235d781b6963d69 (patch) | |
tree | 8752c6554f47dd06e4e768f7ef6ff781dd5ef92f /scripts/devhook.lua | |
parent | 7b74203c84c48b1c049354022e778c9b25b9fa8a (diff) |
CLEANUP.
Diffstat (limited to 'scripts/devhook.lua')
-rw-r--r-- | scripts/devhook.lua | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/scripts/devhook.lua b/scripts/devhook.lua index 944fa05..4d5d6b5 100644 --- a/scripts/devhook.lua +++ b/scripts/devhook.lua @@ -1,38 +1,38 @@ --- SLIMax Mgr Lua Script v3.1
--- Copyright (c)2012-2013 by Zappadoc - All Rights Reserved.
-
-
--- param = device type (integer - see GetDeviceType() )
--- return 1 to send processed data to the device and bypass Mgr
--- return 0 to skip and give the control to Mgr
-function deviceReport(deviceType)
- -- call custom script
- local result = custom_deviceReport(deviceType)
- -- 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(deviceType)
- -- 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)
- SetFanatecDigitsAllowed(true)
- end
-
-
- -- skip and give the control to Mgr
- return 0
-
-end
-
+-- SLIMax Mgr Lua Script v3.1 +-- Copyright (c)2012-2013 by Zappadoc - All Rights Reserved. + + +-- param = device type (integer - see GetDeviceType() ) +-- return 1 to send processed data to the device and bypass Mgr +-- return 0 to skip and give the control to Mgr +function deviceReport(deviceType) + -- call custom script + local result = custom_deviceReport(deviceType) + -- 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(deviceType) + -- 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) + SetFanatecDigitsAllowed(true) + end + + + -- skip and give the control to Mgr + return 0 + +end + |