[gui] moderate

[gui] moderate

Postby bonifarz » 11 Oct 2012, 23:54

I decided to open a new topic for this gui here, which was inspired by and based on the master menu by Calinou.

moderate.png
a random preview of V0.1, hosts blurred

moderate0.2.png
Bot panel in V0.2


The features of this include
  • select players from a list to execute various actions
  • conveniently write warnings containing the players name and host
  • keep track of warnings, mutes, kicks and bans with persistent lists
  • easily identify hosts you once warned, muted, kicked or banned

Changelog
{l Code}: {l Select All Code}
V0.2:
status icons for admin/ auth/ helper added
select a bot for a large list of bot options
player names added in all IP lists to ease editing your config.cfg
serverdesc field changed to a button
servermotd button/field added
darker background for better readability
a few more lines and conditionals for a clear layout


moderate.cfg
{l Code}: {l Select All Code}

// [moderate] gui by Bonifarz, based on [master] by Calinou


//Important: Persistent lists
//Comment out these lines if you want to keep the IP lists of players you once banned etc.
//Each list needs to be initialized, so first run the script once.
//mywarnlist = ""
//mymutelist = ""
//mykicklist = ""
//mybanlist  = ""
//setpersist mywarnlist 1
//setpersist mymutelist 1
//setpersist mykicklist 1
//setpersist mybanlist  1

//local variables
adminpw = "hide"
setserverdesc = "0"
setservermotd = "0"
cnsel = "-1"


