1 (edited by fabdn 2008-04-28 20:28:09)

Topic: GUI server configurator

I was bored, so that i created a little tool....dont know if its useful for anybody here - just try it. It hasnt so many functions yes (under development) but it should be a good tool for all the guys out there who are to lazy to edit the config-files using notepad.

screenshot:
http://img3.imagebanana.com/img/cfle8tnr/screen.jpg

it's a pre-alpha, so theres no warranty. i'll also include more features etc... but only if anybodys interested in this project.

DOwnload: http://rapidshare.com/files/111097932/t … erconf.exe


fabdn


edit: btw guys, i just noticed that the gui is kinda big. i'm using a 1680x1050 screen so it seems very small to me - if you want a smaller gui, write a comment.

2

Re: GUI server configurator

Nice initiative, but you know there are a server config GUI already?

Used to be very active waay back

3

Re: GUI server configurator

nope. link?

but doesnt matter. i made this prog only to improve my skills, i'm a programming newbie.

4

Re: GUI server configurator

http://www.teeworlds.com/forum/viewtopic.php?id=850

But I totaly understand you point wink

Used to be very active waay back

5

Re: GUI server configurator

If you want people to download it, at least include the source. I think I'm not the only one who don't want virus smile

6 (edited by fabdn 2008-04-29 13:41:47)

Re: GUI server configurator

here u are.
btw: have a look. no virus inside.
http://www.virustotal.com/de/analisis/3 … d98a89d1b6


;nötige Sachen includen
#include <GUIConstants.au3>
#include <string.au3>

;Öffne relevante Dateien

$dir = @AppDataDir & "\Teeworlds\settings.cfg"
$config = FileOpen ($dir, 0)
$inhalt = FileRead($config)

;Suche Servernamen
$vor_server = "sv_name"
$nach_server = "sv_bindaddr"
$server = _StringBetween($inhalt, $vor_server, $nach_server) ;definiere den servernamen
$server = $server[0] ;mache aus array string

;suche timelimit
$vor_time = "sv_timelimit"
$nach_time = "sv_gametype"
$timelimit = _StringBetween($inhalt, $vor_time, $nach_time) ;definiere zeitlimit
$timelimit = $timelimit[0] ;array => string

;suche scorelimit
$vor_score = "sv_scorelimit"
$nach_score = "sv_timelimit"
$scorelimit = _StringBetween($inhalt, $vor_score, $nach_score) ;definiere scorelimit
$scorelimit = $scorelimit[0] ;array zu string

;suche gametype
$vor_type = "sv_gametype"
$nach_type = "sv_tournament_mode"
$type = _StringBetween($inhalt, $vor_type, $nach_type) ;definiere scorelimit
$type = $type[0] ;array zu string

;suche Karte
$map_line = FileReadLine($dir, 83)
$map = StringTrimLeft($map_line, 6)

;suche password
$vor_pwd = "password"
$nach_pwd = "logfile"
$pwd = _StringBetween($inhalt, $vor_pwd, $nach_pwd) ; definiere pwd
$pwd = $pwd [0]

#Region ### START Koda GUI section ### Form=c:\dokumente und einstellungen\bl1zz\desktop\svrconf\form1.kxf
$Form1_1 = GUICreate("Teeworlds Server Configurator", 633, 454, 193, 115)
$Pic1 = GUICtrlCreatePic("teewrs_1.jpg", 24, 8, 569, 193, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Label1 = GUICtrlCreateLabel("Servername", 8, 224, 61, 17)
$srv = GUICtrlCreateInput("Unnamed Server", 80, 224, 193, 21)
$tlimit = GUICtrlCreateLabel("Timelimit", 8, 256, 44, 17)
$Input1 = GUICtrlCreateInput("0 (=off)", 80, 256, 193, 21)
$slmiti = GUICtrlCreateLabel("Scorelimit", 8, 288, 49, 17)
$Input2 = GUICtrlCreateInput("0 (=off)", 80, 288, 193, 21)
$gametype = GUICtrlCreateLabel("Gametype", 8, 336, 52, 17)
$dm = GUICtrlCreateRadio("DM", 88, 336, 41, 17)
$tdm = GUICtrlCreateRadio("TDM", 136, 336, 49, 17)
$ctf = GUICtrlCreateRadio("CTF", 192, 336, 49, 17)
$Label2 = GUICtrlCreateLabel("Map", 360, 232, 25, 17)
$List1 = GUICtrlCreateList("", 360, 248, 113, 97)
GUICtrlSetData(-1, "dm1|dm2|dm6|ctf1|ctf2")
$Label3 = GUICtrlCreateLabel("Password:", 8, 368, 53, 17)
$password = GUICtrlCreateInput("none", 80, 368, 137, 21)
$Button1 = GUICtrlCreateButton("Generate Config.-File", 240, 384, 123, 49, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###




While 1
$nMsg = GUIGetMsg()
Switch $nMsg

Case $GUI_EVENT_CLOSE
             Exit


Case $Button1
    ;Erstelle neues Configfile
            FileOpen ("C:\a.txt", 2)
            ;------SERVER-------------
            ;Lese eingegebenen namen aus
            $new_server = GuiCtrlRead( 5)
            ;Erstelle neuen Inhalt
            $inhalt_neu = StringRegExpReplace($inhalt, $server, " " & $new_server &@CRLF, 1)
            ;--------SERVER ENDE------
           
            ;-----TIMELIMIT---------
           
            $new_timelimit = GuiCtrlRead( 7)
           
            If StringIsDigit($new_timelimit) = 0 Then
                MsgBox( 16, "Error", "If I were you, I'd only use digits for a timelimit.")
            EndIf
           
            $inhalt_neu = StringRegExpReplace($inhalt_neu, "sv_timelimit" & $timelimit, "sv_timelimit " & $new_timelimit &@CRLF, 1)
            ;---TIMELIMIT ENDE----
           
            ;----SCORELIMIT---------
            $new_scorelimit = GuiCtrlRead( 9)
           
            If StringIsDigit($new_scorelimit) = 0 Then
                MsgBox( 16, "Error", "If I were you, I'd only use digits for a scorelimit.")
            EndIf
           
            $inhalt_neu = StringRegExpReplace($inhalt_neu, "sv_scorelimit" & $scorelimit, "sv_scorelimit " & $new_scorelimit &@CRLF, 1)
            ;----SCORELIMIT ENDE------
           
            ;----GAMETYPE----------
            $dm = GuiCtrlRead ( 11)
            $tdm = GuiCtrlRead (12)
            $ctf = GuiCtrlRead ( 13)
           
            If $dm = 1 Then
                            $inhalt_neu = StringRegExpReplace($inhalt_neu, "sv_gametype" & $type, "sv_gametype dm" &@CRLF, 1)   
        EndIf ;MIT goto ARBEITEN?
       
            If $tdm = 1 Then
                            $inhalt_neu = StringRegExpReplace($inhalt_neu, "sv_gametype" & $type, "sv_gametype tdm" &@CRLF, 1)   
                        EndIf
                       
                    If $ctf = 1 Then
                            $inhalt_neu = StringRegExpReplace($inhalt_neu, "sv_gametype" & $type, "sv_gametype ctf" &@CRLF, 1)   
                        EndIf
                       
            ;-----ende gametype-----
           
            ;-----KARTE-------
            $new_map = GuiCtrlRead (15)
           
            If $new_map = 1 Then
                MsgBox( 16, "Error", "Playing without any map isnt much fun.")
           
            Else
                $inhalt_neu = StringRegExpReplace($inhalt_neu, "sv_map" & $map, "sv_map " & $new_map, 1)       
            EndIf
            ;----KARTE ENDE------
           
           
            ;---PASSWORD
            $new_pwd = GuiCtrlRead (17)

            If $pwd = "none" Then
                MsgBox (0, "!", "No password set")
            Else
                $inhalt_neu = StringRegExpReplace($inhalt_neu, "password" & $pwd, "password " & $new_pwd &@CRLF, 1)
            EndIf
            ;----PW ENDE!-------
       
        FileWrite ("C:\a.txt", $inhalt_neu) ;Schreibe Datei!

$frage = GuiCtrlRead (15)
msgbox (0, "list", $frage)
EndSwitch
WEnd
;-----------------
;-----------------

7

Re: GUI server configurator

can you add more maps or you can write the map on you self

8

Re: GUI server configurator

sure. I'll add a custom-map feature tomorrow.