Jump to content

Hello. Can someone help me make a script please?

When Windows launches I want a program (TShock Terraria server) to launch with administrative privileges. Once launched I want it to start up the world, select the ports etc.

 

The server runs in a CMD window.

To select which world I want I use the number keys, then hit enter. Then I use the default port so I just hit enter again to start it.

 

Is it possible to automate this? Can anyone help?

 

Cheers,

Chris.

 

EDIT: Here is a linux script that does what I want... Only In linux...

#!/bin/shscreen -S terrarias-A -m \    mono-sgen TerrariaServer.exe \    -world "Terraria/Worlds/world1.wld" \    -config "tshock/config.json" "tshock/config.json" \    -killinactivesocket \    -connperip 3

Obviously I don't need mono as I'm in Windows.

You guys are crazy. You know you guys are self-destructive. There's a funny farm somewhere and it's got your names written all over it. But I'm gettin' outta here.

Link to comment
https://linustechtips.com/topic/173383-windows-script-help/
Share on other sites

Link to post
Share on other sites

Admin privileges: http://stackoverflow.com/questions/6811372/how-to-code-a-bat-file-to-always-run-as-admin-mode

 

Batch file syntax: http://www.computerhope.com/batch.htm

 

There is rich information out there to be had.

The single biggest problem in communication is the illusion that it has taken place.

Link to comment
https://linustechtips.com/topic/173383-windows-script-help/#findComment-2303315
Share on other sites

Link to post
Share on other sites

Thanks. I used that information along with some I found to successfully make a .bat that runs at startup. I also set the .exe to always launch as admin.

 

Here it is...

start "" "TerrariaServer.exe" -ignoreversion -port 7777 -world "C:\Users\%username%\Documents\My Games\Terraria\Worlds\first_go.wld"

Cheers,

Chris.

You guys are crazy. You know you guys are self-destructive. There's a funny farm somewhere and it's got your names written all over it. But I'm gettin' outta here.

Link to comment
https://linustechtips.com/topic/173383-windows-script-help/#findComment-2303528
Share on other sites

Link to post
Share on other sites

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

×