newgui moderate [
guibackground 0x000000
    guistayopen [
        if ($setserverdesc) [
            guifield serverdesc (* -1 (strlen $serverdesc)) [
                setserverdesc = 0
            ]
        ] [
            guibutton (concatword " Server: "$serverdesc) [
                setserverdesc = 1
            ]
        ]
        if ($setservermotd) [
            guifield servermotd -60 [
                setservermotd = 0
                // no idea why this tends to cause an errous tab
                // while the same for serverdesc does not...
            ]
        ] [
            guibutton "^fa view/ set MotD (login message)" [
                setservermotd = 1
            ]
        ]
        // here we could add some interesting server stats using the (getserver i i i) command
        // not sure what first index to use for the connected server
        guibar
        guilist [
            guibar
            guilist [
                guibutton "^falanconnect" [lanconnect] "" "textures/flag"
                guibutton "^fwclaim admin" [
                    adminpw = ""
                ] "" "textures/rocket"
                if (strcmp $adminpw "") [
                //  guitext "password: " // this causes an errous tab
                    guifield adminpw 15 [
                        setpriv $adminpw
                    ]
                ]
                guibutton "auth ^fa/^f(textures/pistol) helper" [
                    setpriv 1
                ] "" "textures/shotgun"
                guibutton "^fwopen (log-)file" [notepad servlog.txt] "" "textures/modeediting"
                if (ishelper (getclientnum)) [
                    guibar
                    // maybe collapse these four with a button
                    guibutton "^fgopen mode"    [mastermode 0] "" "textures/server"
                    guibutton "^fcveto mode"    [mastermode 1] "" "textures/server"
                    guibutton "^fylocked mode"  [mastermode 2] "" "textures/serverlock"
                    guibutton "^fmprivate mode" [mastermode 3] "" "textures/serverpriv"
                    guibar
                    guibutton "^fgreset variables " [resetvars]  "" "textures/action"
                    guibutton "^fyclear all mutes"  [clearmutes] "" "textures/chat"
                    guibutton "^frclear all bans"   [clearbans]  "" "<mad:.75/.75/.75>textures/warning"
                    guibutton "^farelinquish priv." [setpriv 0]  "" "textures/action"
                ]
            ]
            guibar
            guilist [
                guitext (concatword "^fycn")
                guibar
                loop cn $serverclients [
                    if (> (strlen (getclientname $cn)) 0) [
                         guitext (concatword "^fy" $cn )
                    ]
                ]
            ]
            guibar
            guilist [
                guitext (concatword "^fbhost (IP)")
                guibar
                loop cn $serverclients [
                    if (> (strlen (getclientname $cn)) 0) [
                         guitext (concatword "^fb" (getclienthost $cn))
                    ]
                ]
            ]
            guibar
            guilist [
                guitext "^fw^f(textures/flag)"
                // player status icons: spec/team,  server priv, warn/mute/kick/banlists
                guibar
                loop cn $serverclients [
                    if (> (strlen (getclientname $cn)) 0) [
                         guilist [
                             case ( (getclientteam $cn) 0 ) 1 [
                                 guitext (concatword "^f[" $teamalphacolour "]^f(textures/teamalpha)  ")  ] 2 [
                                 guitext (concatword "^f[" $teamomegacolour "]^f(textures/teamomega)  ")  ] 3 [
                                 guitext (concatword "^f[" $teamkappacolour "]^f(textures/teamkappa)  ")  ] 4 [
                                 guitext (concatword "^f[" $teamsigmacolour "]^f(textures/teamsigma)  ")  ] 0 [
                                 if (= (isspectator $cn) 1) [
                                     guitext (concatword "^fa^f(textures/spec) " )] [
                                     guitext (concatword "^fa^f(textures/player) " )
                                 ]
                             ]
                             if (< -1 (strstr $mywarnlist (getclienthost $cn))) [ guitext "^fr^f(textures/warning)" ]
                             if (< -1 (strstr $mymutelist (getclienthost $cn))) [ guitext "^fr^f(textures/chat)" ]
                             if (< -1 (strstr $mykicklist (getclienthost $cn))) [ guitext "^fr^f(textures/wait)" ]
                             if (< -1 (strstr $mybanlist  (getclienthost $cn))) [ guitext "^fr^f(textures/dead)" ]
                             if (isadministrator $cn) [
                                 guitext "^fg^f(textures/rocket)"
                             ] [
                                 if (ismoderator $cn) [
                                     guitext "^fg^f(textures/shotgun)"
                                 ] [ if (ishelper $cn) [
                                         guitext "^fg^f(textures/pistol)"
                                    ]
                                 ]
                             ]
                         ]
                    ]
                ]
            ]
            guibar
            guilist [
                guitext "^faplayer name"
                guibar
                loop cn $serverclients [
                    if (> (strlen (getclientname $cn)) 0) [
                         if (= @cnsel @cn ) [
                             guitext    (concatword "^fy" (getclientname $cn) " ")  ] [
                             guibutton  (concatword "^fa" (getclientname $cn) " ")  [cnsel = @cn] ] [
                         ]
                    ]
                ]
            ]
            guibar
            if (> (strlen (getclientname $cnsel)) 0) [
                guilist [
                    guitext (concatword "^fy" (getclientname $cnsel))
                    guibar
                    // actions for everyone including yourself and bots:
                    guibutton "^fg deselect" [ cnsel = -1 ] "" "textures/exit"
                    guitext "change team: " "<mad:.5/.5/.5>textures/team"
                    guilist [
                        guibutton (concatword "^f[" $teamalphacolour "]^f(textures/teamalpha)  ") [setteam $cnsel alpha]
                        guibutton (concatword "^f[" $teamomegacolour "]^f(textures/teamomega)  ") [setteam $cnsel omega]
                        guibutton (concatword "^f[" $teamkappacolour "]^f(textures/teamkappa)  ") [setteam $cnsel kappa]
                        guibutton (concatword "^f[" $teamsigmacolour "]^f(textures/teamsigma)  ") [setteam $cnsel sigma]
                    ]
                    if (!= $cnsel (getclientnum)) [
                        // actions for everyone except yourself
                        if (< -1 (strstr (getclienthost $cnsel) "bot")) [
                            guibutton "^fgreset bots" [
                                mybotlimit = $botlimit
                                botlimit 0
                                sleep 100 [
                                    botlimit $mybotlimit
                                ]
                                // equivalent to Zeros resetbots, but still needs sleep :p
                            ]
                            guilist [
                                guilist [
                                    guifield botspeed       3
                                    guifield botskillmin    3
                                    guifield botskillmax    3
                                    guifield aipassive      3
                                    guifield aiforcegun     3
                                    guifield botlimit       3
                                    guifield botbalance     3
                                    guifield botoffset      3
                                ]
                                guilist [
                                    guitext "^fa speed    "
                                    guitext "^fa skillmin "
                                    guitext "^fa skillmax "
                                    guitext "^fa passive  "
                                    guitext "^fa fav. gun "
                                    guitext "^fa limit    "
                                    guitext "^fa balance  "
                                    guitext "^fa offset   "
                                ]
                            ]
                        ] [
                            // actions that do not work on bots
                            // put them here for testing anyways =)
                            guibutton "^fa force spectator" [
                                    spectator 1 $cnsel
                            ] "" "textures/spec"
                            guibutton "^fy end spectator" [
                                    spectator 0 $cnsel
                            ] "" "textures/player"
                            guibutton "^fy warn" [
                                saycommand "^fzyr^f(textures/warning) " (getclientname  $cnsel) "^fb("(getclienthost $cnsel)")^fw:"
                                mywarnlist = (concatword $mywarnlist (getclienthost $cnsel) " (name " (getclientname $cnsel) ")  ")
                            ] "" "textures/warning"
                            guibutton "^fy mute" [
                                mute $cnsel
                                mymutelist = (concatword $mymutelist (getclienthost $cnsel) " (name " (getclientname $cnsel) ")  ")
                            ] "" "textures/chat"
                            guibutton "^fm kick" [
                                kick $cnsel
                                mykicklist = (concatword $mykicklist (getclienthost $cnsel) " (name " (getclientname $cnsel) ")  ")
                            ] "" "textures/wait"
                            guibutton "^fr ban" [
                                ban $cnsel
                                mybanlist  = (concatword $mybanlist  (getclienthost $cnsel) " (name " (getclientname $cnsel) ")  ")
                            ] "" "<mad:.75/.75/.75>textures/dead"
                        ]
                    ] [
                        guitext "^fbthat is you"
                    ]
                ]
                guibar
            ]
        ]
        //guibar  // this tends to pop into another gui tab
    ]
]


