Takeadmin on steroids:
The new "takeadmin" command will automatically claim admin status on the current server if a password is found for it in your admin passwords list. You can bind this to a key for a quick "on/off admin" key. To do that use something along the lines of:
...where "KEY" is the name of the key you want to bind. If you don't have admin status when executing this command (or pressing the bind) it will auto-claim admin status, if you already have admin status it will drop it.
The "on steroids" bit comes into play with the new admin passwords list managing commands that allow you to delete from, update, or add to the list "on-the-fly". Here's a list of the new in-game commands that can be used:
Since entries won't be added if they already exist in your list, "add2adminlist" can be used multiple times in your "autoexec.cfg" to ensure that certain entries are ALWAYS in your admin passwords list. e.g.:
Would always keep those 3 entries in your admin passwords list (unless you used delfromadminlist, in which case that password would become unavailable for the current session, but will come back upon restarting AC unless you remove it from your configuration entirely).
Many thanks to grenadier's original "claimadmin" script which powers much of the script. :)
NOTE: I have not taken the time to write up proper error handling or anything like that, what little bit there is in the script is minimal and is only checking for a proper number of arguments, if you give any of the script's commands invalid arguments, the results may be quite unexpected. Try to verify that you're giving the commands proper arguments before pressing enter. ;)
And some auto-admin scripts to go along with it... ;)
You'll want to make a "bans" and a "whois" folder within your existing "screenshots" folder before using "aban" or "awhois".
Commands here are:
Enjoy! :)
[SELECT ALL] Code:
// takeadmin.cfg by DES|Bukz - Claim admin status on multiple servers with different passwords with a single
// command that requires no arguments. Bind to a key for a quick admin/non-admin toggle key. Can be used within
// other cubescripts to make the automation of server processes possible/easy. Comes with built-in commands for
// managing your admin passwords list "on-the-fly". Many thanks to grenadier's "claimadmin" which powers much of
// this script.
// Requires tools.cfg: http://forum.cubers.net/thread-1776.html
if (checkalias admin_list) [] [admin_list = []]
alias takeadmin [
if (&& $connected (= (currole) 0)) [
if (> (listlen $admin_list) 0) [
alias app (findlist $admin_list (curserver 1))
if (!= $app -1) [
echo (c 0)Claiming admin for server (c 2) (getalias (format "%1_d" (at $admin_list $app))) (c 0) using password (c 2) (at $admin_list (+ $app 1))
setadmin 1 (at $admin_list (+ $app 1))
] [
alias app (findlist $admin_list (concatword (curserver 1) : (curserver 3)))
if (!= $app -1) [
echo (c 0)Claiming admin for server (c 2) (getalias (format "%1_d" (at $admin_list $app))) (c 0) using password (c 2) (at $admin_list (+ $app 1))
setadmin 1 (at $admin_list (+ $app 1))
] [
alias tmp_hostname (curserver 2)
alias app (findlist $admin_list $tmp_hostname)
if (!= $app -1) [
echo (c 0)Claiming admin for server (c 2) (getalias (format "%1_d" (at $admin_list $app))) (c 0) using password (c 2) (at $admin_list (+ $app 1))
setadmin 1 (at $admin_list (+ $app 1))
] [
alias app (findlist $admin_list (concatword $tmp_hostname : (curserver 3)))
if (!= $app -1) [
echo (c 0)Claiming admin for server (c 2) (getalias (format "%1_d" (at $admin_list $app))) (c 0) using password (c 2) (at $admin_list (+ $app 1))
setadmin 1 (at $admin_list (+ $app 1))
] [
echo (c 3)Cannot find an admin password for this server in your configuration!
]
]
]
]
] [
echo (c 3)Your admin passwords list is empty!
]
] [setadmin 0]
]
// Adds entries to your admin passwords list.
alias add2adminlist [
if (< $numargs 3) [
echo (c 3)add2adminlist requires 3 arguments, one for the IP, one for the password, and the last for the description.
] [
if (strstr $admin_list (concat $arg1 $arg2)) [] [
add2list admin_list (concat $arg1 $arg2)
alias (format "%1_d" $arg1) $arg3
echo (c 0)Added (c 2)server (c 5) (concatword $arg3 :) (c 2)IP: (c 5) $arg1 (c 2)Password: (c 5) $arg2 (c 2)to your admin passwords list.
]
]
]
// Clears the entire contents of your admin passwords list.
alias clearadminlist [
if (= $arg1 1) [
alias admin_list []
echo (c 2)Your admin passwords list has been cleared!
] []
]
// Clears an entry from your admin passwords list.
alias delfromadminlist [
if (< $numargs 1) [
echo (c 3)delfromadminlist requires 1 argument, the IP of the server to delete.
] [
alias delipcounter 0
alias delpwcounter 1
tmp_admin_list = []
loop deladminloop (div (listlen $admin_list) 2) [
if (strcmp (at $admin_list $delipcounter) $arg1) [echo (c 3)Removed (c 2)server (c 5) (concatword (getalias (format "%1_d" $arg1)) :) (c 2)IP: (c 5) $arg1 (c 2)Password: (c 5) (at $admin_list (+ $delipcounter 1)) (c 2)from your admin passwords list.] [
tmp_admin_list = (concat $tmp_admin_list (at $admin_list $delipcounter) (at $admin_list $delpwcounter))
]
+= delipcounter 2
+= delpwcounter 2
]
admin_list = $tmp_admin_list
]
]
// Updates the password for an entry in your admin passwords list.
alias updateadminlist [
if (< $numargs 2) [
echo (c 3)updateadminlist requires 2 arguments, one for the IP of the server to update, the last for the new password.
] [
alias ipcounter 0
loop upadminloop (div (listlen $admin_list) 2) [
if (strcmp $arg1 (at $admin_list $ipcounter)) [
delfromadminlist $arg1
add2adminlist $arg1 $arg2 (getalias (format "%1_d" $arg1))
echo (c 1)Updated (c 2)server (c 5) (concatword (getalias (format "%1_d" $arg1)) :) (c 2)IP: (c 5) $arg1 (c 2)with the new password: (c 5) $arg2
] []
+= ipcounter 2
]
]
]
// Shows the contents of your admin passwords list.
alias showadminlist [
alias ipcounter 0
alias pwcounter 1
loop showadminloop (div (listlen $admin_list) 2) [
if (checkalias (format "%1_d" (at $admin_list $ipcounter))) [
echo (c 2)Description: (c 5) (getalias (format "%1_d" (at $admin_list $ipcounter))) (c 2)IP: (c 5) (at $admin_list $ipcounter) (c 2)Password: (c 5) (at $admin_list $pwcounter)
] [
echo (c 2)IP: (c 5) (at $admin_list $ipcounter) (c 2)Password: (c 5) (at $admin_list $pwcounter)
]
+= ipcounter 2
+= pwcounter 2
]
]
docsection [Take Admin];
docident [takeadmin] [Automatically claims admin status on predefined servers.];
docremark [Drops admin status if executed while having admin status.];
docident [add2adminlist];
docargument [I] [The IP or hostname of the server.];
docargument [P] [The admin password to use.];
docargument [D] [The description of the server.];
docexample [/add2adminlist 127.0.0.1 temporarypassword "My servers"] [Result: Attempts to claim admin with password "temporarypassword" on any server running from IP "127.0.0.1" when executing /takeadmin];
docexample [/add2adminlist 127.0.0.1:1337 temporarypassword "My LAN server"] [Result: Attempts to claim admin with password "temporarypassword" on the server running from port "1337" on IP "127.0.0.1" when executing /takeadmin.];
docremark [Specific ports can be specified in the first argument to support multiple servers on the same IP with different passwords.];
docident [clearadminlist] [Clears the contents of your admin passwords list.];
docargument [X] [Must be 1 to function.];
docexample [/clearadminlist 1] [Clears the list.];
docident [delfromadminlist] [Clears an entry from your admin passwords list.];
docargument [I] [The IP of the server you wish to delete the entry for.];
docexample [/delfromadminlist 127.0.0.1:1337] [Clears server 127.0.0.1:1337 and it's password from your admin password list.];
docident [updateadminlist] [Updates a password for an entry in your admin passwords list.];
docargument [I] [The IP of the server you wish to update the password for.];
docargument [N] [The new password.];
docexample [/updateadminlist 127.0.0.1 newpass] [Updates servers 127.0.0.1 password to "newpass" in your admin passwords list.];
docident [showadminlist] [Shows your admin passwords list.];
The new "takeadmin" command will automatically claim admin status on the current server if a password is found for it in your admin passwords list. You can bind this to a key for a quick "on/off admin" key. To do that use something along the lines of:
[SELECT ALL] Code:
bind KEY [takeadmin]
The "on steroids" bit comes into play with the new admin passwords list managing commands that allow you to delete from, update, or add to the list "on-the-fly". Here's a list of the new in-game commands that can be used:
[SELECT ALL] Code:
/takeadmin - Automatically claim admin on the current server if the password is found in your list.
/add2adminlist - Add a server to your admin passwords list.
/clearadminlist - Clears the entire contents of your admin passwords list.
/delfromadminlist - Clears the given server's entry from your admin passwords list.
/updateadminlist - Changes the password for the given server's entry in your admin passwords list.
/showadminlist - Displays the entire contents of your admin passwords list.
Since entries won't be added if they already exist in your list, "add2adminlist" can be used multiple times in your "autoexec.cfg" to ensure that certain entries are ALWAYS in your admin passwords list. e.g.:
[SELECT ALL] Code:
add2adminlist 127.0.0.1:1337 test_password_1 "My LAN Server #1"
add2adminlist 127.0.0.1:1338 test_password_2 "My LAN Server #2"
add2adminlist 255.255.255.255 test_password_3 "Some weird server"
Would always keep those 3 entries in your admin passwords list (unless you used delfromadminlist, in which case that password would become unavailable for the current session, but will come back upon restarting AC unless you remove it from your configuration entirely).
Many thanks to grenadier's original "claimadmin" script which powers much of the script. :)
NOTE: I have not taken the time to write up proper error handling or anything like that, what little bit there is in the script is minimal and is only checking for a proper number of arguments, if you give any of the script's commands invalid arguments, the results may be quite unexpected. Try to verify that you're giving the commands proper arguments before pressing enter. ;)
And some auto-admin scripts to go along with it... ;)
[SELECT ALL] Code:
// auto_admin.cfg by DES|Bukz
alias get_screenshot_type [
if (= $screenshottype 0) [alias screenshotextension ".bmp"] [
if (= $screenshottype 1) [alias screenshotextension ".jpg"] [
alias screenshotextension ".png"
]
]
result $screenshotextension
]
alias banscreenshot [
screenshot (concatword screenshots\bans\ "banshot_" (at (timestamp) 0) (at (timestamp) 1) (at (timestamp) 2) _ (at (timestamp) 3) . (at (timestamp) 4) . (at (timestamp) 5) _ (curmap 1) (get_screenshot_type))
]
alias whoscreenshot [
screenshot (concatword screenshots\whois\ "whoshot_" (at (timestamp) 0) (at (timestamp) 1) (at (timestamp) 2) _ (at (timestamp) 3) . (at (timestamp) 4) . (at (timestamp) 5) _ (curmap 1) (get_screenshot_type))
]
if (checkalias autodrop) [] [alias autodrop 0]
// Uncomment the line below to automatically drop admin status after using auto-admin commands.
// autodrop = 1
alias aban [
if (= (currole) 0) [
takeadmin
sleep 300 [whois $arg1]
sleep 600 [toggleconsole]
sleep 900 [ban $arg1 admin]
sleep 1200 [banscreenshot]
sleep 1500 [
toggleconsole
if $autodrop [setadmin 0] []
]
] [
whois $arg1
sleep 300 [toggleconsole]
sleep 600 [ban $arg1 admin]
sleep 900 [banscreenshot]
sleep 1200 [
toggleconsole
if $autodrop [setadmin 0] []
]
]
]
alias akick [
if (= (currole) 0) [
takeadmin
sleep 300 [whois $arg1]
sleep 600 [kick $arg1 admin]
sleep 900 [if $autodrop [setadmin 0] []]
] [
whois $arg1
sleep 300 [kick $arg1 admin]
sleep 600 [if $autodrop [setadmin 0] []]
]
]
alias aforce [
if (= (currole) 0) [
takeadmin
sleep 300 [forceteam $arg1]
sleep 600 [if $autodrop [setadmin 0] []]
] [
forceteam $arg1
sleep 300 [if $autodrop [setadmin 0] []]
]
]
alias awhois [
if (= (currole) 0) [
takeadmin
sleep 300 [toggleconsole]
sleep 600 [whois $arg1]
sleep 900 [whoscreenshot]
sleep 1200 [
toggleconsole
if $autodrop [setadmin 0] []
]
] [
toggleconsole
sleep 300 [whois $arg1]
sleep 600 [whoscreenshot]
sleep 900 [
toggleconsole
if $autodrop [setadmin 0] []
]
]
]
alias adeny [
if (= (currole) 0) [
takeadmin
sleep 300 [vote 2]
sleep 600 [if $autodrop [setadmin 0] []]
] [
vote 2
sleep 300 [if $autodrop [setadmin 0] []]
]
]
alias aaccept [
if (= (currole) 0) [
takeadmin
sleep 300 [vote 1]
sleep 600 [if $autodrop [setadmin 0] []]
] [
vote 1
sleep 300 [if $autodrop [setadmin 0] []]
]
]
docsection [Auto Admin];
docident [aban] [Automatically whois, ban, and screenshot a specified client.];
docargument [C] [A valid client number.];
docremark [Uses takeadmin to auto-claim admin status to ensure the forced completion of the command, and outputs custom named screenshots to /screenshots/bans/];
docident [akick] [Automatically whois and kick a specified client.];
docargument [C] [A valid client number.];
docremark [Uses takeadmin to auto-claim admin status to ensure the forced completion of the command.];
docident [aforce] [Automatically force a specified client to the other team.];
docargument [C] [A valid client number.];
docremark [Uses takeadmin to auto-claim admin status to ensure the forced completion of the command.];
docident [awhois] [Automatically whois and screenshot a specified client.];
docargument [C] [A valid client number.];
docremark [Uses takeadmin to auto-claim admin status to ensure the forced completion of the command, and outputs custom named screenshots to /screenshots/whois/];
docident [adeny] [Automatically force any pending vote to fail.];
docremark [Uses takeadmin to auto-claim admin status to ensure the forced completion of the command.];
docident [aaccept] [Automatically force any pending vote to pass.];
docremark [Uses takeadmin to auto-claim admin status to ensure the forced completion of the command.];
docident [autodrop] [If set to 1, automatically drops admin status after using an auto-admin command.];
docexample [/autodrop = 1] [Enables automatic admin-drop.];
docexample [/autodrop = 0] [Disables automatic admin-drop.];
You'll want to make a "bans" and a "whois" folder within your existing "screenshots" folder before using "aban" or "awhois".
Commands here are:
[SELECT ALL] Code:
/aban - forced ban of a specified client, full IP whois + screenshot.
/akick - forced kick of a specified client, full IP whois.
/aforce - forced forceteam of a specified client.
/awhois - forced full IP whois of a specified client.
/adeny - forced pending vote fail.
/aaccept - forced pending vote pass.
/autodrop = 0 - no auto-drop admin after using an auto-admin command
/autodrop = 1 - auto-drop admin after using an auto-admin command
Enjoy! :)