Topic: Connect to server via parameters
Hello.
I want to create an AutoIt script that runs the teeworlds server and client, and connects to localhost automatically.
Is there any parameter that does that?
You are not logged in. Please login or register.
Teeworlds Forum → Support → Connect to server via parameters
Hello.
I want to create an AutoIt script that runs the teeworlds server and client, and connects to localhost automatically.
Is there any parameter that does that?
you can pass any commands to the client by putting it behind the binary name. It could look like this in a bash script:
#!/bin/bash
./teeworlds_srv -f server.cfg &
./teeworlds "connect localhost:8303"
all i needet was teeworlds "connect localhost", but thx
OK, now it's working.
And this is the code:
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.6.1
Author: DarkWiiPlayer
Script Function:
Run TeeWorlds server and client and the connects to localhost.
#ce ----------------------------------------------------------------------------
; Script Start - Add your code below here
$i = Run ( "teeworlds_srv.exe -f OnlineServer.cfg" )
If $i = 0 Then
msgbox ( 0, "TeeWorlds", "ERROR: Could not start the server" )
EndIf
$i = Run ( 'teeworlds.exe "connect localhost"' )
If $i = 0 Then
msgbox ( 0, "TeeWorlds", "ERROR: Could not start the game" )
EndIf
AutoIt Version: 3.3.6.1
lmao
???
yes, i'm using AutoIt version 3.3.6.1... and?
DarkWiiPlayer wrote:AutoIt Version: 3.3.6.1
lmao
Seconded. Don't use AutoIt. Batch scripts should be just as fine.
AutoIt is easyer if you want to start the server AND the game from the same file...
If you just write
teeworlds_srv -f lol.cfg
teeworlds "connect localhost"
in a batch file, it will first start the server, and then it will wait until the program ends, but you want to start the game BEFORE the server closes, right?
In an AutoIt script that is easyer to solve. You just write
Run ( "teeworlds_srv.exe -f lol.cfg" )
Run ( 'teeworlds_srv.exe "connect localhost" )
And it works.
AutoIt is easyer if you want to start the server AND the game from the same file...
If you just writeteeworlds_srv -f lol.cfg teeworlds "connect localhost"
in a batch file, it will first start the server, and then it will wait until the program ends, but you want to start the game BEFORE the server closes, right?
As you have to know how to code in AutoIt you have to know how to 'code' in batch:
@echo off
start teeworlds_srv.exe -f config.cfg
call teeworlds.exe "connect localhost"
exit
...
that works...
But anyway, batch files aren't as cool as AutoIt scripts.
...
that works...
But anyway, batch files aren't as cool as AutoIt scripts.
Why?
Give up...There's no way convincing them that it's your choice...But I guess batch file is better... (even if it's not "cooler")
because batch reminds me of strawberries, whereas autoit makes me think of robots. random info.
I think AutoIt is better because you can make messageboxes.
$i = Run ( "teeworlds_srv.exe -f OnlineServer.cfg" )
If $i = 0 Then
msgbox ( 0, "TeeWorlds", "ERROR: Could not start the server" )
EndIf
Teeworlds Forum → Support → Connect to server via parameters
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 3 official extensions. Copyright © 2003–2009 PunBB.