summaryrefslogtreecommitdiff
path: root/scripts/slimax_script_readme.txt
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/slimax_script_readme.txt')
-rwxr-xr-xscripts/slimax_script_readme.txt253
1 files changed, 222 insertions, 31 deletions
diff --git a/scripts/slimax_script_readme.txt b/scripts/slimax_script_readme.txt
index 8e5fc44..148f7f7 100755
--- a/scripts/slimax_script_readme.txt
+++ b/scripts/slimax_script_readme.txt
@@ -1,6 +1,6 @@
-SLIMax Manager II 2.2.4.5 Scripting Information - PART OF SLIMax Manager pkg
+SLIMax Manager III 3.0 Scripting Information - PART OF SLIMax Manager pkg
Copyright (c)2011-2013 by EK & Zappadoc - All Rights Reserved.
-updated 2013-01-16 by Zappadoc
+updated 2013-02 by Zappadoc
** ALL INFORMATION BELOW ARE SUBJECT TO CHANGE WITHOUT NOTICE **
@@ -24,9 +24,9 @@ Reference manual (v5.1):
http://www.lua.org/manual/5.1/
-=================================
+====================================
Events received from SLIMax Manager
-=================================
+====================================
function custom_initEvent(scriptFile)
param = custom script file name
@@ -34,54 +34,69 @@ Notes: this event is triggered at startup or when loading your custom script,
this is the good opportunity to init your preferences and global vars
All event functions below must return 1 if the event has been fully managed or
-0 (zero) to skip and give control to SLIMax Mgr
+2 to skip and give control to SLIMax Mgr
---------------------------------------------
function shiftLightsMethodEvent(idx) and custom_shiftLightsMethodEvent
function shiftLightsBU0710Event(idx) and custom_shiftLightsBU0710Event
+function shiftLightsFanatecMethodEvent(idx) and custom_shiftLightsFanatecMethodEvent
+function shiftLightsG27LedsMethodEvent(idx) and custom_shiftLightsG27LedsMethodEvent
param = current method index
+Devices supported: SLI Boards series, Fanatec Wheels and Logitech G27 leds
Notes: shiftlights method event, computes all shiftlights methods
(see shiftlights.lua script)
---------------------------------------------
function ospMethodEvent(idx) and custom_ospMethodEvent
+function ospFanatecMethodEvent(idx) and custom_ospFanatecMethodEvent
+function ospG27LedsMethodEvent(idx) and custom_ospG27LedsMethodEvent
param = current method index
+Devices supported: SLI Boards series, Fanatec Wheels and Logitech G27 leds
Notes: OSP method event, computes all Optimal Shift-Points methods
(see osp.lua script)
---------------------------------------------
function spdLmtMethodEvent(idx) and custom_spdLmtMethodEvent
+function spdLmtFanatecMethodEvent(idx) and custom_spdLmtFanatecMethodEvent
+function spdLmtG27MethodEvent(idx) and custom_spdLmtG27MethodEvent
param = current method index
+Devices supported: SLI Boards series, Fanatec Wheels and Logitech G27 leds
Notes: speedlimiter method event, computes all speedlimiter methods
(see speedlimiter.lua script)
---------------------------------------------
function leftDigitsEvent(swPosition) and custom_leftDigitsEvent
function rightDigitsEvent(swPosition) and custom_rightDigitsEvent
+function fanatecDigitsEvent(swPosition) and custom_fanatecDigitsEvent
param = switch position
-Notes: SLI-PRO Left and Right Panel functions events, computes data to be
+Devices supported: SLI Boards series and Fanatec Wheels
+Notes: SLI-PRO Left and Right Panel and Fanatec digits functions events, computes data to be
displayed on left and rights digits of SLI-PRO device
(see slipro.lua script)
---------------------------------------------
+function gearEvent(gear) and custom_gearEvent
+function gearFanatecEvent(gear) and custom_gearFanatecEvent
+Devices supported: SLI Boards series and Fanatec Wheels
+param = current seleted gear ( -1 = reverse, 0 = neutral, 1 ... 7)
+Notes: gear event, show the current selected gear on central digit
+(see gear.lua script)
+
+---------------------------------------------
function controlsEvent(deviceIdx, ctrlType, ctrlPos, value, funcIndex) and custom_controlsEvent
params = see the script
+Devices supported: global event
Notes: Controls Event, Manage buttons and switches. (see controls.lua script)
---------------------------------------------
function deviceReport(devType) and custom_deviceReport
param = the current targeted SLI device
+Devices supported: global event
Notes: This function is called periodically and outputs the previously processed data to the device when it returns
back to the manager, if needed, patch any previous function here to
display additional info or to change everything. (see devhook.lua script)
---------------------------------------------
-function gearEvent(gear) and custom_gearEvent
-param = current seleted gear ( -1 = reverse, 0 = neutral, 1 ... 7)
-Notes: gear event, show the current selected gear on central digit
-(see gear.lua script)
-
----------------------------------------------
function enterSessionEvent(devType) and custom_enterSessionEvent
param = current device (SLI-M, SLI-PRO or BU0710)
Notes: Triggered when the session starts
@@ -90,6 +105,7 @@ Notes: Triggered when the session starts
---------------------------------------------
function exitSessionEvent(devType) and custom_exitSessionEvent
param = current device (SLI-M, SLI-PRO or BU0710)
+Devices supported: global event
Notes: Triggered when the session ends
(see enter_exit_session.lua script)
@@ -111,6 +127,8 @@ param = index of the led, std state of the led and corresponding function
13=Blue Flag
14=DRS
15=Safe Prefs
+
+Devices supported: SLI Boards series only
Notes: patch std led behaviors (i.e. tc, abs, lowfuel,
dammage, rev limit, drs, pit request, flags, ... )
IMPORTANT: your script must be optimized as the function is
@@ -130,19 +148,65 @@ functions to change SLIMax Manager information
============================================
---------------------------------------------
+Fanatec additions:
+---------------------------------------------
+SetFanatecDigitsAllowed(boolean)
+param boolean = true or false
+by default the 3 digits are showed but sometime we need to temporarily
+hide them to set our custom information, pass false to this function to hide digits
+and true to show them again
+
+---------------------------------------------
+SetFanatecDigits(string)
+param string = 3 chars string + dots
+Set the alpha-numerical text (including the . delimiter) to the digits panel (see fanatec.lua script)
+
+---------------------------------------------
+SetFanatecOneDigit(digit,a,b,c,d,e,f,g,dot)
+param digit = from 0 to 2
+param a,b,c,d,e,f,g = false or true
+param dot = false or true
+Set the 7 segments + dot of each digit
+
+---------------------------------------------
+SetFanatecCspMotor(power,delay)
+param power: from 0 to 100
+param delay: from 0 to 1000 ms (1sec max)
+
+SetFanatecWheelMotor(motor,power,delay)
+param motor = 0 or 1 (left or right motor )
+param power: from 0 to 100
+param delay: from 0 to 1000 ms (1sec max)
+
+SetFanatecLed(string table)
+param string = name of lua table (default mRPMLedTable)
+set RPM led of Fanatec rim ( see shiftlights.lua script)
+
+SetFanatecGear(gear)
+param string = one char string (i.e. "r" or "n" or "1" ... )
+set the gear value in center of the Fanatec digits panel (see fanatec.lua script)
+
+---------------------------------------------
+Logitech Additions:
+---------------------------------------------
+SetG27Led(int)
+param integer = number, each bit represent one led from 0 to 0x1F
+set leds of G27 device ( see shiftlights.lua script)
+
+---------------------------------------------
SetBU0710Led(int)
param integer = number from 0 to 10
-set leds of BU0710 device (e.g. see shiftlights.lua script)
+set leds of BU0710 device ( see shiftlights.lua script)
---------------------------------------------
SetGeadDigit(string)
param string = one char string (i.e. "r" or "n" or "1")
-set gear digit of current targeted SLI device (e.g. see gear.lua script)
+set gear digit of current targeted SLI device ( see gear.lua script)
---------------------------------------------
SetRPMLed(string)
param string = name of lua table (default mRPMLedTable)
-set RPM led of current targeted SLI device, SLI-M or SLI-PRO (e.g. see shiftlights.lua script)
+set RPM led of current targeted SLI device, SLI-M or SLI-PRO ( see shiftlights.lua script)
---------------------------------------------
SetWarnLed(idx, val)
@@ -251,7 +315,7 @@ SLISleep(ms)
-----------------------------------------------------------------------------------
SLISendReport()
-
+FanatecSendReport()
-----------------------------------------------------------------------------------
SetGlobalBrightness(int)
@@ -281,6 +345,7 @@ GetCarInfo("selector")
GetTimeInfo("selector")
GetPartialTimeInfo("selector", index)
IsSLIFunction("selector", function_index)
+GetDeviceType(deviceID)
-----------------------------------------------------------------------------------
GetContextInfo("selector")
@@ -289,6 +354,24 @@ Param "selector" (string), this string contains the following value:
IMPORTANT ** THESE VALUES ARE NOT AVAILABLE IN ALL SIMULATIONS ** IMPORTANT
+Fanatec additions:
+"bypass" return the state of BYPASS preference (see advanced options panel)
+"fanatecdigitscount" return the number of digits default = 3
+"wheelmotorcount" return the number of wheel motors default = 2
+"cspmotorcount" return the number of Clubsport pedals motors default = 1
+"fanatecwheeltype" return the type of wheel
+"fanatecrimtype" return the type of rim ( BMW = 1; Formula = 2)
+"cspdetected" return true if CSP are present
+"gearshock" return state of GEARSHOCK effect preference (see advanced options panel)
+"gearshockdelay" return the value in ms of GEARSHOCKDELAY preference (see advanced options panel)
+"fanatecdigits" return the current position of digits panel
+"fanatecquickinfo" return the current selected quick-info function
+
+
+"shiftlightsmethod" return current selected method of targeted device
+"ospmethod" return current selected method of targeted device
+"speedlimitermethod" return current selected method of targeted device
+
"ospcustom" return true if an OSP record to the current car has been found
"neutral" return ascii code of neutral char (default 'n')
"reverse" return ascii code of reverse char (default 'r')
@@ -299,7 +382,7 @@ IMPORTANT ** THESE VALUES ARE NOT AVAILABLE IN ALL SIMULATIONS ** IMPORTANT
"paused" return true if simulation is paused if available
"pluginactive" return 1 if a plugin has been activated
"pluginready" return true if plugin is ready to send data from simulation
-"devicetype" return current targeted SLI USB device (integer - see mDeviceType global)
+"devicetype" return current targeted SLI USB device (integer - see also GetDeviceType())
"tracksize" return current track size (meter) if available
"lapdistance" return the traveled distance of the car (meter) if available
"trackame" return current track name if available
@@ -414,15 +497,13 @@ see GetContextInfo() to get the total number of partials
IMPORTANT ** THESE VALUES ARE NOT AVAILABLE IN ALL SIMULATIONS ** IMPORTANT
-"currentpartial" return current partial time if available
-"bestpartial" return best partial time of this sector if available
-"optimalpartial" return optimal partial time of this sector if available
-"sessionbest" return session best partial time of this sector
-"sessionoptimal" return session optimal partial time of this sector
-"diffbestpartial" return diff from best if available
-"diffoptimalpartial" return diff from optimal if available
-"diffsessionbest" return diff from session best if available
-"diffsessionoptimal" return diff from session optimal if available
+"currentpartial" return current partial time if available
+"vsbestlap" return best partial time of this sector if available
+"vsoptimallap" return optimal partial time of this sector if available
+"vssessionbestlap" return session best partial time of this sector
+"vsoptimalsector" return session optimal partial time of this sector
+"vssessionoptimallap" return diff from session optimal if available
+"vssessionoptimalsector" return diff from optimal if available
-----------------------------------------------------------------------------------
IsSLIFunction("selector", function_index)
@@ -433,6 +514,7 @@ Param index (number) contains the targeted function index returned by controlsEv
Param "selector" (string), contains the following value:
see controls.lua scripts for more info.
+"fanatecdigits"
"brightness"
"quickinfo"
"speedmetric"
@@ -443,7 +525,7 @@ see controls.lua scripts for more info.
"blinktime"
"lowfuel"
"speedlimitermethod"
-"shiftlightsmethod"
+"shiftlights"
"ospmethod"
"rightdigits"
"leftdigits"
@@ -451,6 +533,13 @@ see controls.lua scripts for more info.
"drivingsetup"
"maxgear"
+-----------------------------------------------------------------------------------
+GetDeviceType(deviceID)
+returns the corresponding name of device ID
+Param deviceID (integer)
+return string value
+
+
===============================
Script Developpment
globals and utilities
@@ -475,10 +564,28 @@ mSpdLimitMethod to overwrite the method value, useful in custom_spdLmtMethodEven
-----------------------
SHIFTLIGHTS UTILITIES
-----------------------
-[NEW] shiftlights utilities functions in SLIMax Mananger II script API
+shiftlights utilities functions in SLIMax Mananger script API
(see shiftlights.lua for example and usage)
--------------------------------------------------------
+shiftlights utilities functions for Fanatec
+--------------------------------------------------------
+-- shiftlights method from side to center
+function SideToCenterFanatec(rpm, redzone, p1, p2, p3, p4 ,p5 )
+
+-- progressive method
+function ProgressiveFanatec(rpm, redzone, p1, p2, p3, p4, p5, p6, p7, p8, p9 )
+
+-- alternate yellow, red and blue method
+function AlternateFanatec(rpm, redzone, step1, step2, step3)
+
+-- percentage method
+function percentageFanatec(rpm, redzone, p1, p2, p3, p4, p5, p6, p7, p8, p9 )
+
+-- fixed rpm method, set rpm for each led (NOT RECOMMENDED)
+function RpmFanatec(rpm, p1, p2, p3, p4, p5, p6, p7, p8, p9 )
+
+--------------------------------------------------------
shiftlights utilities functions for SLI-M and SLI-PRO
--------------------------------------------------------
-- shiftlights method from side to center
@@ -496,7 +603,7 @@ function percentageSLI(rpm, redzone, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p1
-- fixed rpm method, set rpm for each led (NOT RECOMMENDED)
function RpmSLI(rpm, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13 )
--- progressive method but with rpm value for eah led
+-- progressive method but with rpm value for eah led (NOT RECOMMENDED)
function ProgressiveFixedSLI(rpm, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13)
--------------------------------------------------------
@@ -512,7 +619,23 @@ function percentageBU0710(rpm, redzone, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10,
function RpmSLI(rpm, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11 )
--------------------------------------------------------
-LEFT and RIGHT Functions utilities
+shiftlights utilities functions for Logitech G27
+--------------------------------------------------------
+-- progressive method for G27
+function ProgressiveG27(rpm, redzone, p1, p2, p3, p4, p5)
+
+-- percentage method for G27
+function PercentageG27(rpm, redzone, p1, p2, p3, p4, p5)
+
+-- fixed rpm method for G27 (NOT RECOMMENDED)
+function RpmG27(rpm, p1, p2, p3, p4, p5 )
+
+--------------------------------------------------------
+-- KERS functions
+function GetKersPercent()
+
+--------------------------------------------------------
+LEFT and RIGHT Functions utilities for SLI-M and SLI-PRO
--------------------------------------------------------
-- add a function name to left and right functions list
@@ -522,6 +645,8 @@ LEFT and RIGHT Functions utilities
-- or right list:
-- local err = FuncAddName("cfg/sli_right_functions.ecfg", "100.DSII KERS")
-- return 1 if ok
+-- local err = FuncAddName("cfg/fanatec_digits_functions.ecfg", "100.DSII KERS")
+-- return 1 if ok
-- same as above for removing the function name
@@ -538,4 +663,70 @@ LEFT and RIGHT Functions utilities
-- local num_available = FuncGetNewIndex("cfg/sli_left_functions.ecfg")
-- or right list:
-- local num_available = FuncGetNewIndex("cfg/sli_right_functions.ecfg")
--- return value >=100 (0 to 99 are reserved ) \ No newline at end of file
+-- return value >=100 (0 to 99 are reserved )
+-- or fanatec list:
+-- local num_available = FuncGetNewIndex("cfg/fanatec_digits_functions.ecfg")
+-- return value >=100 (0 to 99 are reserved )
+
+--------------------------------------------------------
+functions utilities in global.lua
+--------------------------------------------------------
+
+-- return KERS value in percent
+function GetKersPercent()
+
+-- Init all globals
+function InitGlobals()
+
+-- set RPM threshold value in percentage ( SLIMax Manager 2.1 )
+function SetRPMPercentValue(index, value)
+
+-- set RPM threshold value ( SLIMax Manager 2.1 )
+function SetRPMAbsoluteValue(index, value)
+
+-- get all global preferences set in general_default.sli
+function GetSLIMaxInfo()
+
+-- get cpu ticks
+function GetTicks()
+
+-- reset table function
+function initLedTable(ibl, value)
+
+-- toggle all led state
+function toggleAllLed(val)
+
+-- The following function rounds a number
+-- lua doesn't return the same rounded value as C/C++
+function round(num)
+
+-- The following function calculate hr, mn, sec, hd, ms
+-- param: time in meter/sec
+function timeDispatcher( tt)
+
+-- return speed in KPH or MPH
+function speed(spd, selector)
+
+-- Fahrenheit to Celsius
+function FtoC(f)
+
+-- Celsius to Fahrenheit
+function CtoF(c)
+
+-- Kelvin to Celsius
+function KtoC(k)
+
+-- liters to gallons
+function LtoG(liters)
+
+-- gallons to liters
+function GtoL(gallons)
+
+-- return fuel in liters or gallons
+function GetFuel(fl, selector)
+
+-- return celcius or fahrenheit
+function GetTemp(tmp, selector)
+
+-- set delta time delay in ms
+function SetDeltaTimeDelay(delay) \ No newline at end of file