vote mod
One more thing: If you miss the functionality to enforce a change of map, I suggest the following.

  • put a copy of <REinstall>/data/menus.cfg in your RE user data directory
  • search your copy of menus.cfg for these lines:
    {l Code}: {l Select All Code}
                            guibutton (? (isonline) "^fgsubmit vote" "^fgstart game") [
                                start $mapcur $modeselected $mutsselected
                            ]
  • insert these lines below:
    {l Code}: {l Select All Code}
                            if (ishelper (getclientnum)) [
                                guibutton " / ^fyenforce" [
                                    mastermode 1
                                    start $mapcur $modeselected $mutsselected
                                    sleep 3000
                                    mastermode 0
                                ]
                            ]
Last edited by bonifarz on 14 Oct 2012, 13:23, edited 2 times in total.
User avatar
bonifarz
 
Posts: 379
Joined: 09 Apr 2012, 12:16
Location: switzerland

Re: [gui] moderate

Postby ballist1c » 12 Oct 2012, 02:46

*bonifarz has won the game
Image Joseph "ballist1c" Calabria

Bloodlust // Abuse // Insidious // Longest Yard 2000
User avatar
ballist1c
 
Posts: 449
Joined: 24 Jul 2012, 02:32
Location: Connecticut (USA) [East Coast]

Re: [gui] moderate

Postby bonifarz » 13 Oct 2012, 14:31

At least I have not lost the game - anyways.

In case this is useful for any moderators or server admins out there, I made another update with a couple of new features and fixes.
Either way, it was very interesting to experiment with those cubescripts.
Also, I would like to thank Zero for this one: viewtopic.php?f=72&t=3482#p35647
User avatar
bonifarz
 
Posts: 379
Joined: 09 Apr 2012, 12:16
Location: switzerland

Re: [gui] moderate

Postby DrachenComputer » 14 Oct 2012, 22:55

Nice gui you can psot some more for Red Eclipse -Black Edition under the post :) thx for it :D
DrachenComputer is >DOOM< clan Officer. Visit >DOOM< clan here: http://www.redoomclan.tk
Visit DrachenComputer on facebook.
Image
User avatar
DrachenComputer
 
Posts: 98
Joined: 21 May 2012, 17:59
Location: Germany

Re: [gui] moderate

Postby fr00ty l00ps » 15 Oct 2012, 15:42

Whoa, I didn't realize that you were taking screenpics on the server that day xD

/me feels famous :D
User avatar
fr00ty l00ps
 
Posts: 7
Joined: 14 Sep 2012, 02:26
Location: Mars

Re: [gui] moderate

Postby ballist1c » 15 Oct 2012, 20:45

Oh, BTW bonifarz, we can still force a map change without the GUI ^^ but it's nice to have a big shiny menu for it all! :D
Image Joseph "ballist1c" Calabria

Bloodlust // Abuse // Insidious // Longest Yard 2000
User avatar
ballist1c
 
Posts: 449
Joined: 24 Jul 2012, 02:32
Location: Connecticut (USA) [East Coast]

Re: [gui] moderate

Postby bonifarz » 15 Oct 2012, 21:05

I find it most useful to do that with the regular map selection/ voting menu. Honestly, a new interface could not be any better than the one we already have in game.

And the reason i discarded the /map field in the moderate gui is that due to tab-autocompletion, using the command in the console is much more useful.
User avatar
bonifarz
 
Posts: 379
Joined: 09 Apr 2012, 12:16
Location: switzerland

Who is online

Users browsing this forum: No registered users and 1 guest

cron