The online racing simulator
LFS scripts database
1
(33 posts, started )
#1 - Vain
LFS scripts database
Hello!

I thought there should be a thread where we can share our scripts for LFS.

Prelude:
The scriptfiles go to "Your_LFS_Directory/data/Script" and require Patch U18 or above.
All scripts are set up for the setup of the author, so your will need to edit them. You can't just copy them into your scripts folder and hope that they'll work, because they won't. You'll need to alter the number of the axes, the assigned ctrl-F keys and the number of the buttons according to your setup. You can see the button-number flash up to the right of the screen when you press the button while in the "Controls" screen. The number of the axes can be seen in the axes submenu of the control screen.
All scripts can be edited using window's notepad. Information about the available commands can be found in the testpatch-thread.

Here are mine:
1. The F9->F10->F12->F12 cycle.
This script will make a button on your wheel cycle through the F9, F10 and F12 screens. You press the button a first time, the F9 screen comes up. You press it a second time, F10 comes up, third time, F12 comes up, fourth time, F12 disappears, fifth time F9 appears and again.
In my version I use button 40 and CTRL+F12 for the script. Change this as necessary for your setup in the scripts.
Place "run bindF9" in your autoexec.lfs to enable this script.
2. The clutchstart-script.
This script will make a button on your comtroller turn your brake pedal (or any axis) into a clutch and disable autoclutch. Upon the second button press the axis works as a brake again and autoclutch is restored. This can be used to launch the car with a manual clutch and to switch back to the normal two-pedal setup once you're at a higher speed.
I myself have few use for it and only did it to see wether it works, but perhaps someone else wants to use it.
To use this script make sure you have clutch set to axis in the top section of the controls-screen.
I use button 45, axis 7 and CTRL+F9 to trigger the script. Change as necessary.
Place "run clutchstart" in your autoexec.lfs to enable this script.
3. Indicators
This script will allow you to assign a button on your controller to an indicator. You press the button, the indicator starts flashing. You press the button again, the indicator is disabled.
My scripts use buttons 42, 43, Ctrl+F10 and Ctrl+F11. Change these as necessary.
Add "run bind8" and "run bind7" to your autoexec.lfs to enable this script.

LFS's script system isn't very complicated. If you're confused what the commands do, read them up in the testpatchthread. If you're confused about how the scripts work (which file calls which scripts for what reason) feel free to ask.

Vain
Attached files
F9cycle.zip - 1.1 KB - 872 views
Clutchstart.zip - 379 B - 723 views
indicators.zip - 1 KB - 974 views
#2 - troy
to bad that there are no replys here so far, so im postin a big thanks for you vain
finaly i bought myself a dfp got many unused buttons and thats the right thing to fill some of them

i modified your system a bit (to fit the dfp and add a bit more functions)
so i thought i will post it here also even if its not completly my own
same rules for this one modify the script so it fits your buttons on the wheel

changed the f9 f10 f12 cycle so i can modify my pitstrategies also on the wheel
and then i added the front lights to your indicators script
if somebody wants to run it unmodified here the buttons that will be used



(1) if your not in pitstrategies it will be used for the indicator lights
(2) the f9f10f12 cycle (if your in f12 (1) will be used to change your strategy)

make sure you add this to your autoexec.lfs:

run bindf9
run bind7
run bind8
run bind9

and read Vain's post properly for a exact howto install help
Attached images
DFP 3.jpg
Attached files
script.zip - 3.2 KB - 546 views
#3 - Lible
Thanks for your database, Vain. Thought I'll share my superscript for 4 buttons + gear changers (behind the wheel), I don't have a shifter tough, and 2 of my 6 buttons are broken (should fix them ).

I'm sorry because of the size of the script, but I didn't find a way to optimize it.

Info: Has two modes, which can be changed by pressing a button. First mode in roadcar version includes left-right view and horn, in limiter version (for race cars) includes left-right view and limiter. The second page contains F9, F10, F12. If you'll press the button for F12, it will activate a new script which will activate the 3. mode, in which you'll have up, left-right buttons. I know it's complicated, but pretty much for 4 buttons .

I'll upload the limiter script later, don't think there are many players with 4 buttons tough, I'll make one with 6 buttons.

Oh, damnit, it's in Estonian now... except the script in 10 minutes.

And it's here. Tell me what you think of this robustic system.
Attached files
Liblescript.zip - 2 KB - 473 views
I've made a little script some time ago, aimed for usage with MS Sidewinder wheel, which has two paddles and six buttons, three on each side, like this:

(3) (0)
(4) (1)
(5) (2)

So if your wheel is not a MS SW but has the same button layout, you can use it. There could be a difference with the button numbering, though, so you might have to rework the script then.

Description
The lower left button (5) toggles through four wheel configurations, namely
  • Race:
    Clutch, TC, Speed Limiter
    Basic race configuration for the more race tuned cars. Mainly for use with cars that have a speed limiter, traction control or both.
  • Rally/Road:
    Clutch, Handbrake, Horn
    Race configuration for the road cars, or when rallying.
  • City driving:
    Indicators, Horn
    For those relaxing hours when not racing on the limit, pretending to be on an everyday drive.
  • Config-Mode:
    F9-F12 view + manipulation
    Allows looping through the F9-F12 views with one button, the other buttons (0, 1, 2 and 4) are used for navigation and value modification in the F11 and F12 menus.
Each time you change the config, it is "echo"ed to the screen, like in the attached screenshot. The bindings are shown in a place corresponding to the button positions, so the top left command is executed by the top left button (3), while the middle right command by button (1), etc. It also spews out alot of blank lines to make it appear on the same top-left place all the time, and not beneath each other like in the screenshot, to avoid confusion
Additionally, the echo lines are coloured, so with the blink of an eye you know which configuration you are in.

The script uses a few [Ctrl+X] key combinations, so these would be unusuable/overwritten then: F6, F7, F9, F10, F11, F12. The autoexec.lfs always resets it to "race" mode, but I've renamed the one in the zip to _autoexec.lfs, so it doesn't overwrite yours.

With a bit of scripting knowlege it's easy to change the bindings or add additional configs to the loop, so if something doesn't fit you, change it!
Attached images
Script.jpg
Attached files
WheelConfigScript.zip - 3.3 KB - 587 views
Mmm, would this thread be better in the programmer forum ?
It's not an app editing something, it's basically code you write ?
I'm thinking...
#6 - Lible
Thank you, AndroidXP, got some ideas from your script. I use F5, F6 and F7 to change between configs tough.
Cluthstart
Hi, would like to start by saying thanks!
It's great, however:
I've set it all up just so, but would like the script to swap clutch and brake around. What I mean is that when clutch has an axis asigned to it, I want the brake to be a button and vice versa.
How do I reconfig the script to do so? Simply typing button 5 brake under axis 2 clutch doesn't work!
Thanks in advance!
Quote from AndroidXP :


Config-Mode:
F9-F12 view + manipulation
Allows looping through the F9-F12 views with one button, the other buttons (0, 1, 2 and 4) are used for navigation and value modification in the F11 and F12 menus.

...

The script uses a few [Ctrl+X] key combinations, so these would be unusuable/overwritten then: F6, F7, F9, F10, F11, F12. The autoexec.lfs always resets it to "race" mode, but I've renamed the one in the zip to _autoexec.lfs, so it doesn't overwrite yours.

With a bit of scripting knowlege it's easy to change the bindings or add additional configs to the loop, so if something doesn't fit you, change it!

Quote :
//Config-Mode configuration: F9-F12 view + manipulating
/echo ^6-- ^8CONFIGURATION ^6----------------
/echo ^7F9-F12 
/echo ^7‹ ›
/echo MODE ^7
/echo ^1
/echo ^1
/echo ^1
/echo ^1
/echo ^1
/echo ^1
/echo ^1
/echo ^1
/echo ^1
/echo ^1
/echo ^1
/button 5 ctrl_f6
/ctrlf 6 /run WheelConfig1
/button 0 ctrl_f9
/button 1 ctrl_f10
/button 2 ctrl_f11
/button 3 ctrl_f7
/button 4 ctrl_f12
/ctrlf 9 /press up
/ctrlf 10 /press right
/ctrlf 11 /press down
/ctrlf 12 /press left
/ctrlf 7 /run viewF9

