Posts: 1,033
Threads: 85
Joined: Oct 2013
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
Posts: 1,039
Threads: 77
Joined: Jun 2010
12 Mar 14, 07:47AM
(This post was last modified: 12 Mar 14, 08:11AM by RandumKiwi.)
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.
Posts: 1,438
Threads: 54
Joined: Jun 2010
Posts: 1,033
Threads: 85
Joined: Oct 2013
(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?
Posts: 1,438
Threads: 54
Joined: Jun 2010
The assaultcube:// address?
Posts: 1,033
Threads: 85
Joined: Oct 2013
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
Posts: 1,438
Threads: 54
Joined: Jun 2010
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.
Posts: 1,039
Threads: 77
Joined: Jun 2010
13 Mar 14, 09:57AM
(This post was last modified: 13 Mar 14, 09:59AM by RandumKiwi.)
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.
Posts: 1,033
Threads: 85
Joined: Oct 2013
Now I feel stupid. TIL hostname==URL.
Posts: 1,039
Threads: 77
Joined: Jun 2010
15 Mar 14, 09:25AM
(This post was last modified: 15 Mar 14, 09:27AM by RandumKiwi.)
(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.
Posts: 2,136
Threads: 50
Joined: Jun 2010
It might be worth clarifying,
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
Posts: 1,039
Threads: 77
Joined: Jun 2010
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
Posts: 1,033
Threads: 85
Joined: Oct 2013
Hm. That's a good idea. Can i cheat and use strpos to check for substrings?
Posts: 1,039
Threads: 77
Joined: Jun 2010
15 Mar 14, 10:06PM
(This post was last modified: 15 Mar 14, 10:09PM by RandumKiwi.)
(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
Posts: 1,039
Threads: 77
Joined: Jun 2010
15 Mar 14, 10:15PM
(This post was last modified: 15 Mar 14, 10:16PM by RandumKiwi.)
(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.
Posts: 1,033
Threads: 85
Joined: Oct 2013
15 Mar 14, 11:01PM
(This post was last modified: 15 Mar 14, 11:02PM by Mousikos.)
(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 ] ] ]
Posts: 1,039
Threads: 77
Joined: Jun 2010
(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
Posts: 1,033
Threads: 85
Joined: Oct 2013
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
Posts: 1,039
Threads: 77
Joined: Jun 2010
15 Mar 14, 11:37PM
(This post was last modified: 16 Mar 14, 12:09AM by RandumKiwi.)
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
Posts: 1,033
Threads: 85
Joined: Oct 2013
15 Mar 14, 11:43PM
(This post was last modified: 15 Mar 14, 11:44PM by Mousikos.)
(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
Posts: 1,039
Threads: 77
Joined: Jun 2010
16 Mar 14, 12:04AM
(This post was last modified: 16 Mar 14, 12:09AM by RandumKiwi.)
(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
Posts: 1,033
Threads: 85
Joined: Oct 2013
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?
Posts: 1,039
Threads: 77
Joined: Jun 2010
16 Mar 14, 01:15AM
(This post was last modified: 16 Mar 14, 01:20AM by RandumKiwi.)
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)))
Posts: 1,033
Threads: 85
Joined: Oct 2013
16 Mar 14, 01:34AM
(This post was last modified: 16 Mar 14, 05:20AM by Mousikos.)
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]
Posts: 1,033
Threads: 85
Joined: Oct 2013
Posts: 1,033
Threads: 85
Joined: Oct 2013
|