Posts: 140
Threads: 9
Joined: Jun 2010
26 Feb 11, 05:07AM
(This post was last modified: 26 Feb 11, 05:13AM by SplatZ.)
Request
Gema Script
A script that when running in ctf while offline will count up from spawn to when a flag is scored. Also the script would save that time to the map. Maybe a menu to view the hi-scores for different maps?
edit: also if anyone has any gema maps that work with 1.1 please pm them to me! im dying for some new gema =)
Posts: 3,780
Threads: 33
Joined: Jun 2010
That part about saving the hi-scores into the map will be possible if/when the option to append to cfg files is granted by the devs.
Posts: 140
Threads: 9
Joined: Jun 2010
Couldn't you just save it to an alias? like:
Posts: 890
Threads: 16
Joined: Jun 2010
(26 Feb 11, 05:38AM)V-Man Wrote: That part about saving the hi-scores into the map will be possible if/when the option to append to cfg files is granted by the devs.
Why save them to the map's .cfg if you can just add them to your saved.cfg? Then your hi-scores are your hi-scores only. You can even save scores for each map and generate menus based on those scores if you like.
Posts: 865
Threads: 35
Joined: Dec 2010
(26 Feb 11, 06:00AM)Mael Wrote: (26 Feb 11, 05:38AM)V-Man Wrote: That part about saving the hi-scores into the map will be possible if/when the option to append to cfg files is granted by the devs.
Why save them to the map's .cfg if you can just add them to your saved.cfg? Then your hi-scores are your hi-scores only. You can even save scores for each map and generate menus based on those scores if you like.
If you can save the highscore to the maps cfg, you could keep a record of who has the best record on each map, which would make gemas more interesting/competitive
Posts: 140
Threads: 9
Joined: Jun 2010
(26 Feb 11, 06:10AM)Lantry Wrote: If you can save the highscore to the maps cfg, you could keep a record of who has the best record on each map, which would make gemas more interesting/competitive
How would that work? would you share a map file around with friends?
Posts: 865
Threads: 35
Joined: Dec 2010
26 Feb 11, 06:32AM
(This post was last modified: 26 Feb 11, 06:34AM by Lantry.)
no, it would save to the copy of the map contained on the server, so your highscores would only work with that server, though i bet you could hook something up with dropbox easily enough, to share scores across multiple servers.
BTW: yes, that link is a referral for you to join up so i can get more free space, I'm really shameless, aren't I? But really, you may as well use it if you are going to sign up.
Posts: 3,780
Threads: 33
Joined: Jun 2010
I'm sure someone could make a server mod that writes to map cfg files.
Posts: 140
Threads: 9
Joined: Jun 2010
26 Feb 11, 06:54AM
(This post was last modified: 26 Feb 11, 07:15AM by SplatZ.)
i havent made a script since 1.0.4 so imma try to make the gema one
CUBESCRIPT QUESTION:
what is the command to read from the console and its syntax?
edit: you answered my question with your post :D
Posts: 3,780
Threads: 33
Joined: Jun 2010
Be sure to look at the new tools available to you! :D
You'll probably be interested in "add2conloop", specifically.
(Thanks to PB clan for hosting tools.cfg in these troubled Akimbo times.)
Posts: 140
Threads: 9
Joined: Jun 2010
26 Feb 11, 07:23AM
(This post was last modified: 26 Feb 11, 07:55AM by SplatZ.)
is there cubescript to return the name of the map you are on?
almost done with the gema script. =)
edit:
ok i finished the script but, I cant get it to work. Here is my script:
//gema script by sblargish
add2conloop [if_conline_has "game mode is "CTF"[gema]]
alias gema
[
[gematime = 0]
[scored = 0]
[ctfnum = 5]
[if (= $gamemode $ctfnum)[if (= $connected 0) [scoresys][gematimer]]]
]
alias congrats
[
echo "Your score: $gematime"
]
alias gematimer
[
[echo "Gematimer Started"]
[while !scored [+= $gematime 1]]
[congrats]
]
alias scoresys
[ add2conloop [if_conline_has "you scored" [scored = 1] ] ]
I might've mixed some c in there where it didn't belong.
It doesn't work yet, later versions will follow (likely in the next few minutes) as I try to debug.
Edit: I tried a few things and can't figure out what I have done wrong. Halp?
Posts: 3,780
Threads: 33
Joined: Jun 2010
returns a string which you can compare with other strings.
echo (strcmp (curmap) ac_autopsy)
returns 1 (for me).
Posts: 3,462
Threads: 72
Joined: Jun 2010
add2conloop [if_conline_has "game mode is "CTF"[gema]]
= Fishy line.
Notice how your quotes are configured? That is majorly confusing the engine. You need to escape them (I think by a \, backslash before it). V-Man, take it from here.
Posts: 3,780
Threads: 33
Joined: Jun 2010
:/
quotes are the bane of CubeScript. Avoid when possible.
Posts: 140
Threads: 9
Joined: Jun 2010
26 Feb 11, 03:54PM
(This post was last modified: 26 Feb 11, 03:54PM by SplatZ.)
I think that the reason it glitched up is because It doesnt know a starting " from an ending one.
Posts: 1,331
Threads: 44
Joined: Jun 2010
There must be an ending quote if there was ever a starting one. Theres no way of "injecting" quotes into cubescript strings e.g. this:
say (concat '"' Hello world! '"')
...is currently not possible.
If you want to check if the current map has the word "gema" in it use:
if (strstr (curmap 1) gema) [do stuff if in gema] [do stuff if not in gema]
Posts: 205
Threads: 3
Joined: Jun 2010
you could share your records with the rest of the gema players, a script that recognises the best time and saves it, i think sendalias will do the trick, but if not, its possible to script something to do it.
im not a big fan of gemas anyway (maybe because i can't play it or dont have the patience xD).
Posts: 140
Threads: 9
Joined: Jun 2010
When I run it, the ac engine gets stuck at the while loop. What other ways are there to make a timer?
//gema script by sblargish
gemascore = 0
gemascored = 0
add2conloop [if_conline_has "you scored" [gemascored = 1]]
alias gemadd [
gemascore = (+ gemascore 1)]
alias scoresys [
echo "You Scored $gemascore on Map $arg1]
alias gematimer [
while [= gemascored 0] [gemadd]
scoresys $arg1]
alias gema [
ctf $arg1
gematimer $arg1]
Posts: 1,331
Threads: 44
Joined: Jun 2010
The default "while" in AC is pretty glitchy but you can try changing your code to:
while [(= $gemascored 0)] [gemadd]
...but since that'd cause alias "gemadd" to get executed in a recursive rage with no sleep at all, in combination with the glitchy while, your client will likely hang/crash.
I can take a look at it in a bit and see if there are other ways of doing what you're trying to do there.
Posts: 718
Threads: 23
Joined: Jun 2010
This script has been around before, but I can't find it anymore.
A script to get admin, get ip, screenshot, kick or ban, remove admin, then automatically receive the demo file at the end of the game.
Someone be my santa, please?
Posts: 3,780
Threads: 33
Joined: Jun 2010
26 Feb 11, 06:41PM
(This post was last modified: 26 Feb 11, 06:41PM by V-Man.)
// qban -- quickly ban a player when necessary -- by V-Man
// Requires grenadier's claimadmin script.
alias qban [
if (currole) [claimadmin] []
clientnum = $arg1
vote 2
whois $clientnum
sleep 500 [ ban $clientnum ]
sleep 750 [ screenshot ]
sleep 800 [ setadmin 0]
alias mapstartonce [getdemo]
]
Posts: 554
Threads: 45
Joined: Dec 2010
(26 Feb 11, 04:35PM)macm Wrote: you could share your records with the rest of the gema players, a script that recognises the best time and saves it, i think sendalias will do the trick, but if not, its possible to script something to do it.
im not a big fan of gemas anyway (maybe because i can't play it or dont have the patience xD).
The reason I don't play it is because I don't wanna waste my AR bullets/accuracy on such rubbish/filth
Posts: 1,331
Threads: 44
Joined: Jun 2010
26 Feb 11, 06:44PM
(This post was last modified: 26 Feb 11, 06:51PM by Bukz.)
This whole post should cover your needs Mai Mee Tur; the bottom half is the auto-admin tools which includes an "aban" command which does almost exactly what you speak (it lacks the auto-getdemo) but here is an updated version of the auto-admin tools that does have it.
There are some slight differences in the updated one:
You need to make 3 folders to install the script:
/screenshots/bans/
/screenshots/whois/
/demos/bans/
When you do a "aban" it does everything you said, the screenshot goes to the /screenshots/bans/ folder and on the start of the next round when it automatically gets the demo it will be written to /demos/bans/.
Do note that the auto-admin tools is assuming you have the takeadmin script installed; it's the first half of that post.
HTH
Edit: Oops, I pasted one that didn't have some important tools that the script requires, here is the real updated one xD
http://pastebin.com/NgCFWjgR
Posts: 3,780
Threads: 33
Joined: Jun 2010
26 Feb 11, 07:07PM
(This post was last modified: 26 Feb 11, 07:08PM by V-Man.)
Someone need a timer?
delalias swst
alias stopwatch [
if (strcmp $arg1 "start") [alias swst (millis)] [
if (strcmp $arg1 "time") [if (checkalias swst) [echo (- (millis) $swst)] [stopwatch isn't running!]] [
if (strcmp $arg1 "clear") [delalias swst] []]]]
Feel free to modify that to fit your needs. You can set it up with add2conloop to activate when you respawn, and store the time when you score a flag.
Posts: 718
Threads: 23
Joined: Jun 2010
(26 Feb 11, 06:41PM)V-Man Wrote: // qban -- quickly ban a player when necessary -- by V-Man
// Requires grenadier's claimadmin script.
alias qban [
if (currole) [claimadmin] []
clientnum = $arg1
vote 2
whois $clientnum
sleep 500 [ ban $clientnum ]
sleep 750 [ screenshot ]
sleep 800 [ setadmin 0]
alias mapstartonce [getdemo]
]
What would be the executing command?
Posts: 1,331
Threads: 44
Joined: Jun 2010
/qban cn
/qban 0 // bans client 0
Posts: 718
Threads: 23
Joined: Jun 2010
26 Feb 11, 07:23PM
(This post was last modified: 26 Feb 11, 07:23PM by Mai Mee Tur.)
I'm also assuming if I were to replace ban with kick inside of the script, it would do the kick function?
And I have an inability to find Grenadier's claim admin script.
Yes, i have searched the forums and Akimbo
Posts: 1,331
Threads: 44
Joined: Jun 2010
26 Feb 11, 07:28PM
(This post was last modified: 26 Feb 11, 07:29PM by Bukz.)
I don't have a copy of it otherwise I'd paste it, but you could just use my takeadmin script and change:
...to
They do they same exact thing but operate slightly differently.
Posts: 718
Threads: 23
Joined: Jun 2010
Doesn't yours need The New Tools?
Posts: 1,331
Threads: 44
Joined: Jun 2010
Yes indeed, is that an issue or?
|