Missing the "viewf9" file ,so it gives an error "can not open viewf9 "

I dont know how to config f9 - f12 to one button so i need a little bit help .
Oh damnit! :doh:

Forgot a whole bunch of .lfs files in the original zip. I've now updated it, please download again.
Thanks,

now it works perfect
Could you have a look at my little problem, please?

Quote from Vain :Hello!

2. The clutchstart-script.
This script will make a button on your comtroller turn your brake pedal (or any axis) into a clutch and disable autoclutch. Upon the second button press the axis works as a brake again and autoclutch is restored. This can be used to launch the car with a manual clutch and to switch back to the normal two-pedal setup once you're at a higher speed.
I myself have few use for it and only did it to see wether it works, but perhaps someone else wants to use it.
To use this script make sure you have clutch set to axis in the top section of the controls-screen.
I use button 45, axis 7 and CTRL+F9 to trigger the script. Change as necessary.
Place "run clutchstart" in your autoexec.lfs to enable this script.

Vain

I think Vain has already done the script for your problem

Edit: Second read ,your problem is maybe not solved if you would like to brake with the button while the clutch is set to an axis.
*bump*
and, anyone got any more scripts to share?
Im looking for more examples to learn from, Ive almost got my head around it.
Anyone know the command for adjusting virtual clocks? I want virtual clocks in the MRT5 as with an FOV of 80, I can't see the real dash!
#15 - Iron
Hmm, I guess it's not possible to create a script that would, at a press of a button, look right in the cockpit and zoom out in the same time, and after releasing the button, it would zoom back into the original fov (and of course the view would return to forward view, but that's automatic), right?
Quote from Iron :Hmm, I guess it's not possible to create a script that would, at a press of a button, look right in the cockpit and zoom out in the same time, and after releasing the button, it would zoom back into the original fov (and of course the view would return to forward view, but that's automatic), right?

I'm 99% sure, that it is possible. Do you want me to make a script like that?
#17 - Iron
Yes please, i would be grateful, since i have no idea how i could do that, even after i read through the commands.txt in the \docs folder.

Edit: to make it simple, i imagine it working something like this:
I press and hold the button: right_view, fov 110
When i release the button: the view returns to the center, fov 55
Quote from Iron :Yes please, i would be grateful, since i have no idea how i could do that, even after i read through the commands.txt in the \docs folder.

Edit: to make it simple, i imagine it working something like this:
I press and hold the button: right_view, fov 110
When i release the button: the view returns to the center, fov 55

I'll see what I can do.
EDIT: Not exactly possible, because Scawen hasn't implented release command. But I'll figure out something good enough, I hope.
EDIT2: You were right, it's impossible :I
#19 - Iron
Quote from Lible :I'll see what I can do.
EDIT: Not exactly possible, because Scawen hasn't implented release command. But I'll figure out something good enough, I hope.
EDIT2: You were right, it's impossible :I

Hehe
No problem, though you kinda got my hopes up.
I wanted this script (I'm sure you know why) because I play with a low fov (55), and this limits my view very much, I find that a lot of time I don't know (can't see) where's the other car, not even by looking left or right, as those use the same low fov, so if it's not exactly beside me, I can't see it. Switching to smooth from instant look helped a bit, but not much.
Sorry for the off-topic.
You need program, which emulates secondary press button when you release button. Need find the coder who write this program
How do I get the first script cycle to work?
Indicators where do i put the there file?
<LFS>\data\script
Now its saying i don't have admin rights.
??? Don't forget to disable the Logitech key-functions you've set up earlier!
1

LFS scripts database
(33 posts, started )
FGED GREDG RDFGDR GSFDG