The online racing simulator
StartLight Control
Hello Lapperusers,

After getting many questions about how to setup the AutoX Startlights.
I will publish a example script, which is also available in the current LFSLapper version.

###############################
#HOW TO INSTALL THE ADDON
###############################
  • -Be Sure you have the latest version of LFSLapper: https://www.lfs.net/forum/thread/58433-Release.
  • -Open the file and change the extension of the file to: .LPR
  • -Save the file in the 'includes' folder (\bin\default\includes)

  • -Open the "addonsused.LPR" file (\bin\default\includes\addonsused.LPR) and add the following lines:
include( "./AutoX_StartLight_Example.lpr");

-Start LFSLapper

###############################
#HOW TO SET THE LIGHTS
###############################
  • -Open AutoX editor (Shift+U)
  • -Add some Startlights ( Control >> Startlights)
  • -Change the indentifier (0 - 63)
As you can see the lights arent working. Thats because you have to optimise the layout.
  • -Click on 'MORE' button.
  • -Click on 'OPTIMISE' button.
The lights are lit green now.

Now type command !slid. And change the Index/Indentifier/Mode/Light
  • -Index ( 149 = AutoX lights or 240 = Track Startlight )
  • -Indentifier (Indentifier of the light you want to change the light)
  • -Modes (common is 5)
Attached files
AutoX_StartLight_Example.txt - 4 KB - 306 views
Thanks
Somebody asked be something about this script and while playing with the buttons, I managed to crash Lapper, which lead to this being written into the logfile:

Quote :11/24/2017 3:46:43 PM

Lapper Instance 127.0.0.1/29994 abort!

Input string was not in a correct format.
mscorlib
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.Byte.Parse(String s, NumberStyles style, NumberFormatInfo info)
at System.Byte.Parse(String s)
at LFSLapper.LFSClient.startlightcontrol(unionVal val, ArrayList args)
at GLScript.GLApp.parseBackcall(SetOfVars GVAR, SetOfVars LVAR, unionVal val, ArrayList args)
at GLScript.Parseur.getval(SetOfVars GVAR, SetOfVars LVAR, executeParsedFunction BC)
at GLScript.GLApp.retrieveEvalVar(String funcName, TokenParse tkparse, TokenBuffer currTokenBuffer, SetOfVars GVAR, SetOfVars LVAR, Boolean breakFunc, Char& breakCar)
at GLScript.GLApp.privExecuteTokensPart(Int32 level, String funcName, SetOfVars GCAR, SetOfVars LVAR, Boolean breakable, Boolean inSwitchCase, Int32 start, Int32 end)
at GLScript.GLApp.privExecuteFunction(String funcName, String[] argsVals)
at GLScript.GLApp.executeFunction(String funcName, String[] argsVals)
at Configurator.lexConfigurator.executeFunction(String funcName, infoPlayer pcurrInfoPlayer, String[] par)
at LFSLapper.LFSClient.managePacket(BTC btc)
at LFSLapper.LFSClient.Loop(Connect insimConnection)
at LFSLapper.LFSClient.doloop()
at LapperInstances.LapperInstance.doConnection()
Void StringToNumber(System.String, System.Globalization.NumberStyles, NumberBuffer ByRef, System.Globalization.NumberFormatInfo, Boolean)
Closing Instance...

Sadly I haven't been able to reproduce this crash, so no idea what went wrong exactly.

I made a small improvement to the script, by limiting the user input to only the valid values for each field.
When an invalid value is entered, a warning is shown telling the user what the valid valies for that field are.

Changelog for V1.1:

- Restricted user input for each field to only valid values for that field, otherwise display a warning

Change the extension of the file to .lpr and add it to addonsused.lpr to be able to use it.
Attached files
AutoX_StartLight_Example.txt - 4.7 KB - 220 views
oke thanks Yisc[NL], for updating this script.

I will add this to my buglist, to see i can find anything that might cause this crash.

StartLight Control
(4 posts, started )
FGED GREDG RDFGDR GSFDG