How do I write current server to a file?
#1
I was wondering if it's possible to automatically or even manually(Through a command) output the current server I'm connected to ingame out to a textfile so it could be easily read.

Say I'm in IRC, I could easily tell people which server I'm in by reading from the file.

It's a hectic job to type out the Server I.P.
Thanks given by:
#2
if you´re connecting to a server it will be print on the command line, you can copy-paste it easily from there
Thanks given by:
#3
Clientlogs clientlogs clientlogs
for Windows batch you would put something like
FOR /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set date=%%a-%%b-%%c)
FOR /f "tokens=1-3 delims=: " %%a in ('time /t') do (set time=%%a%%b-%%c)

bin_win32\ac_client.exe --init -T --home="C:\Users\Gibstick\AssaultCube_v1.1.0.3" %1 %2 %3 %4 %5 >> "C:\Users\Gibstick\AssaultCube_v1.1.0.3\clientlogs\clientlog-%date%-%time%.txt"
REM pause
Thanks given by:
#4
/curserver can do that. It takes a numerical argument to decide what to output.
Example:
alias serverinfo [
echo IP:Port: (curserver)    // outputs IP and port
echo IP: (curserver 1) // outputs IP
echo hostname: (curserver 2) // outputs hostname
echo Port: (curserver 3) // outputs port
]
With the examples I posted, you can type /serverinfo at any time you're connected, and stream your console output to a text file by editing your assaultcube.bat file:
bin_win32\ac_client.exe --mod=mods --init %1 %2 %3 %4 %5  >>log.txt
Running the .bat file will create (and thereafter add to) a text file called log.txt containing all your console output. You can then extract server information by searching specific strings relating to it.



Another way to do this is to save an alias-creating alias and use writecfg to store it in saved.cfg:
alias storeinfo [alias serverinfo (curserver); writecfg]
then, typing /storeinfo at any time when you are connected will store the info in saved.cfg. You can extract the info from saved.cfg (It is basically just a text file) by searching for the string "serverinfo".
Thanks given by:
#5
Thanks! :D That really helps
Thanks given by: