Urban Terror Forums: Looking for HOW TO set up a script to automatically run the game and join a server - Urban Terror Forums

Jump to content

 Login | Register 
Advertisement
Page 1 of 1

Looking for HOW TO set up a script to automatically run the game and join a server Rate Topic: -----

Server Setup help for windows batchfile

#1 User is offline   Byaroma1 Icon

  • Account: byaroma1
  • Joined: 05-April 18
  • Posts: 3
  • Notoriety: -

Posted 05 April 2018 - 07:50 PM

Hi there,
so I have made a batch file to run the game on my windows 10 computer:


cd/
c:
net use u: 10.10.41.xxxut
u:
ioUrbanTerror.exe


______
I am using a VM to run the game while hosting it from my windows machine. This script works perfectly. I am trying to have my batch file also run the game and automatically put me in a server. Can anyone help me do that? I search around for answers and couldn't come up with any I understand.

Thanks,

B

This post has been edited by Byaroma1: 05 April 2018 - 07:50 PM


#2 User is offline   Iye Icon

  •   head moderator   
    Co-Chief Community Moderator
  • Account: iye
  • Country:
  • Joined: 07-June 11
  • Posts: 888
  • Notoriety: serious

Posted 05 April 2018 - 11:19 PM

I am slightly confused.

You run a server on your win10?
but then you run a virtual machine?
and on that machine you run that batch script?
so it maps a network drive and then executes a terribly old UrT executable?
and you want that game started there to connect to a server?

Why are you running it in a VM in the first place? there is nothing stopping you from just running server and client from the same machine, hell even the same installation should work.

In any case, there is two methods for making the game automatically connect:
  • executable +connect IP:port
    
    fairly obvious. hand any commands to the executable, and it will run them. Note the + instead of the - common for linux
  • use the urt:// protocol, that gets setup with the launcher.


However, since you are using a batch script already, the first method should be your obvious choice.
Sorry for my bad spelling - I am still asleep. :)

|=| Iye's UrT Addon |=| Firefox Personas |=| Maps |=|
http://www.mediafire...vk3a602hcfg.jpg

#3 User is offline   Byaroma1 Icon

  • Account: byaroma1
  • Joined: 05-April 18
  • Posts: 3
  • Notoriety: -

Posted 10 April 2018 - 07:04 PM

View PostIye, on 05 April 2018 - 11:19 PM, said:

I am slightly confused.

You run a server on your win10?
but then you run a virtual machine?
and on that machine you run that batch script?
so it maps a network drive and then executes a terribly old UrT executable?
and you want that game started there to connect to a server?

Why are you running it in a VM in the first place? there is nothing stopping you from just running server and client from the same machine, hell even the same installation should work.

In any case, there is two methods for making the game automatically connect:
  • executable +connect IP:port
    
    fairly obvious. hand any commands to the executable, and it will run them. Note the + instead of the - common for linux
  • use the urt:// protocol, that gets setup with the launcher.


However, since you are using a batch script already, the first method should be your obvious choice.




Thanks-- the reason why I have such a crazy setup is becuase this is for a College Course and we were asked if we could find a way to connect for extra credit. This is a computer systems maintenance class. Thank you for the support.

#4 User is offline   Byaroma1 Icon

  • Account: byaroma1
  • Joined: 05-April 18
  • Posts: 3
  • Notoriety: -

Posted 10 April 2018 - 07:10 PM

View PostByaroma1, on 10 April 2018 - 07:04 PM, said:

Thanks-- the reason why I have such a crazy setup is becuase this is for a College Course and we were asked if we could find a way to connect for extra credit. This is a computer systems maintenance class. Thank you for the support.



I tried your suggestion and I am still finding no luck. I think its becuase I dont know the proper commands?
cd/
c:
net use u: 10.10.41.xxxut
u:
ioUrbanTerror.exe
executable +connect IP:xxx.xxx.xxx

#5 User is offline   Iye Icon

  •   head moderator   
    Co-Chief Community Moderator
  • Account: iye
  • Country:
  • Joined: 07-June 11
  • Posts: 888
  • Notoriety: serious

Posted 10 April 2018 - 11:45 PM

uhm. well. yes.

I might not have been super clear and marked the <executable> to actually mean that filename, but it should obviously read

ioUrbanTerror.exe +connect <serverIP>[:<serverPort>]



where <serverIP> is the IP where your server is running, and <serverPort> would be any custom port you set on the server. This is optional, indicated by the notation of [], which is common in command documentation. Additionally i would add that the notation of <IP>:<port> is standard for IP + port combinations.


On an related note, the cd / and c: in your code is entirely unnecessary as net use doesnt care where it is called from. The switching of the workspace to u: can be avoided by simply adding it to the command you use to start UrT.

your entire .bat file could look like this:
net use u: 10.10.41.xxxut
start "" /D "u:" "ioUrbanTerror.exe" +connect <serverIP>


im using start here, because i have no idea how windows handles paths given as part of commands and how it selects the working directory for an executable. With start at least i know, and its simple to specify. The first ""is the name of the created cmd window, which is irrelevant here, but has to be set. the /D "u:" sets the working directory of the executble to your network drive. the third is obviously just your excutable name, which is then followed by any parameters handed to it.

Alternatively, if you want to disconnect the network drive after the game is closed use:

net use u: 10.10.41.xxxut
start "" /D "u:" /WAIT "ioUrbanTerror.exe" +connect <serverIP>
net use u: /DELETE


this will wait for the executable to be done (aka someone closed the game), and then disconnect the network drive.
Sorry for my bad spelling - I am still asleep. :)

|=| Iye's UrT Addon |=| Firefox Personas |=| Maps |=|
http://www.mediafire...vk3a602hcfg.jpg

bullet_loaderAdvertisement
Page 1 of 1


Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users

Advertisement


Copyright © 1999-2018 Frozensand Games Limited  |  All rights reserved  |  Urban Terror™ and FrozenSand™ are trademarks of Frozensand Games Limited

Frozensand Games is a Limited company registered in England and Wales. Company Reg No: 10343942