The script requests/brainstorming thread!
#61
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 =)
Thanks given by:
#62
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.
Thanks given by:
#63
Couldn't you just save it to an alias? like:
map_#arg1 = $time
Thanks given by:
#64
(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.
Thanks given by:
#65
(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
Thanks given by:
#66
(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?
Thanks given by:
#67
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.
Thanks given by:
#68
I'm sure someone could make a server mod that writes to map cfg files.
Thanks given by:
#69
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
Thanks given by:
#70
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.)
Thanks given by:
#71
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?
Thanks given by:
#72
echo (curmap)
returns a string which you can compare with other strings.

echo (strcmp (curmap) ac_autopsy)
returns 1 (for me).
Thanks given by:
#73
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.
Thanks given by:
#74
:/
quotes are the bane of CubeScript. Avoid when possible.
Thanks given by:
#75
I think that the reason it glitched up is because It doesnt know a starting " from an ending one.
Thanks given by:
#76
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]
Thanks given by:
#77
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).
Thanks given by:
#78
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]
Thanks given by:
#79
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.
Thanks given by:
#80
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?
Thanks given by:
#81
// 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]
]
Thanks given by:
#82
(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
Thanks given by:
#83
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
Thanks given by:
#84
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.
Thanks given by:
#85
(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?
Thanks given by:
#86
/qban cn

/qban 0 // bans client 0
Thanks given by:
#87
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
Thanks given by:
#88
I don't have a copy of it otherwise I'd paste it, but you could just use my takeadmin script and change:

alias takeadmin [

...to

alias claimadmin [

They do they same exact thing but operate slightly differently.
Thanks given by:
#89
Doesn't yours need The New Tools?
Thanks given by:
#90
Yes indeed, is that an issue or?
Thanks given by: