Scripts
What? Is he still around?
Thanks given by:
Bukz, he can just look in the AC files and find the script + password T_T
Thanks given by:
@|BC|Wolf: Of course, but thats assuming that cheaters are intelligent enough to know that. /:D
Thanks given by:
emm is it possible to make (like the granade script) also for your primary and secondary weapon... like it counts how many shots hit the target and depending on number of hits you get the damage number? ^^

btw that granade one is awesome :D
Thanks given by:
@Milandrag

//type "/hitmsg = 0" to stop spam


bind MOUSE1 [
hits; attack; onrelease [sleep 100 [hits_]]
]

hitmsg = 1

alias hits [
if (= $hitmsg 0) [] [
if (= (curweapon) (currentprimary)) [
hit1 = (at (pstat_weap (findcn $curname)) (* (currentprimary) 2))
hit2 = (at (pstat_weap (findcn $curname)) (+ (* (currentprimary) 2) 1))
hitecho = 1
]]]

alias hits_ [
if (= $hitmsg 0) [] [
shotsf = (- (at (pstat_weap (findcn $curname)) (* (currentprimary) 2)) $hit1)
damagem = (- (at (pstat_weap (findcn $curname)) (+ (* (currentprimary) 2) 1)) $hit2)
if (&& (= $hitecho 1) (> $shotsf 0)) [
echo (concat " 1shots fired:" $shotsf " 0Damage made:" $damagem)
hitecho = 0
]]]
Thanks given by:
macm: Does that script take in account in situations when the foe has armor and the damage alters? What I mean is if this script just counts the number of shots registered on the enemy and multiplies that by the damage each bullet is supposed to make. If so, when the enemy possesses armor the damage would differ, ergo the damage computation would be inaccurate.
Thanks given by:
heh this is script is really awesome :) thank you
it just a have a bit glitch...
edit:
sometimes i hear the hit sound but script says 0 damage....
is it this script problem or the hit sound?


p.s. that thing i meantioned be4 is ok
Thanks given by:
I have a request for a script that may sound weird to you all, but I would really appreciate it if someone took their time to help.

I would like a script that when shooting you wouldn't hear the shooting sound. Only for the automatic weapons though (SMG and AR), so I would still want to be able to hear the shooting sounds of the sniper, carbine and shotgun.

I still want to hear the reloading and the changing weapons sounds and all, but I just don't want to hear my own shooting the moment I press MOUSE1 until I let go (I do want to hear other players shoot though). If possible I would also like to be able to turn it on/off through a command (e.g. /shootsound 1/0)

I think this may also be done through the sound.cfg (except for the command), but I'm not really sure.

Either by a script or by some instructions on how to take it off through the config, I would be very grateful if someone would help me here :)
Thanks given by:
"Mute specific sounds" menu?
Thanks given by:
I'm not sure how the "mute specific sounds" menu lists it ("your weapon shots" / "your AR shots") so if you can't mute just the AR and SMG you can always just rename/delete/move the audio files for AR and SMG (assault.wav and sub.wav, I believe) or even better, place a sound file that is silent in your mod folder for these files.
Thanks given by:
But is it possible to do it so I can here others shoot but not my own AR and SMG?
Thanks given by:
(02 Jul 11, 12:59AM)|BC|Wolf Wrote: But is it possible to do it so I can here others shoot but not my own AR and SMG?

Only when you are not shooting...

// some constants
ASSAULT_RIFLE  = 6
SUBMACHINE_GUN = 4
AR_SOUND       = 18
SMG_SOUND      = 14

// some aliases
check_for_mute = [
  if $muteshoot [
    if (= (curweapon) $ASSAULT_RIFLE) [
      mutesound $AR_SOUND 0
      onrelease [ mutesound $AR_SOUND 1 ] ] [
    if (= (curweapon) $SUBMACHINE_GUN) [
      mutesound $SMG_SOUND 0
      onrelease [ mutesound $SMG_SOUND 1 ] ] ] ] ]
muteshoot = 0
muteweapons = [
  if $muteshoot [
    echo (c 0) "unmuting weapons..."; muteshoot = 0 ] [
    echo (c 3) "muting weapons..."; muteshoot = 1 ] ]

// add the check_for_mute alias; modify if necessary
bind MOUSE1 [ attack; check_for_mute ]

Or maybe not...? I do not know.
Thanks given by:
It does mute enemy's shots as well when you press MOUSE1, but it's still pretty much what I wanted, I'll still use it. Thanks so much Yaru :D
Thanks given by:
I think this script (currently on the front page of Akimbo) can do what you're looking for, with some adjustments related to the sound number of your weapon.
Thanks given by:
Milandrag, sometimes it doesn't count damage because of lag, i've alredy added a delay of 100 miliseconds, you can add more delay if you want.
Just change the "sleep 100 [hits_]" to the number you wish.

|BC|Wolf, the script just retrieves stats from "pstat_weap" and calculates the diference value, this value is measured by hits from each weapon, example:
AR 4 hits = 96 damage
AR 5 hits = 120 damage (even if your oponent didnt have any armor at all, pstat_weap AR stat will add 120, and the script will register 20% damage more)

And i don't know how the vest damage is calculated.
Thanks given by:
I found this thread the other day: http://codegolf.stackexchange.com/questi...-ascii-art. And I thought, "Hmm, what if I implement this in CubeScript? Lol." I present, the cube script:
cube = [ n = $arg1 ; if ( != (
mod $n 2 ) ) [ += n 1 ] ; d = (
div $n 2);h = +;b = []; loop i (
* $n 2) [ h = ( concatword $h - )
b = (concatword $b [ ] ) ] ; h = (
concatword $h + ); l = $h; loop i (
+ $d 1) [ l = (concatword [ ] $l ) ]
say $l; loop i $d [ l = [] ; loop j (
+ ( * ( + $i ) ( + -1 ) ) $d ) [ l = (
concatword $l [ ]) ];l = ( concatword (
concatword $l / ) $b / ) ; loop j $i [
l = ( concatword $l [ ] ) ] ; ( say (
concatword $l |) ) ]; l = $h; s = []
loop i $d [ s = ( concatword $s [ ] )
]; say ( concatword $l $s |); loop i (
getalias d ) [ alias [l] ( concatword (
concatword | (getalias b ) ) | $s ); (
if ( = ( getalias i ) ( + $d -1 ) ) [
l = (concatword (getalias l) +) ][ (
alias l (concatword $l | ) ) ] ); (
say $l) ]; loop i ( getalias d ) [
alias l ( concatword | $b | ) ; (
loop j (- (+ (* $i -1) $d) 1 ) [
alias l (concatword $l [ ]) ] )
say (concatword $l /)];say $h]

Also, the original script was more readable with readable aliases, more efficient, and along with the indentations. But I decided to just share my icky version.

So, if you type /cube 2, you will get an output something like this:
|FOX|Yarukinasu:   +----+
|FOX|Yarukinasu:  /    /|
|FOX|Yarukinasu: +----+ |
|FOX|Yarukinasu: |    | +
|FOX|Yarukinasu: |    |/
|FOX|Yarukinasu: +----+

Similarly, if you type /cube 4, you will get an output something like this:
|FOX|Yarukinasu:    +--------+
|FOX|Yarukinasu:   /        /|
|FOX|Yarukinasu:  /        / |
|FOX|Yarukinasu: +--------+  |
|FOX|Yarukinasu: |        |  |
|FOX|Yarukinasu: |        |  +
|FOX|Yarukinasu: |        | /
|FOX|Yarukinasu: |        |/
|FOX|Yarukinasu: +--------+

Of course, you can change around and make it like those intermission ASCII art.

// off topic
Also, the output looks ugly in-game; how would I change the font of the console in AssaultCube? Say, I want Courier as my font...
Thanks given by:
Nice :D

(12 Jul 11, 06:32AM)Yarukinasu Wrote: Also, the output looks ugly in-game; how would I change the font of the console in AssaultCube? Say, I want Courier as my font...
You can't. Well, you can change the main font (most conveniently by using TTF2Font), but you can't have a separate font just for the console IIRC.
Thanks given by:
The akimbo site is out ...

Script who allow auto teamkilling,voting,nice shot...
this is a modification of script on akimbo .


bind "RIGHT" [alias spam 0]
bind "LEFT" [alias spam 1]
alias "mapstartalways" [sleep 1000 [tkchk]]

alias "tkchk" [  if (= $spam 0)[
        
            if (! (strcmp (at $conline 0) " 3you")) [] [
                if (strstr $conline "you fragged teammate ")  [say %Sorry: (at $conline 3) ]  []
               if (strstr $conline "you gibbed teammate ") [say %Sorry: (at $conline 3) ]    []
               if (strstr $conline "you splattered teammate ") [say %Sorry: (at $conline 3)] []
               if (strstr $conline "you slashed teammate ") [say %Sorry: (at $conline 3) ]   []
                if (strstr $conline "you headshot teammate ") [say %Sorry: (at $conline 3)]   []
                                                 ]

           if (strstr $conline "you were fragged by teammate ")    [say %I am in your team: (at $conline 5)]     []
       if (strstr $conline "you were gibbed by teammate ")     [say %I am in your team: (at $conline 5)]     []
       if (strstr $conline "you were slashed by teammate ")    [say %I am in your team: (at $conline 5)]     []
       if (strstr $conline "you were splattered by teammate ") [say %I am in your team: (at $conline 5)]     []
       if (strstr $conline "you were headshot by teammate ")   [say %I am in your team: (at $conline 5)]   [if (strstr $conline "you were headshot by")   [say Niceshot (at $conline 4)]                                              ]



       if (strstr $conline "you have the enemy flag")          [say %I have the flag]                        []  

           if (= $gamemode 13 ) [] [ if (strstr $conline "has the enemy flag") [say %Go get them: (at $conline 0)]     []]
                              

                                
                                                                                                                

       if (strstr $conline "scored for your team")        [say %Good job team]                      []
           if (strstr $conline "you scored")        [say %thank you the team]                      []
       if (strstr $conline "scored for the enemy team")   [say Congratulation: (at $conline 0)]            []
           if (strstr $conline "returned your flag")   [say %Good job: (at $conline 0)]            []
           if (strstr $conline  "insert your name," )   [ && (vote 2) [ echo "you voted no" ] ]            []
       if (strstr $conline "please do not spam")   [alias spam 1;echo ok ]            []

                            ] []



        sleep 1 [tkchk]
    
             ]

Mod edit: placed it within code tags like Viper said, without the asterisk.
Thanks given by:
Put it in the [code*](script)[/code] format please.

Also replace the your own name, and add an "insert your name here" or what not.
Thanks given by:
switching sniper pistol-shotgun
alias "switchpistol" [if (= (curweapon) 1)    [if (= $magpistol 1)[
                                           if (= (magcontent 1) 6)[attack;primary][];
                                                               if (= (magcontent 1) 4)[attack;primary][];
                                                               if (= (magcontent 1) 2)[attack;primary][];
                                           if (= (magcontent 1) 0)[attack;primary][]
                                  ][]
        
                                              ]                                    []
                     ]
alias "switchshotgun" [if (= (curweapon) 3)    [
                        if (= (magcontent 3) 6)[secondary;attack][];
                        if (= (magcontent 3) 5)[secondary;attack][];
                        if (= (magcontent 3) 4)[secondary;attack][];
                        if (= (magcontent 3) 3)[secondary;attack][];
                        if (= (magcontent 3) 2)[secondary;attack][];
                        if (= (magcontent 3) 1)[secondary;attack][];
                        if (= (magcontent 3) 0)[secondary;attack][]
                               ]                                    []
                   ]
alias "switch" [if (= (curweapon) 5)           [
                        if (= (magcontent 5) 4)[attack;secondary][];
                        if (= (magcontent 5) 3)[attack;secondary][];
                        if (= (magcontent 5) 2)[attack;secondary][];
                        if (= (magcontent 5) 1)[attack;secondary][];
                        if (= (magcontent 5) 0)[attack;secondary][]        
                           ]                                     []
                  ]

bind "RIGHT" [alias magpistol 0]
bind "LEFT" [alias magpistol 1]
bind "MOUSE1" [attack;switch;switchpistol;switchshotgun]

Enhanced script
Thanks given by:
Not since 1.1. It was a big thing to get that extra advantage in 104
Thanks given by:
I dunno if I've posted them before, but some of my previous scripts still work with 1.1, so if anyone might like to check these out, here they are:

/rolldie command to see who goes first in matches: you can specify two teams ( eg. /rolldie KINGS QUEENS) otherwise it will choose RVSF or CLA
//-- rolldie command to see who goes first in matches
//-- by R4zor with ( a lot of ) help from GenDisarray
teamchoice = [rnd 8]
alias rolldie [ if (&& (> (listlen $arg1) 0) (> (listlen $arg2) 0) ) [dieteams1 = $arg1; dieteams2 = $arg2] [dieteams1 = CLA; dieteams2 = RVSF]; if (<= (teamchoice) 3) [dieteams = $dieteams1] [dieteams = $dieteams2]; sleep 100 [say Random Die Roll - team $dieteams was chosen!]]

/find command - search for up to 3 arguments (eg. clans) online in servers. it opens one window, waits 7 seconds, then searches the next.
//-- find up to 3 players in servers automatically - by R4zor
finddelay = [if (> (listlen $arg1) 0) [alias findelay $arg1]]
findelay = 7
find = [updatefrommaster; if (> (listlen $arg2) 0) [tmpfind2 = $arg2; argfind2 = 1]; if (> (listlen $arg3) 0) [tmpfind3 = $arg3; argfind3 = 1]; searchnickname $arg1; if (= $argfind2 1) [sleep (* $findelay 1000) [searchnickname $tmpfind2; if (= $argfind3 1) [sleep (* $findelay 1000) [searchnickname $tmpfind3; clearfind]] [clearfind]]]]
clearfind = [tmpfind2 = 0; tmpfind3 = 0; argfind2 = 0; argfind3 = 0]
docsection [Custom]
docident [find] [find multiple strings online];
docargument [A] [first tag] [] [0];
docargument [B] [second tag (optional)] [] [0];
docargument [C] [third tag (optional)] [] [0];
docremark [use /finddelay x to specify number of seconds before next search];
Thanks given by:
Hello Guys,
I just wanted to ask some questions.
Actually, My problems are always about scripting in AC
I tried to put the script while im playing AC but it dint work!
So, my question is
where do i put those codes which were posted by u guys?
should I put them on one of the AC files [.cfg] or directly while playing the game..
its kinda tough to type in the codes while onlining Ac ^^.

THANK YOU FOR YOUR KIND HELPs ;D
Thanks given by:
In autoexec.cfg in config, if you're on Windows.
Thanks given by:
(16 Jul 11, 02:34PM)Orynge Wrote: In autoexec.cfg in config, if you're on Windows.
That applies for any OS, not just Windows.
Thanks given by:
Auto-ignore-all script with clan tag/nickname "whitelists":

http://pastebin.com/raw.php?i=psf7D3Mj

Also, the clan tags/nicknames that are already in the script are only there as an example - don't be offended if I left you/your clan out. :P
Thanks given by:
(16 Jul 11, 11:48PM)Bukz Wrote: Auto-ignore-all script with clan tag/nickname "whitelists"
Would be very nice to explain in clear words what use scripts submitted are designed for, not specially directed to you Bukzy but to everyone, I have just used this post to pinpoint the fact.
Not that I am a total noob in the matter but I guess that if sometimes I don't have a clue of what it's all about others may be in the same situation.

Thanks given by:
Basically it makes everyone except for those people/clans you specify in the script be auto-ignored. Meaning you won't hear any voicecoms or text chat from them on the HUD. To add people/clans to the "exclude" list - people just need to modify the "clanTagsToExclude" and "namesToExclude" variables (they are at the top of the script) - I understand it can be overwhelming/confusing for newcomers but there really isn't much we can do about it, other than walking them through it's usage.

CubeScript is ugly/weird/confusing by default. :P
Thanks given by:
This script allows to stop a burst of Assault rifle and switching to pistol.
The variable "sleep" can sometime be modify depending your computer .
bind "MOUSE1" [attack;pistol;switchrifle;if (= (magcontent 6) 20)[sleep 485 [attack]][]]

alias "switchrifle" [if (= (curweapon) 6)    [  
                        
                        if (= (magcontent 6) 15)[secondary][];
                        if (= (magcontent 6) 0)[secondary][]
                                
                        
                               ]                                    []
                   ]

alias "pistol" [if (= (curweapon) 1)    [
                        if (= (magcontent 1) 6)[primary][];
                        if (= (magcontent 1) 4)[primary][];
                        if (= (magcontent 1) 2)[primary][];
                        if (= (magcontent 1) 0)[primary][]
                        
                               ]                                    []
                   ]
Thanks given by:
Cheat
Thanks given by: