Sauerworld Forum

Sauerbraten Content => Scripts => Topic started by: TЯISTAП on October 10, 2020, 06:44:57 PM

Title: fast connection to clan servers [OIT]
Post by: TЯISTAП on October 10, 2020, 06:44:57 PM
this script allows you to connect faster to clan servers [OIT], the script is activated by clicking F7, if you want you can set another key.
you have to copy and paste it into autoexec located in: C: / documents / my games / sauerbraten/
since i am not a connoisseur of C / cubescript language, to create this script i took a few lines of code from this other script: http://sauerworld.org/forum/index.php?topic=455.0
Code: [Select]
// ------------------------------------------------------------------------
// [OIT] server connessione veloce - 10 Ottobre 2020
// (C) Tristan05, ZLIB license
// http://www.opensource.org/licenses/zlib-license.php
// ------------------------------------------------------------------------


bind "F7" [showgui Server]
editbind "F7" [showgui Server]

createine = [if (=s (getalias $arg1)) [$arg1 = $arg2]]
createine serv_count 5
looplist p "serv ip port" [
loop i 15 [createine (concatword f_ @p $i)]
]

newgui Server [
guitext "^f7clicca sui server per connetterti"
guibar
loop i $serv_count [
if (|| (!=s (getalias (concatword f_serv $i))) (!=s (getalias (concatword f_ip $i)))) [
guibutton (concat "Connettiti a^f2" (getalias (concatword f_serv @i))) [connect (getalias (concatword f_ip @@i)) (getalias (concatword f_port @@i))]
]
]
guitab "About"
guitext "^f7Script creato da ^f2Tristan05^f7"
                  guitext "^f7visita il website del clan [^f0O^f7I^f3T^f7] ^f2https://sauerbratenclanogrositalianteam.webs.com/^f7"
                  guitext "^f7licenza ZLIB, ^f2http://www.opensource.org/licenses/zlib-license.php^f7"
] "[OIT] server"

f_ip0 = [192.168.1.105]
f_ip1 = [192.168.1.105]
f_ip2 = [192.168.1.105]
f_port0 = [28785]
f_port1 = [28787]
f_port2 = [28789]
f_serv0 = [[OIT] #1]
f_serv1 = [[OIT] #2]
f_serv2 = [[OIT] #3]
// --------------------------------------------------------------------------------------------------
Title: Re: fast connection to clan servers [OIT]
Post by: RaZgRiZ on October 12, 2020, 06:35:55 AM
I like how part of the script is basically a small piece of my Favorite Servers GUI (http://sauerworld.org/forum/index.php?topic=455.0). You have lots to learn :P