summaryrefslogtreecommitdiff
path: root/scripts/zdoc_scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/zdoc_scripts')
-rwxr-xr-xscripts/zdoc_scripts/iracing_common_scripts.lua83
-rwxr-xr-xscripts/zdoc_scripts/iracing_stuff.lua158
2 files changed, 190 insertions, 51 deletions
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
diff --git a/scripts/zdoc_scripts/iracing_stuff.lua b/scripts/zdoc_scripts/iracing_stuff.lua
index b53c66c..42a708d 100755
--- a/scripts/zdoc_scripts/iracing_stuff.lua
+++ b/scripts/zdoc_scripts/iracing_stuff.lua
@@ -1,11 +1,33 @@
--- Custom SLIMax Manager Scripts for iRacing v2.1
+-- Custom SLIMax Manager Scripts for iRacing v3
-- Copyright ©2012-2013 by Zappadoc
--- _last change by Zappadoc - 2012-12-17
+-- _last change by Zappadoc - 2013-02
-- =====================================
-- iRacing Stuff script
-- define car setup function and all pit limiter and shiftlights methods for each car you drive
+function iRacing_DebugCarInfo(devType)
+ -- see debug console window
+ -- get car name
+ local dev = GetDeviceType(devType)
+ local cNm = GetContextInfo("carname")
+ local mxG = GetCarInfo("maxgear")
+ local ospf = GetContextInfo("ospfactor")
+ print("\n----------\nDevice:"..dev.."\nSetup car:" .. cNm .. "\nMaxGear:" .. mxG .. "\nOSP Factor:" .. ospf .. "\n");
+end
+function iRacing_InitGearEvent(gear)
+ -- 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
+ end
+ end
+end
function iRacing_CarSetup(cGear)
-- get car name
@@ -160,7 +182,7 @@ function FixRPMSpeedlimiter()
end
-function iRacing_spdLmtMethodEvent(idx)
+function iRacing_spdLmtMethodEvent(idx, devType)
local led = ""
-- get car name
@@ -175,7 +197,7 @@ function iRacing_spdLmtMethodEvent(idx)
elseif cNm == "williamsfw31" then
-- speedlimiter led fixed + digits blinking, method 6
- mSpdLimitMethod = 6
+ mSpdLimitMethod = 5
elseif cNm == "fordv8sc" then
mSpdLimitMethod = 2
@@ -234,7 +256,7 @@ function iRacing_spdLmtMethodEvent(idx)
return 2
end
-function iRacing_shiftLightsMethodEvent(idx)
+function iRacing_shiftLightsMethodEvent(idx, dev)
-- rpm table name
local tName = "mRPMLedTable"
-- get rpm
@@ -268,55 +290,117 @@ function iRacing_shiftLightsMethodEvent(idx)
end
end
+ -- get device type
+ if dev == nil then dev = "none" end
+
-- shiftlights stuff
if cNm == "formulamazda" then
-- start Mazda shiftlights
- SideToCenterSLI(rpm, gRedZone, 94.5, 95, 96, 97 ,98 ,99 ,99.5)
-
+ if dev == "FANATEC" then
+ SideToCenterFanatec(rpm, gRedZone, 96, 97 ,98 ,99 ,99.5)
+ else
+ SideToCenterSLI(rpm, gRedZone, 94.5, 95, 96, 97 ,98 ,99 ,99.5)
+ end
elseif cNm == "mclarenmp4" then
local gear = GetCarInfo("gear")
if gear == 6 then
- ProgressiveFixedSLI(rpm, 6300, 6490, 6580, 6690, 6720 , 6870 , 7000 , 7200, 7305, 7340, 7340, 7340, 7340)
+ if dev == "FANATEC" then
+ RpmFanatec(rpm, 6720 , 6870 , 7000 , 7200, 7305, 7340, 7340, 7340, 7340)
+ else
+ ProgressiveFixedSLI(rpm, 6300, 6490, 6580, 6690, 6720 , 6870 , 7000 , 7200, 7305, 7340, 7340, 7340, 7340)
+ end
else
- ProgressiveFixedSLI(rpm, 6200, 6390, 6480, 6590, 6620 , 6670 , 6750 , 6800, 6895, 7040, 7040, 7040, 7040)
+ if dev == "FANATEC" then
+ RpmFanatec(rpm, 6620 , 6670 , 6750 , 6800, 6895, 7040, 7040, 7040, 7040)
+ else
+ ProgressiveFixedSLI(rpm, 6200, 6390, 6480, 6590, 6620 , 6670 , 6750 , 6800, 6895, 7040, 7040, 7040, 7040)
+ end
end
elseif cNm == "williamsfw31" then
- AlternateSLI(rpm, gRedZone, 11.0, 12.0, 12.9)
+ if dev == "FANATEC" then
+ AlternateFanatec(rpm, gRedZone, 7.0, 8.0, 8.9)
+ else
+ AlternateSLI(rpm, gRedZone, 11.0, 12.0, 12.9)
+ end
elseif cNm == "mx5 cup" or cNm == "mx5 roadster" then
- SideToCenterSLI(rpm, gRedZone, 86, 90, 95, 96 ,97 ,98 ,99)
+ if dev == "FANATEC" then
+ SideToCenterFanatec(rpm, gRedZone, 95, 96 ,97 ,98 ,99)
+ else
+ SideToCenterSLI(rpm, gRedZone, 86, 90, 95, 96 ,97 ,98 ,99)
+ end
elseif cNm == "fr500s" then
- SideToCenterSLI(rpm, gRedZone, 80, 84, 86, 88 ,90 ,98 ,99)
+ if dev == "FANATEC" then
+ SideToCenterFanatec(rpm, gRedZone, 86, 88 ,90 ,98 ,99)
+ else
+ SideToCenterSLI(rpm, gRedZone, 80, 84, 86, 88 ,90 ,98 ,99)
+ end
elseif cNm == "fordv8sc" then
- SideToCenterSLI(rpm, gRedZone, 87, 90, 92, 94 ,97 ,98 ,99)
+ if dev == "FANATEC" then
+ SideToCenterFanatec(rpm, gRedZone, 92, 94 ,97 ,98 ,99)
+ else
+ SideToCenterSLI(rpm, gRedZone, 87, 90, 92, 94 ,97 ,98 ,99)
+ end
elseif cNm == "dallara" then
- SideToCenterSLI(rpm, gRedZone, 78, 82, 90, 94 ,97 ,98 ,99)
---
+ if dev == "FANATEC" then
+ SideToCenterFanatec(rpm, gRedZone, 90, 94 ,97 ,98 ,99)
+ else
+ SideToCenterSLI(rpm, gRedZone, 78, 82, 90, 94 ,97 ,98 ,99)
+ end
+
elseif cNm == "fordgt" then
- SideToCenterSLI(rpm, gRedZone, 93, 94, 95, 96 ,97 ,98 ,99)
+ if dev == "FANATEC" then
+ SideToCenterFanatec(rpm, gRedZone, 95, 96 ,97 ,98 ,99)
+ else
+ SideToCenterSLI(rpm, gRedZone, 93, 94, 95, 96 ,97 ,98 ,99)
+ end
elseif cNm == "hpdarx01c" then
- ProgressiveFixedSLI(rpm, 7800, 7900, 8100, 8300, 8500 , 8700 , 8800 , 8900, 9100, 9300, 9500, 9700, 9940)
-
+ if dev == "FANATEC" then
+ RpmFanatec(rpm, 8500 , 8700 , 8800 , 8900, 9100, 9300, 9500, 9700, 9940)
+ else
+ ProgressiveFixedSLI(rpm, 7800, 7900, 8100, 8300, 8500 , 8700 , 8800 , 8900, 9100, 9300, 9500, 9700, 9940)
+ end
+
elseif cNm == "rileydp" then
- ProgressiveFixedSLI(rpm, 10000, 6700, 6800, 6900, 7000 , 10000 , 10000 , 10000, 10000, 10000, 10000, 10000, 10000)
-
+ if dev == "FANATEC" then
+ RpmFanatec(rpm, 6900, 7000 , 10000 , 10000 , 10000, 10000, 10000, 10000, 10000)
+ else
+ ProgressiveFixedSLI(rpm, 10000, 6700, 6800, 6900, 7000 , 10000 , 10000 , 10000, 10000, 10000, 10000, 10000, 10000)
+ end
+
elseif cNm == "c6r" then
- ProgressiveFixedSLI(rpm, 4700, 4800, 4900, 5000, 5200 , 5300 , 5400 , 5600, 5700, 5800, 5900, 6000, 6100)
+ if dev == "FANATEC" then
+ RpmFanatec(rpm, 5200 , 5300 , 5400 , 5600, 5700, 5800, 5900, 6000, 6100)
+ else
+ ProgressiveFixedSLI(rpm, 4700, 4800, 4900, 5000, 5200 , 5300 , 5400 , 5600, 5700, 5800, 5900, 6000, 6100)
+ end
elseif cNm == "radical sr8" then
- ProgressiveFixedSLI(rpm, 4350, 4800, 5100, 5700, 6400 , 6900 , 7700 , 8100, 8700, 9850, 10100, 10250, 10500)
+ if dev == "FANATEC" then
+ RpmFanatec(rpm, 6400 , 6900 , 7700 , 8100, 8700, 9850, 10100, 10250, 10500)
+ else
+ ProgressiveFixedSLI(rpm, 4350, 4800, 5100, 5700, 6400 , 6900 , 7700 , 8100, 8700, 9850, 10100, 10250, 10500)
+ end
elseif cNm == "jettatdi" then
- SideToCenterSLI(rpm, gRedZone, 80, 84, 86, 88 ,90 ,98 ,99)
+ if dev == "FANATEC" then
+ SideToCenterFanatec(rpm, gRedZone, 86, 88 ,90 ,98 ,99)
+ else
+ SideToCenterSLI(rpm, gRedZone, 80, 84, 86, 88 ,90 ,98 ,99)
+ end
elseif cNm == "cadillacctsvr" then
--ProgressiveFixedSLI(rpm, 6500, 6580, 6600, 6700, 6800 , 6900 , 7000 , 7100, 7200, 7300, 7400, 7500, 7600)
- ProgressiveSLI(rpm, gRedZone, 11.9, 11.95, 11.98, 12, 12.1, 12.15, 12.2, 12.25, 12.3, 12.35, 12.5, 12.8, 12.98 )
+ if dev == "FANATEC" then
+ ProgressiveFanatec(rpm, 7.9, 8.15, 8.2, 8.25, 8.3, 8.35, 8.5, 8.8, 8.98 )
+ else
+ ProgressiveSLI(rpm, gRedZone, 11.9, 11.95, 11.98, 12, 12.1, 12.15, 12.2, 12.25, 12.3, 12.35, 12.5, 12.8, 12.98 )
+ end
-- progressive default method for all cars with dashboard without leds
-- elseif cNm == "latemodel" then
@@ -337,19 +421,35 @@ function iRacing_shiftLightsMethodEvent(idx)
else
-- default
- ProgressiveSLI(rpm, gRedZone, 7.5, 8, 8.5, 9, 9.5, 10, 10.5, 11, 11.5, 12, 12.5, 12.8, 12.98 )
+ if dev == "FANATEC" then
+ ProgressiveFanatec(rpm, 4.5, 5, 6.5, 7, 7.5, 8, 8.5, 8.8, 8.98 )
+ else
+ ProgressiveSLI(rpm, gRedZone, 7.5, 8, 8.5, 9, 9.5, 10, 10.5, 11, 11.5, 12, 12.5, 12.8, 12.98 )
+ end
end
-- set leds
SetRPMLed(tName)
end
-function iRacing_ospMethodEvent(idx)
+function iRacing_ospMethodEvent(idx, devType)
-- get car name
local cNm = GetContextInfo("carname")
- -- OSP Method stuff
- if cNm == "mclarenmp4" or cNm == "williamsfw31" then
- if mOSPMethod ~= nil then mOSPMethod = 3 end
+ -- OSP Method stuff
+ if mOSPMethod ~= nil then
+ if cNm == "mclarenmp4" or cNm == "williamsfw31" then
+ --if devType == "FANATEC" then
+ -- mOSPMethod = 0
+ --else
+ mOSPMethod = 3
+ --end
+
+ -- else
+ -- -- default
+ -- if devType == "FANATEC" then
+ -- mOSPMethod = 1
+ -- end
+ end
end
return 2
end \ No newline at end of file