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/slipro_gus.lua | |
parent | 7b74203c84c48b1c049354022e778c9b25b9fa8a (diff) |
CLEANUP.
Diffstat (limited to 'scripts/slipro_gus.lua')
-rw-r--r-- | scripts/slipro_gus.lua | 436 |
1 files changed, 218 insertions, 218 deletions
diff --git a/scripts/slipro_gus.lua b/scripts/slipro_gus.lua index a83c6eb..fa58db6 100644 --- a/scripts/slipro_gus.lua +++ b/scripts/slipro_gus.lua @@ -1,218 +1,218 @@ --- Custom SLIMax Manager Scripts v3
--- Copyright ©2012-2013 by Zappadoc - All Rights Reserved.
--- last change by Zappadoc - 2013-02
-
--- add you global custom functions and globals variables here
--- patch the std SLIMax Events with your global custom scripts if needed
--- see the scripting section of the forum for more info...
-
--- IMPORTANT:
--- this script will not be deleted by uninstalling the software
-
--- ================================
--- CONSTANTS
-
-
--- ================================
--- additional lua extension module dll
-
-
--- ================================
--- additional scripts file ( use 'require' statement )
-
--- ================================
--- custom globals
-
--- ================================
--- custom functions
-
--- ================================
--- custom events
-
-function global_custom_controlsEvent(devType, ctrlType, ctrlPos, value, funcIndex)
- -- type your custom controls script here (manage buttons, switches and encoders)
- return 2
-end
-
-function global_custom_deviceReport(devType)
- -- type your script here (just before sending report to the device )
- return 2
-end
-
-function global_custom_enterSessionEvent(devType)
- -- type your custom script on session start, here
- print ()
- print ( "vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv")
- print (string.format("simu : %s",GetContextInfo("simulation")))
- print (string.format("car : %s",GetContextInfo("carname")))
- print (string.format("track : %s",GetContextInfo("trackname")))
- --print (string.format("session: %s",GetContextInfo("session")))
- print ()
- if GetContextInfo("ospcustom") then print ("has ospcustom") end
-
- print (string.format("shiftlightsmethod: %s",GetContextInfo("shiftlightsmethod")))
- print (string.format("ospmethod : %s",GetContextInfo("ospmethod")))
- print (string.format("speedlimitemethod: %s",GetContextInfo("speedlimitermethod")))
- return 2
-end
-
-function global_custom_exitSessionEvent(devType)
- -- type your custom script on session ending, here
- if GetContextInfo("ospcustom") then print ("has ospcustom") end
- print ()
- print (string.format("shiftlightsmethod: %s",GetContextInfo("shiftlightsmethod")))
- print (string.format("ospmethod : %s",GetContextInfo("ospmethod")))
- print (string.format("speedlimitemethod: %s",GetContextInfo("speedlimitermethod")))
- print ( "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^")
- print ()
-
- --my_setups=io.open("gus_cars.cfg", "a")
- --my_setups:write(GetContextInfo("carname"), " shiftligts ", GetContextInfo("shiftlightsmethod"), "\n")
- --my_setups:write(GetContextInfo("carname"), " speedlimiter ", GetContextInfo("speedlimitermethod"), "\n")
- --my_setups:close()
-
- return 2
-end
-
-
--- ================================
--- SLI-PRO, SLI-M, BU0710 SUPPORT
-
-function global_custom_ospMethodEvent(idx)
- -- type your custom Optimal Shift Points (OSP) method here
- return 2
-end
-
-function global_custom_shiftLightsMethodEvent(idx)
- -- type your custom shiftlights method here
- return 2
-end
-
-function global_custom_shiftLightsBU0710Event(idx)
- -- type your custom shiftlights method for BU0710 device only here
- return 2
-end
-
-function global_custom_leftDigitsEvent(swPosition)
- -- type your custom script related to left SLI-PRO digits panel here
- return 2
-end
-
-function global_custom_rightDigitsEvent(swPosition)
- -- type your custom script related to right SLI-PRO digits panel here
- return 2
-end
-
-function global_custom_spdLmtMethodEvent(idx)
- -- type your custom speedlimiter method here
- return 2
-end
-
-function global_custom_gearEvent(gear)
- -- manage gear when ŽEŽ
- if gear == 69 then
- local ignition = 1
- if GetContextInfo("simulation") == "rFactor2.exe" then
- ignition = GetCarInfo("ignition")
- end
- local g = GetCarInfo("gear")
-
- --print ( string.format("gear %d/ignition %d" , g, ignition))
-
- toggleAllLed(0)
- if ignition == 2 then
- SetLeftDigits(" ---- ")
- SetRightDigits(" ---- ")
- else
- SetLeftDigits(" ")
- SetRightDigits(" ")
- end
-
- if ignition == 0 then
- SetGearDigit(" ")
- elseif ignition == 1 then
- SetGearDigit(GetCurrentGear())
- end
-
- SLISendReport(1)
- return 1
- end
-
- return 2
-end
-
-function global_custom_ledEvent(idx, ledFunction, state)
- -- type your custom script on session ending, here
- return 2
-end
-
--- ================================
--- LOGITECH G27 SUPPORT
-
-function global_custom_shiftLightsG27LedsMethodEvent(idx)
- -- type your custom shiftlights method for G27 device only here
- return 2
-end
-
-function global_custom_ospG27MethodEvent(idx)
- -- type your custom Optimal Shift Points (OSP) method here
- return 2
-end
-
-function global_custom_spdLmtG27MethodEvent(idx)
- -- type your custom speedlimiter method here
- return 2
-end
-
--- ================================
--- FANATEC WHEELS SUPPORT
-
-function global_custom_shiftLightsFanatecMethodEvent(idx)
- -- type your custom shiftlights method for Fanatec device only here
- return 2
-end
-
-function global_custom_fanatecDigitsEvent(swPosition)
- -- type your custom script related to Fanatec digits panel here
- return 2
-end
-
-function global_custom_ospFanatecMethodEvent(idx)
- -- type your custom Optimal Shift Points (OSP) method here
- return 2
-end
-
-function global_custom_spdLmtFanatecMethodEvent(idx)
- -- type your custom Optimal Shift Points (OSP) method here
- return 2
-end
-
-function global_custom_gearFanatecEvent(gear)
- -- type your custom gear event script here
- return 2
-end
-
--- ================================
--- local custom events PLACEHOLDERS
--- DO NOT CHANGE THE SCRIPT BELOW
--- ================================
-function custom_controlsEvent(deviceIdx, ctrlType, ctrlPos, value, funcIndex) return 2 end
-function custom_deviceReport(devType) return 2 end
-function custom_ospMethodEvent(idx) return 2 end
-function custom_ospG27MethodEvent(idx) return 2 end
-function custom_ospFanatecMethodEvent(idx) return 2 end
-function custom_shiftLightsMethodEvent(idx) return 2 end
-function custom_shiftLightsBU0710Event(idx) return 2 end
-function custom_shiftLightsG27LedsMethodEvent(idx) return 2 end
-function custom_shiftLightsFanatecMethodEvent(idx) return 2 end
-function custom_leftDigitsEvent(swPosition) return 2 end
-function custom_rightDigitsEvent(swPosition) return 2 end
-function custom_fanatecDigitsEvent(swPosition) return 2 end
-function custom_spdLmtMethodEvent(idx) return 2 end
-function custom_spdLmtG27MethodEvent(idx) return 2 end
-function custom_spdLmtFanatecMethodEvent(idx) return 2 end
-function custom_gearEvent(gear) return 2 end
-function custom_gearFanatecEvent(gear) return 2 end
-function custom_enterSessionEvent(devType) return 2 end
-function custom_exitSessionEvent(devType) return 2 end
-function custom_ledEvent(idx, ledFunction, state) return 2 end
+-- Custom SLIMax Manager Scripts v3 +-- Copyright ©2012-2013 by Zappadoc - All Rights Reserved. +-- last change by Zappadoc - 2013-02 + +-- add you global custom functions and globals variables here +-- patch the std SLIMax Events with your global custom scripts if needed +-- see the scripting section of the forum for more info... + +-- IMPORTANT: +-- this script will not be deleted by uninstalling the software + +-- ================================ +-- CONSTANTS + + +-- ================================ +-- additional lua extension module dll + + +-- ================================ +-- additional scripts file ( use 'require' statement ) + +-- ================================ +-- custom globals + +-- ================================ +-- custom functions + +-- ================================ +-- custom events + +function global_custom_controlsEvent(devType, ctrlType, ctrlPos, value, funcIndex) + -- type your custom controls script here (manage buttons, switches and encoders) + return 2 +end + +function global_custom_deviceReport(devType) + -- type your script here (just before sending report to the device ) + return 2 +end + +function global_custom_enterSessionEvent(devType) + -- type your custom script on session start, here + print () + print ( "vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv") + print (string.format("simu : %s",GetContextInfo("simulation"))) + print (string.format("car : %s",GetContextInfo("carname"))) + print (string.format("track : %s",GetContextInfo("trackname"))) + --print (string.format("session: %s",GetContextInfo("session"))) + print () + if GetContextInfo("ospcustom") then print ("has ospcustom") end + + print (string.format("shiftlightsmethod: %s",GetContextInfo("shiftlightsmethod"))) + print (string.format("ospmethod : %s",GetContextInfo("ospmethod"))) + print (string.format("speedlimitemethod: %s",GetContextInfo("speedlimitermethod"))) + return 2 +end + +function global_custom_exitSessionEvent(devType) + -- type your custom script on session ending, here + if GetContextInfo("ospcustom") then print ("has ospcustom") end + print () + print (string.format("shiftlightsmethod: %s",GetContextInfo("shiftlightsmethod"))) + print (string.format("ospmethod : %s",GetContextInfo("ospmethod"))) + print (string.format("speedlimitemethod: %s",GetContextInfo("speedlimitermethod"))) + print ( "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^") + print () + + --my_setups=io.open("gus_cars.cfg", "a") + --my_setups:write(GetContextInfo("carname"), " shiftligts ", GetContextInfo("shiftlightsmethod"), "\n") + --my_setups:write(GetContextInfo("carname"), " speedlimiter ", GetContextInfo("speedlimitermethod"), "\n") + --my_setups:close() + + return 2 +end + + +-- ================================ +-- SLI-PRO, SLI-M, BU0710 SUPPORT + +function global_custom_ospMethodEvent(idx) + -- type your custom Optimal Shift Points (OSP) method here + return 2 +end + +function global_custom_shiftLightsMethodEvent(idx) + -- type your custom shiftlights method here + return 2 +end + +function global_custom_shiftLightsBU0710Event(idx) + -- type your custom shiftlights method for BU0710 device only here + return 2 +end + +function global_custom_leftDigitsEvent(swPosition) + -- type your custom script related to left SLI-PRO digits panel here + return 2 +end + +function global_custom_rightDigitsEvent(swPosition) + -- type your custom script related to right SLI-PRO digits panel here + return 2 +end + +function global_custom_spdLmtMethodEvent(idx) + -- type your custom speedlimiter method here + return 2 +end + +function global_custom_gearEvent(gear) + -- manage gear when ŽEŽ + if gear == 69 then + local ignition = 1 + if GetContextInfo("simulation") == "rFactor2.exe" then + ignition = GetCarInfo("ignition") + end + local g = GetCarInfo("gear") + + --print ( string.format("gear %d/ignition %d" , g, ignition)) + + toggleAllLed(0) + if ignition == 2 then + SetLeftDigits(" ---- ") + SetRightDigits(" ---- ") + else + SetLeftDigits(" ") + SetRightDigits(" ") + end + + if ignition == 0 then + SetGearDigit(" ") + elseif ignition == 1 then + SetGearDigit(GetCurrentGear()) + end + + SLISendReport(1) + return 1 + end + + return 2 +end + +function global_custom_ledEvent(idx, ledFunction, state) + -- type your custom script on session ending, here + return 2 +end + +-- ================================ +-- LOGITECH G27 SUPPORT + +function global_custom_shiftLightsG27LedsMethodEvent(idx) + -- type your custom shiftlights method for G27 device only here + return 2 +end + +function global_custom_ospG27MethodEvent(idx) + -- type your custom Optimal Shift Points (OSP) method here + return 2 +end + +function global_custom_spdLmtG27MethodEvent(idx) + -- type your custom speedlimiter method here + return 2 +end + +-- ================================ +-- FANATEC WHEELS SUPPORT + +function global_custom_shiftLightsFanatecMethodEvent(idx) + -- type your custom shiftlights method for Fanatec device only here + return 2 +end + +function global_custom_fanatecDigitsEvent(swPosition) + -- type your custom script related to Fanatec digits panel here + return 2 +end + +function global_custom_ospFanatecMethodEvent(idx) + -- type your custom Optimal Shift Points (OSP) method here + return 2 +end + +function global_custom_spdLmtFanatecMethodEvent(idx) + -- type your custom Optimal Shift Points (OSP) method here + return 2 +end + +function global_custom_gearFanatecEvent(gear) + -- type your custom gear event script here + return 2 +end + +-- ================================ +-- local custom events PLACEHOLDERS +-- DO NOT CHANGE THE SCRIPT BELOW +-- ================================ +function custom_controlsEvent(deviceIdx, ctrlType, ctrlPos, value, funcIndex) return 2 end +function custom_deviceReport(devType) return 2 end +function custom_ospMethodEvent(idx) return 2 end +function custom_ospG27MethodEvent(idx) return 2 end +function custom_ospFanatecMethodEvent(idx) return 2 end +function custom_shiftLightsMethodEvent(idx) return 2 end +function custom_shiftLightsBU0710Event(idx) return 2 end +function custom_shiftLightsG27LedsMethodEvent(idx) return 2 end +function custom_shiftLightsFanatecMethodEvent(idx) return 2 end +function custom_leftDigitsEvent(swPosition) return 2 end +function custom_rightDigitsEvent(swPosition) return 2 end +function custom_fanatecDigitsEvent(swPosition) return 2 end +function custom_spdLmtMethodEvent(idx) return 2 end +function custom_spdLmtG27MethodEvent(idx) return 2 end +function custom_spdLmtFanatecMethodEvent(idx) return 2 end +function custom_gearEvent(gear) return 2 end +function custom_gearFanatecEvent(gear) return 2 end +function custom_enterSessionEvent(devType) return 2 end +function custom_exitSessionEvent(devType) return 2 end +function custom_ledEvent(idx, ledFunction, state) return 2 end |