Hi, i want to make an autoserver that will pick tracks automatically in a very precise sequence.
To give you a global overview, i got 5 sub-folders in my /tracks folder : Racing, Fun, Punaball, Battle and X-Bumpz.
I would like to make a macro that will do the following :
- Select randomly 1 track in the Racing folder
- Select randomly 1 track in the Fun folder
- Select randomly 1 track in the Racing folder
- Select randomly 1 track in the Punaball folder
- Select randomly 1 track in the Racing folder
- Select randomly 1 track in the Battle folder
- Select randomly 1 track in the Racing folder
- Select randomly 1 track in the Fun folder
- Select randomly 1 track in the Racing folder
- Select randomly 1 track in the X-Bumpz folder
etc....
Until now i only found the "/tracks addrnd #" command but it takes tracks from the main /tracks folder and i cannot find how to instruct it to look into the sub-folders. And i cannot simply drop every track in the main folder because i need to balance the cup like stated above (1 racing and 1 other type alternately).
Any idea ?
Thx !
Autorserver macros & tracks
Moderator: Forum Moderators
Autorserver macros & tracks
Silver Arrows Racing | Tracks, cars and events
It's briefly documented in doc/README-autoserver.txt. I actually made something just like it for the LVP servers, here's a quick example for you (I used PHP, but it can be any language that can be run from the command line):S_Racer wrote:thx for quick reply dede !
Actually i am a programmer. How do the server scripts work ? where can i find a place to start looking into this ?
Thx !
sliders.ini:
Code: Select all
ScriptsOn 1
CustomCmd php ./custom.php
custom.php:
Code: Select all
<?php
/*
* Assumed usage: /cmd track <folder>
* Read input from input.prm. When you execute "/cmd track Racing", it will contain "track Racing"
* Check if the command equals "track" and get the desired folder
* (Optional: make an additional parameter for the number of tracks to be selected)
* Get all files matching with *.trk in the desired folder and randomly select one or more
* Write the track selection commands to custom.src.
*/
?>
example custom.src after execution (the quotes are important!):
Code: Select all
/tracks /add "banaring"
/tracks /add "luxuryng"
Now you can use things like /cmd track Racing in macros.ini. Hope I helped.