Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. My bare hosting costs are currently not met so please consider donating by either clicking this text or the Patreon link on the right.

Patreon

Recommended Posts

Posted
Anyone know how to run a random batch file when GameEx returns from a game?

how do you mean a random batch file? do you mean gameex picks one out of a directory full?

Posted

Exactly. I have a bunch of Game Over batch files I've made for different animations. I'd like to run one randomly when you're returned to the game list. GameEx doesn't necessarily need to be the one doing the randomizing, I just wasn't sure if there was some little app that could run a random file in a directory.

Posted

Easiest way would be to write an AHK script that runs a random file and just call that script in GameEx. It should be pretty easy. All you would do is count the number of files and pick a random number in that range to decide which file to call. If you need help, someone here can help (I'm pretty busy at the moment or else I would help now).

Posted

Well if you use integers for names for your batch files you could use something like the following AutoIt script...tho you may wish to improve upon it.

$i = Random ( 1 , 100 , 1 )

Run ( $i & '.bat' )

That should launch 1.bat through 100.bat

The script would simply be compiled and used in your Launch After field for which ever Emu you would like to use it with.

^^^^

hehe what he said more or less. :)

Posted

Good idea nologic! I assumed the batch files had meaningful names, but if not then just numbering them consecutively would make it REALLY easy!

If you choose to go this route, you might do a quick search for batch file renaming programs. I would guess there might be one that can perform this rename in a single click rather than having to do it manually. If you only have a handful, then it wouldn't matter of course.

Posted
Good idea nologic! I assumed the batch files had meaningful names, but if not then just numbering them consecutively would make it REALLY easy!

If you choose to go this route, you might do a quick search for batch file renaming programs. I would guess there might be one that can perform this rename in a single click rather than having to do it manually. If you only have a handful, then it wouldn't matter of course.

Try Better File Rename. It will let you rename them like this with just about one click. This program is definitely worth having, especially if you find yourself renaming lots of files at a time like I'm in the habit of.

Jay T

Posted

Your welcome.

Here is a different version that should run any batch file with any name...and more can be added without altering the script.

#include <File.au3>

$FileList = _FileListToArray( @ScriptDir , '*.bat' , 1 )

$i = Random ( 1 , $FileList[0] , 1 )

Run ( $FileList[$i] )

Guest
This topic is now closed to further replies.
×
×
  • Create New...