Scripts
Most operators in cubescript only take two arguments. So, parenthesize everything. Example:

//1 AND 2 AND 3, equivalent to 1 && 2 && 3
(&& (&& 1 2) 3)
Thanks given by:
Thank You, now it works ^^
Thanks given by:
Love the nade timer

execpt it doesn't work for me...
Thanks given by:
It's the same for me. When I try to launch the game with the script, I get an AssaultCube fatal error.
Thanks given by:
For the nade timer? o_O
Do you have tools.cfg installed?
Thanks given by:
Properly installed.
CrossHair Anim works fine.
Thanks given by:
Yeah, V-man, something is definitely funny with that script. It took me an hour or two of messing around with it to get it working properly.
Anyway:
Update (should be last one) for multiXhair:
//Multiple Crosshair Script by Lantry
//please enter your crosshair choices in the lines below

alias arxhair [default.png]         //Assault Rifle cursor goes here (6)
alias smgxhair [default.png]         //SMG cursor goes here (4)
alias shotgunxhair [default.png]     //Shotgun cursor goes here (3)
alias riflexhair [default.png]         //Carbine cursor goes here (2)
alias knifexhair [default.png]             //knife cursor goes here (0)
alias nadexhair [default.png]             //grenade cursor goes here (8)
alias pistolxhair [default.png]     // pistol cursor goes here (1)
alias akimboxhair [default.png]     //akimbo cursor goes here (9)

add2conloop [
if (= (curweapon) 6) [ loadcrosshair $arxhair ]
if (= (curweapon) 4) [ loadcrosshair $smgxhair ]
if (= (curweapon) 3) [ loadcrosshair $shotgunxhair ]
if (= (curweapon) 2) [ loadcrosshair $riflexhair ]
if (= (curweapon) 1) [ loadcrosshair $pistolxhair ]
if (= (curweapon) 0) [ loadcrosshair $knifexhair ]
if (= (curweapon) 8) [ loadcrosshair $nadexhair ]
if (= (curweapon) 9) [ loadcrosshair $akimboxhair ]
]
I fixed the problem it had by adding it to conloop. It works like a charm! Just make sure to put your choice of crosshair in the script.

New script:
I'm really surprised no one has thought of this yet, It is really helpful. It was requested some time ago, but once again, I am the only person who actually knows how to cubescript around here, so i have to do everything!
//YAIYAIYAIYAIYAIYAI by Lantry
//no need to thank me, noobs are their own reward

add2bind MOUSE1 [ YAIYAIYAI ]
ammo = (magcontent 4)
alias YAI 0
alias YAIYAI 0
alias YAIYAIYAI [
    if (= (curweapon) 4) [+= YAI 1] []
    onrelease [
        if (= $YAI 1) [-= YAI 1] []
        (-= YAIYAI $YAIYAI)
    ]
]
add2conloop [
    if (&& (= $YAI 1) (< 9 $YAIYAI))[say "YAIYAIYAI"]
    if (&& (= $YAI 1) (< $YAIYAI 10)) [+= YAIYAI 1] []
]
This little beaut is a must have for any good smg noob. It allows you to spray and pray in true noob style. Gone are the days when you had to spray & pray, and then scream YAIYAIYAI. This script will do it all for you, allowing you to pay more attention to your praying, which is at least the second most important part.
If anyone complains about 'spam' or stupid stuff like that, just change [say "YAIYAIYAI"] to [echo "YAIYAIYAI"], and just pretend you are screaming at the top of your lungs.

Stay classy, AC.
Thanks given by:
Fatal error though??
augh.
Linux ftl?
* V-Man dodges rotten tomatoes
Thanks given by:
If you ask V-Man, we made a YAIYAIYAI script a loooonggg time ago.
Thanks given by:
Lantry, what changes did you make to the nade timer script that made it stable for you? Perhaps the changes will benefit others.
Thanks given by:
i would post the code, but i got rid of it cause it conflicted with my multixhair. I will try to remember the changes i made, but i am on windows, and was not receiving any fatal errors or anything.
// nadetimer by V-Man (bastardized by Lantry)
// Displays a countdown timer each time you pull out a nade.
// Requires tools.cfg and the packaged png files.
alias prevxhair [default.png] // Put your preferred crosshair path in here.

alias nadetimer [if (= (curweapon) 8) [
alias prevxhairsz $crosshairsize
crosshairsize 50
if (checkalias xhairstop) [xhairstop] []
sloop nt 19 100 [loadcrosshair (concatword "nadetimer\nt_" (+ (* $nt -1) 18) ".png")]
sleep 2500 [loadcrosshair $prevxhair; crosshairsize $prevxhairsz]] []]

altaction_8 [nadetimer]
I tested this, and i'm pretty sure it is working the same way it was before. It is certainly working without errors.
Thanks given by:
Linux, I knew it. :(
I wonder what about Linux makes this script throw an exception??
Thanks given by:
Brush up on your math skills while you get nade spammed xD:

Random math quiz script with correct/incorrect counters...

http://pastebin.com/rEm27aH0 <- ^ URL here, in case you didn't see it up there. ^
Thanks given by:
Is there a script for finding logs (common)?
Thanks given by:
Not yet, but that's a great idea.
Thanks given by:
EDIT:
(17 Mar 11, 04:19AM)Viper Wrote: Is there a script for finding logs (common)?

div=f = [ $arg1 = (divf (getalias $arg1) $arg2) ]
log10 = [ result (divf (log2 $arg1) (log2 10)) ]
log2 = [
  tmpval = $arg1
  tmpres = 0
  while [ (< $tmpval 1) ] [
    -=f tmpres 1
    *=f tmpval 2 ]
  while [ (>= $tmpval 2) ] [
    +=f tmpres 1
    div=f tmpval 2 ]
  tmpfp = 1
  while [ (>=f $tmpfp 0.000001) ] [
    div=f tmpfp 2
    *=f tmpval $tmpval
    if (>= $tmpval 2) [
      div=f tmpval 2
      +=f tmpres $tmpfp ] ]
  result $tmpres ]

EDIT: This returns the common logarithm, log10 n, of a given n value, and n should be greater than zero. Binary logarithm can also be used: log2 n, and n should be greater than zero.
Thanks given by:
And what does this gem do?
Thanks given by:
Simple editing binds creator w/ examples...


Example usage:
/editbind KEY [code block to be executed if in edit mode] [code block to be executed if not]
---
/editbind K [corner] [echo I have (at (pstat_score (findcn $curname)) 1) kills!] // Creates a corner out of the current selection if in editmode, else outputs your current number of kills (frags)...

If you don't plan on having any actions for either of the final two arugments, you should still provide a empty set of brackets to indicate to the script that you want it to "do nothing" in that case.

Do plan on beefing this one up and making it more user-friendly in the near future, planning on trying to make optional "high-level" keywords to replace cubescript's daunting syntax and command naming conventions/arguments/w/e, maybe will throw in some menus as well. :)

For now most users that are comfortable with cubescript should be able to work well with this "skeleton".



That's right Gibbeh, format4life. \:D
Thanks given by:
How high level can you get, when Cubescript is already high level?
Thanks given by:
Not high level enough, I bet most newbies look at a basic keybind that uses more than 1 if and dies a little inside. :P

I'd like to make it easier on them to get proper binds is all.
Thanks given by:
cd-axis = 0
computer-desktop = [
if (= $editing 1) [
newent mapmodel 71;
sleep 100 [newent mapmodel 65 3]
if (= $cd-axis 0) [
sleep 200 [newent clip 0 2 4 3]; echo " 3X 4-axis"] [sleep 200 [newent clip 0 4 2 3]; echo " 3Y 4-axis"]
] [echo " 3Not editing"]
]

docsection [Computer Desktop]
docident [computer-desktop] [Generates a computer on a desktop, depending the axis (for the clip).];
docremark [See cd-axis for more info];

docident [cd-axis] [Determines the axis for computer-desktop.];
docargument [X] [= 0 or = 1 | 0 : X-axis | 1 : Y-axis] [] [0];

Generates a computer on a desktop, with clip depending of the axis. Useful for mapping =D
Note : You have to put
/cd-axis = 0(or 1)
in the console to change the axis.
Thanks given by:
OH MY F***ING GOD!!! love those scripts :DD definetely that sniper scope zoom :D are you some kind of official AC-developer man!? Thanks,man!
But one question :S When in autoexec file read that: // This file gets executed every time you start AssaultCube.

// This is where you should put any scripts you may have created for AC. <- should i remove that text before pasteing those scripts!? help :S
Thanks given by:
No you don't have to remove that text, in almost all AssaultCube configuration files (.cfg) anything after the double backslashes "//" on a line is ignored:

echo Hi there...
// echo Hi there...
// This is another comment that'll be ignored by cubescript

...you'll only see "Hi there..." once because the second one is commented out (i.e. has "//" before it)
Thanks given by:
oh, so i just paste a scritp on the next line?

Thanks given by:
That'll do it, or you can take the line out assuming you can remember that the autoexec.cfg is a good place to put scripts that you want to be automatically executed upon starting AC.

That comment there is just to explain to newbies what the purpose of that specific file is.



One day you're going to want to clean up your autoexec.cfg a little because of the amount of scripts you'll be using, when that time comes, consider setting up an automatically executed scripts folder. :)

HTH
Thanks given by:
Thanks :D but i'm not very good with computers, i just like the game and love to see it developed :D so i think i wont do so much of these script-changes

Thanks given by:
Mega Binds script:

http://pastebin.com/XFBFJsPg

Supposed to replace all the delta_edit, delta_game, etc. stuff from scripts.cfg - Allows you to bind a key to many different actions all with 1 command and without needing any aliases. :D

Example usage:

megabind O [
  gamespeed 1000 // "Fast forward" demo playback
] [
  echo Current map message is: (getmapmsg) // Show the mapmsg in editing or coop-edit
] [
  connect (curserver 1) (curserver 3) // Reconnect to the server you're on if connected to one
] [
  botskillall best // Turn up the heat if playing bots
] [
// Do nothing, if the other arguments have not been met :3
]
Thanks given by:
@Yarukinasu:
May I include your binary logarithm script in my next tools.cfg release? :D I may modify it to accept negative numbers (more for dummy-proofing than anything), but I find your method elegant.
Thanks given by:
(20 Mar 11, 02:05PM)V-Man Wrote: @Yarukinasu:
May I include your binary logarithm script in my next tools.cfg release? :D I may modify it to accept negative numbers (more for dummy-proofing than anything), but I find your method elegant.

Of course, you may. Also, check out math.cfg... I know there is not much, and I ran out of ideas. I know, some of the aliases defined are useless. Change the names of the aliases to appropriate names if possible... Thank you.

http://pastebin.com/XWRu6Ufp
Thanks given by:
? I may have asked this question b4 but how can I have auto-reload JUST for pistol ?
Thanks given by: