Jump to content

Custon scripts - help please


jungleNZ

Recommended Posts

Hi,

I am trying to learn from all the scripts available and online so I can implement scripts to mods in my configs.

I have looked at python and batch commands. Currently working on Assetto Config. I have a mod called sTracker that I get to install ok. I then have a start sTracker (from the more button), command runs, service starts. If I run it on another gameserver it start another service. My issue is when I go to stop tracker on one server (taskkill /IM stracker.exe /F) it kills both or all stracker named services. I have looked online to try and differentiate but no luck. Is anyone able to guide my into either batch file way or python way to resolve.

 

Appreciated

jungle (James)

GNZ

Link to comment
Share on other sites

2 hours ago, Aeioyoo said:

Kill by PID instead? You'll need to take note of the PID when the service is launched too, maybe via a variable.

thanks, have explored that method no avial. For some strange reason when i run bat file or exe it creates 2 named.exe's in processes.

Link to comment
Share on other sites

I normally have a script on mod install that renames the exe, eg.

REN %ThisService_RootDirectory%Mod.exe Mod%ThisService_ServiceId%.exe

Then you can just use 

taskkill /IM mod%ThisService_ServiceID%.exe /F

As each services mod exe now has a unique name

Link to comment
Share on other sites

16 minutes ago, Disasta said:

I normally have a script on mod install that renames the exe, eg.

REN %ThisService_RootDirectory%Mod.exe Mod%ThisService_ServiceId%.exe

Then you can just use 

taskkill /IM mod%ThisService_ServiceID%.exe /F

As each services mod exe now has a unique name

Thanks, will look into this. WORKS LIKE A CHARM - THANK YOU VERY MUCH FOR INPUT.

Edited by jungleNZ
Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Who's Online   0 Members, 0 Anonymous, 17 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use