Console commands to a .bat file.

Status
Not open for further replies.

Some guy2

Member
I was wondering if there is a way to set console commands to a bat file, just like AUTOEXEC. Those commands would be executed when you double click the bat file.
E.g~
srb2win.exe -file some.wad -ringslinger on -startrings 121323

And will every command work? (-file is actualy addfile)
 
Console commands at startup

Console commands can't be executed from the command line in that fashion, but you can get console commands to run at startup using scripts, which you could think of as in-game batch files.

As far as I know, there's no way to run a script from the SRB2 command line (please correct me if I'm wrong on this one), but you can use AUTOEXEC.CFG, which always runs at startup.

To achieve the desired effect, create a file called AUTOEXEC.CFG in the same directory as the SRB2 executable. Fill it with something like this:

Code:
addfile some.wad
ringslinger on
startrings 123123

If AUTOEXEC.CFG already exists, add those lines to the end of the file. Also, you could still use the -file command line option instead of the addfile command, but I've had nothing but trouble with it.

This has the slight problem of executing these commands every time you start SRB2, which is probably not what you want. Instead, you could create individual script files, and have exec commands in AUTOEXEC.CFG, which can be added and removed fairly easily. Or better still, bind exec statements to keys, e.g.:

Code:
bind h "exec myscript.txt"

Then, you can press h in-game to run the script.


Oogaland.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top