Sauerworld Forum

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

Title: Connessione Veloce ai Server OIT
Post by: TЯISTAП on October 10, 2020, 06:44:57 PM
Questo script ti permette di connetterti rapidamente ai server OIT attraverso un'interfaccia. Il codice è ispirato a una parte del lavoro di RaZgRiZ (BFTP - Favorite Servers GUI).

Installazione:

Metodo Rapido:
- Copia e incolla lo script direttamente nel file autoexec.cfg che si trova nella seguente directory:
  C:\Users\TuoNome\Documents\My Games\Sauerbraten
  Nota: Sostituisci TuoNome con il tuo nome utente.

Metodo Pulito:
- Crea una cartella chiamata scripts nella stessa directory del file autoexec.cfg.
- All'interno della cartella scripts, crea un file chiamato OITserver.cfg.
- Incolla lo script nel file OITserver.cfg.
- Aggiungi la seguente riga al file autoexec.cfg:
Code: [Select]
exec scripts/OITserver.cfg
Script:
Per aprirlo premi F3.
Code: [Select]
// @file fast_connection
// @author Tristan Traver
// @brief Questo script permette di connettersi velocemente ai server
//        OIT attraverso un interfaccia grafica (per aprire tasto F3).
// @version 1
// @date 2020-10-01


bind "F3" [showgui Server]  // modificabile.
editbind "F3" [showgui Server]
                   
createine = [if (=s (getalias $arg1)) [$arg1 = $arg2]]
createine serv_count 3
looplist p "serv ip port" [
    loop i 15 [createine (concatword f_ @p $i)]
]
                   
newgui Server [
    guitext "^f7Seleziona server"
    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 ^f2TЯISTAП^f7"
    guitext "^f7visita il website del clan [^f0O^f7I^f3T^f7] ^f2http://ogrositalianteam.servegame.com/^f7"
]

f_ip0 = [192.168.1.115]; f_ip1 = [192.168.1.115]; f_ip2 = [192.168.1.115];
f_port0 = [28785]; f_port1 = [28787]; f_port2 = [28789];
f_serv0 = [OgrosItalianTeam.serv1]; f_serv1 = [OgrosItalianTeam.serv2]; f_serv2 = [OgrosItalianTeam.serv3];
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