Admin Button/Nick Menu
#1
Hey there used to be some scripts that would let you click a button to claim admin instead of having a list of aliases for each server. I'm getting to the point where it's becoming tedious to remember all the aliases and it would be really nice to be able to just type something like "su" and it'd automatically give me the credentials if I have it or just laugh in my face if I don't. If it has stuff like "alias pban [sudo; ban CN; desudo]" or something that would be great too. If someone could help me figure out how to detect what server you're currently on, I could also try my hand at writing this.

As far as nick menu, is there any randomizer out there? I have a lot of nicks. I'd rather just stick 'em all into an array and choose at random every game. =3
Thanks given by:
#2
For the first question you posted, read the second script in this thread (the first script's a bonus if you want it): http://ac-akimbo.net/showthread.php?tid=1084

If you know even /a little/ bit about scripting, it should be extremely easy to modify that script to have all your servers 'setadmin' under the one single command.

For your second question, read the third script posted in that thread.

For your third question, I can't be bothered scripting you an answer.
Thanks given by:
#3
Random Alias Scipt?
Back when I was super nooby:
http://forum.cubers.net/thread-38-post-3...ml#pid3910
Thanks given by:
#4
(12 Mar 14, 07:47AM)RandumKiwi Wrote: For the first question you posted, read the second script in this thread (the first script's a bonus if you want it): http://ac-akimbo.net/showthread.php?tid=1084

If you know even /a little/ bit about scripting, it should be extremely easy to modify that script to have all your servers 'setadmin' under the one single command.

For your second question, read the third script posted in that thread.

For your third question, I can't be bothered scripting you an answer.

Is there a command to follow through on a URL to get an IP address?
Thanks given by:
#5
The assaultcube:// address?
Thanks given by:
#6
No like instead of

SERVER_IP SERVER_PORT

I can have SERVER_URI SERVER_PORT that will follow through to become SERVER_IP SERVER_PORT
Thanks given by:
#7
I don't think I get it properly. You can assign IPs as alias' but thats redundant since you can connect via alias.

If you wanted a direct IP of a server instead of the URL you could just do a rDNS lookup.

I don't think yhats what you want though.
Thanks given by:
#8
Mous, I've gone and bug-tested the scripts. All three were apparently broken, but are now fully tested and working:

http://ac-akimbo.net/showthread.php?tid=...76#pid2876


(12 Mar 14, 01:37PM)Mousikos Wrote: Is there a command to follow through on a URL to get an IP address?

No like instead of

SERVER_IP SERVER_PORT

I can have SERVER_URI SERVER_PORT that will follow through to become SERVER_IP SERVER_PORT

Mous, read the updated script in that link I've just posted - it tells you how to set up these scripts to use a hostname instead of IP address.
Thanks given by:
#9
Now I feel stupid. TIL hostname==URL.
Thanks given by:
#10
(14 Mar 14, 07:02PM)Mousikos Wrote: Now I feel stupid. TIL hostname==URL.

Actually, hostname = hostname. URI/URL = URI/URL.

E.g, a hostname: forum.cubers.net
E.g, a URL: http://forum.cubers.net/thread-7543-post-148281.html


EDIT: Yes, there's a difference between URI and URL, but nobody gives a crap. They're basically the same.

FYI: Mous, you can't specify a URL for an AssaultCube server.
Thanks given by:
#11
It might be worth clarifying,
/echo (curserver 2)
does a reverse DNS lookup on the current server's IP. This might not always give the hostname you desire, depending on rDNS setup. For example, I can
/connect ac.pwnz.org 2600
but (curserver 2) gives me:
cust-108-166-174-213.corexchange.com
Thanks given by:
#12
Yep (and, there's no other way to do this unfortunately). Btw, DNS lookups lag.

Assuming you can understand my script, you could make the script match against the server description, rather than the DNS or IP, read the following: http://assault.cubers.net/docs/reference..._curserver
Thanks given by:
#13
Hm. That's a good idea. Can i cheat and use strpos to check for substrings?
Thanks given by:
#14
(15 Mar 14, 09:57PM)Mousikos Wrote: Hm. That's a good idea. Can i cheat and use strpos to check for substrings?

I don't understand how that would help: http://assault.cubers.net/docs/reference...ier_strpos


How about you use 'strstr' instead: http://assault.cubers.net/docs/reference...ier_strstr
Thanks given by:
#15
(15 Mar 14, 10:59AM)RandumKiwi Wrote: Yep (and, there's no other way to do this unfortunately). Btw, DNS lookups lag.

Assuming you can understand my script, you could make the script match against the server description, rather than the DNS or IP, read the following: http://assault.cubers.net/docs/reference..._curserver

Actually, I just went to go test things, none of these work:
/echo (curserver 5)
/echo (curserver 6)
/echo (curserver 7)
/echo (curserver 8)


Oh well, too bad.
Thanks given by:
#16
(15 Mar 14, 10:15PM)RandumKiwi Wrote:
(15 Mar 14, 10:59AM)RandumKiwi Wrote: Yep (and, there's no other way to do this unfortunately). Btw, DNS lookups lag.

Assuming you can understand my script, you could make the script match against the server description, rather than the DNS or IP, read the following: http://assault.cubers.net/docs/reference..._curserver

Actually, I just went to go test things, none of these work:
/echo (curserver 5)
/echo (curserver 6)
/echo (curserver 7)
/echo (curserver 8)


Oh well, too bad.

/echo (curserver 6) actually works for me but my script still ain't working

sudoparam = ["Mousikos" "gibbed.me"]
sudopass = ["MousikosPass" "gibbedPass"]
sudocnt = (listlen $sudoparam)
sudo = [loop i $sudocnt [ if (!= (strpos (curserver 6) (at $sudoparam $i)) -1) [setadmin 1      (at $sudopass $i); break  ] ] ]
Thanks given by:
#17
(15 Mar 14, 11:01PM)Mousikos Wrote: /echo (curserver 6) actually works for me but my script still ain't working


(15 Mar 14, 10:06PM)RandumKiwi Wrote:
(15 Mar 14, 09:57PM)Mousikos Wrote: Hm. That's a good idea. Can i cheat and use strpos to check for substrings?

I don't understand how that would help: http://assault.cubers.net/docs/reference...ier_strpos


How about you use 'strstr' instead: http://assault.cubers.net/docs/reference...ier_strstr
Thanks given by:
#18
My script suddenly works and I didn't even change it to strstr. Maybe it's just broken on a server... BRB more testing.

strpos would work too (although strstr saves memory i think) because if it doesn't exist it's -1. So just check for -1 XD
Thanks given by:
#19
SERVERSTRINGS = [ STRING1 STRING2 ]
SERVERPASSES = [ ADMINPASS1 ADMINPASS2 ]

sudo = [ if (= (currole) 0) [ loop i (listlen $SERVERSTRINGS) [ if (strstr (curserver 6) (at $SERVERSTRINGS $i)) [ setadmin 1 (at $SERVERPASSES $i); break ] ] ] [ setadmin 0 ] ]

* Note, that all ports on the same IP, must use the same password!
* Note, that each IP in the list, must be in the same order as each password in the list.


For those that like this take-admin script better, it's been updated in the list: http://ac-akimbo.net/showthread.php?tid=...76#pid2876
Thanks given by:
#20
(15 Mar 14, 11:37PM)RandumKiwi Wrote:
Quote:SERVERTITLES = [ gibbed.me Mousikos ]
SERVERPASSES = [ PASS1 PASS2 ]
sudo = [ loop i (listlen $SERVERTITLES) [ if (strstr (curserver 6) (at $SERVERTITLES $i)) [ setadmin 1 (at $SERVERPASSES $i); break ] [ setadmin 0 ] ] ]


You realise, the problem with this script, is that it doesn't do a per-port comparison - so if different ported servers, with different passwords, exist on the same named servername, this won't work.

Yes. However, |AoX| has a billion servers with different IPs and ports so I wrote it this way to prevent having a huge list of servers and ports
Thanks given by:
#21
(15 Mar 14, 11:25PM)Mousikos Wrote: My script suddenly works and I didn't even change it to strstr. Maybe it's just broken on a server... BRB more testing.

strpos would work too (although strstr saves memory i think) because if it doesn't exist it's -1. So just check for -1 XD

"Returns the position of a substring into another"

How would strpos help? Use this instead:

(15 Mar 14, 11:37PM)RandumKiwi Wrote:
SERVERSTRINGS = [ STRING1 STRING2 ]
SERVERPASSES = [ ADMINPASS1 ADMINPASS2 ]

sudo = [ if (= (currole) 0) [ loop i (listlen $SERVERSTRINGS) [ if (strstr (curserver 6) (at $SERVERSTRINGS $i)) [ setadmin 1 (at $SERVERPASSES $i); break ] ] ] [ setadmin 0 ] ]

* Note, that all ports on the same IP, must use the same password!
* Note, that each IP in the list, must be in the same order as each password in the list.


For those that like this take-admin script better, it's been updated in the list: http://ac-akimbo.net/showthread.php?tid=...76#pid2876
Thanks given by:
#22
No, I fixed it with strstr. But it's the same thing. With strstr, you get 0 or 1. With strpos, you get -1 or not -1. It's essentially the same thing, but not as clean. Also is there anyway to make my nick change script not happen on mapstartalways but on loading the game?
Thanks given by:
#23
Idk what your name script looks like, but here's one I just created.

Put it in autoexec.cfg, then AC will execute it (i.e. pick a random name), upon every game start.

RANDOMNAMES="Name1 Name2 Name3"
name (at $RANDOMNAMES (rnd (listlen $RANDOMNAMES)))
Thanks given by:
#24
Now it looks like this:
randnick = [name (at $nicklist (rnd (listlen $nicklist)))]
bind BACKSPACE randnick

it used to look like this
randnick = [name (at $nicklist (rnd (listlen $nicklist)))]
mapstartalways = [fog 1024;randnick]

god that was annoying...

Now I'm trying to figure out why the script I modeled after yours doesn't work
suban = [ useCN = $arg1; useMSG = $arg2; sleep 0 [(suclaim)]; sleep 0[[ban $useCN $useMSG]];     desu]
Thanks given by:
#25
*bump*
Thanks given by:
#26
If anyone is wondering how it turned out:

http://ac-akimbo.net/showthread.php?tid=1230
http://ac-akimbo.net/showthread.php?tid=1231
Thanks given by: