From 6ea53840c9cb9b99c41fbb4d87a1acac8c0889e5 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Fri, 1 Mar 2013 10:19:54 +0100 Subject: SLIMaxMgr III beta --- scripts/zdoc_scripts/iracing_common_scripts.lua | 83 ++++++++++++++++++------- 1 file changed, 61 insertions(+), 22 deletions(-) (limited to 'scripts/zdoc_scripts/iracing_common_scripts.lua') diff --git a/scripts/zdoc_scripts/iracing_common_scripts.lua b/scripts/zdoc_scripts/iracing_common_scripts.lua index 1d5bb02..3b19bb2 100755 --- a/scripts/zdoc_scripts/iracing_common_scripts.lua +++ b/scripts/zdoc_scripts/iracing_common_scripts.lua @@ -1,6 +1,6 @@ --- iRacing SLI-PRO Custom SLIMax Manager Scripts v2.3 +-- iRacing SLI-PRO Custom SLIMax Manager Scripts v3 -- Copyright ©2012-2013 by Zappadoc - All Rights Reserved. --- last change by Zappadoc - 2012-12-17 +-- last change by Zappadoc - 2013-02 -- ================================ -- CONSTANTS @@ -45,8 +45,18 @@ function custom_ospMethodEvent(idx) -- get current simulation name local sim = GetContextInfo("simulation") if isAppIRacing(sim) then - result = iRacing_ospMethodEvent(idx) - + result = iRacing_ospMethodEvent(idx, "SLI") + end + return result +end +function custom_ospFanatecMethodEvent(idx) + -- type your custom Optimal Shift Points (OSP) method here + -- custom speedlimiter for each iRacing car + local result = 2 + -- get current simulation name + local sim = GetContextInfo("simulation") + if isAppIRacing(sim) then + result = iRacing_ospMethodEvent(idx, "FANATEC") end return result end @@ -58,7 +68,21 @@ function custom_shiftLightsMethodEvent(idx) -- get current simulation name local sim = GetContextInfo("simulation") if isAppIRacing(sim) then - iRacing_shiftLightsMethodEvent(idx) + iRacing_shiftLightsMethodEvent(idx, "SLI") + -- skip std methods + return 1 + end + + return 2 +end +function custom_shiftLightsFanatecMethodEvent(idx) + -- type your custom shiftlights method here + + -- custom shiftlights for each iRacing car + -- get current simulation name + local sim = GetContextInfo("simulation") + if isAppIRacing(sim) then + iRacing_shiftLightsMethodEvent(idx, "FANATEC") -- skip std methods return 1 end @@ -81,6 +105,11 @@ function custom_rightDigitsEvent(swPosition) return 2 end +function custom_fanatecDigitsEvent(swPosition) + -- type your custom script related to Fanatec digits panel here + return 2 +end + function custom_spdLmtMethodEvent(idx) -- type your custom speedlimiter method here @@ -89,25 +118,40 @@ function custom_spdLmtMethodEvent(idx) -- get current simulation name local sim = GetContextInfo("simulation") if isAppIRacing(sim) then - result = iRacing_spdLmtMethodEvent(idx) - + result = iRacing_spdLmtMethodEvent(idx, "SLI") end return result end +function custom_spdLmtFanatecMethodEvent(idx) + -- type your custom Optimal Shift Points (OSP) method here + + -- custom speedlimiter for each iRacing car + local result = 2 + -- get current simulation name + local sim = GetContextInfo("simulation") + if isAppIRacing(sim) then + result = iRacing_spdLmtMethodEvent(idx, "FANATEC") + end + return result +end + +function custom_gearFanatecEvent(gear) + -- type your custom gear event script here + + local sim = GetContextInfo("simulation") + if isAppIRacing(sim) then + iRacing_InitGearEvent(gear) + end + return 2 +end + function custom_gearEvent(gear) -- type your custom gear event script here - -- get current simulation name - -- custom script to overwrite OSP value and OSP limit for each gear of each iRacing car + local sim = GetContextInfo("simulation") if isAppIRacing(sim) then - if gOldGear == nil then gOldGear = -2 end - -- setup iRacing car OSP, RedZone, Max gear, ... - iRacing_CarSetup(gear) - if gear ~= gOldGear then - gOldGear = gear - -- print("\n----------\nGear: ".. gear .."\nOSP: " .. gOSPLimit .. "\nRedZone:" .. gRedZone .."\n") - end + iRacing_InitGearEvent(gear) end return 2 end @@ -120,12 +164,7 @@ function custom_enterSessionEvent(devType) local sim = GetContextInfo("simulation") if isAppIRacing(sim ) then iRacing_CarSetup(0) - -- see debug window - -- get car name - local cNm = GetContextInfo("carname") - local mxG = GetCarInfo("maxgear") - local ospf = GetContextInfo("ospfactor") - print("\n----------\nSetup car:" .. cNm .. "\nMaxGear:" .. mxG .. "\nOSP Factor:" .. ospf .. "\n"); + iRacing_DebugCarInfo(devType) end return 2 end -- cgit v1.2.3