The script requests/brainstorming thread!
You may know it as "Mindfuck"
Thanks given by:
OK FINE I FIX IT
a = 2
b = 3

alias swap [
               a = (+f $a $b);
               b = (-f $a $b);
               a = (-f $b $a)
]
Thanks given by:
Even better script, less lines:
a = 2; b = 3
swap = [a = 3; b = 2]
Thanks given by:
(16 Apr 11, 07:16AM)V-Man Wrote: That's great! So efficient! Can you think of an efficient script for "powf"?

Lol, I have come to a dead end.
powf = (stuff using log2 and powf)

Updated gcd and isint.
// Euclidean algorithm
gcd = [ if (modf $arg1 $arg2) [ result (gcd $arg2 (modf $arg1 $arg2)) ] [ result $arg2 ] ]

// determines whether the number is an int or not
isint = [ result (=f (+ $arg1) $arg1) ]

// returns the fraction of a rational number
// precondition: arg1 is a rational number e.g. 0.35
tofract = [ result (simplify $arg1 1) ]

// returns the fraction of an irrational number
// precondition: arg1 is the repeating portion of an irrational number e.g. 0.66666... -> 0.6
itofract = [ result (simplify $arg1 0.9) ]

// returns the simplified fraction
simplify = [
  tmpnum1 = $arg1
  tmpnum2 = $arg2
  while [ (|| (! (isint $tmpnum1)) (! (isint $tmpnum2))) ] [ *=f tmpnum1 10; *=f tmpnum2 10 ]
  tmpgcd = (gcd $tmpnum1 $tmpnum2)
  result (concat (divf $tmpnum1 $tmpgcd) (divf $tmpnum2 $tmpgcd)) ]

// XXX: works only if powf is implemented correctly
nthroot = [ result (powf 2 (divf (log2 $arg2) $arg1)) ]

// XXX: fail recursive
powf = [ result (powf 2 (*f $arg2 (log2 $arg1))) ]



Bit manipulation, pl0x...
i = 1
j = 2

+= i $j
j = (- $i $j)
-= i $j
i = 1
j = 2

^= i $j
j = (^ $i $j)
^= i $j
Thanks given by:
A script that change the crosshair according to the weapon.

It would be useful to me because I use a small crosshair and it makes difficult to slash.
Thanks given by:
//Multiple Crosshair Script by Lantry
//please enter your crosshair choices in the lines below

arxhair = [default.png]         //Assault Rifle cursor goes here (6)
arxhairsz = [15]            //and cursor size goes here
smgxhair = [default.png]         //SMG cursor goes here (4)
smgxhairsz = [15]            //and cursor size goes here
shotgunxhair = [default.png]     //Shotgun cursor goes here (3)
shotgunxhairsz = [15]        //and cursor size goes here
riflexhair = [default.png]         //Carbine cursor goes here (2)
riflexhairsz = [15]            //and cursor size goes here
knifexhair = [default.png]         //knife cursor goes here (0)
knifexhairsz = [15]            //and cursor size goes here
nadexhair = [default.png]     //grenade cursor goes here (8)
nadexhairsz = [15]            //and cursor size goes here
pistolxhair = [default.png]     // pistol cursor goes here (1)
pistolxhairsz = [15]            //and cursor size goes here
akimboxhair = [default.png]     //akimbo cursor goes here (9)
akimboxhairsz = [15]        //and cursor size goes here

add2conloop [
if (= (curweapon) 6) [ loadcrosshair $arxhair; crosshairsize $arxhairsz ]
if (= (curweapon) 4) [ loadcrosshair $smgxhair; crosshairsize $smgxhairsz ]
if (= (curweapon) 3) [ loadcrosshair $shotgunxhair; crosshairsize $shotgunxhairsz ]
if (= (curweapon) 2) [ loadcrosshair $riflexhair; crosshairsize $riflexhairsz ]
if (= (curweapon) 1) [ loadcrosshair $pistolxhair; crosshairsize $pistolxhairsz ]
if (= (curweapon) 0) [ loadcrosshair $knifexhair; crosshairsize $knifexhairsz ]
if (= (curweapon) 8) [ loadcrosshair $nadexhair; crosshairsize $nadexhairsz ]
if (= (curweapon) 9) [ loadcrosshair $akimboxhair; crosshairsize $akimboxhairsz ]
]
this changes the xhair according to the weapon, but I don't think it will help you because it doesn't use crosshairsize yet, but give me 15 mins and i will update it with xhairsize for you
done, though I haven't tested all the guns so I may have some silly mispelling errors in there or something
Thanks given by:
I've been wondering where to find a script like that for a while, xD, you just made my day Lantry.
Thanks given by:
@Yarukinasu:
Glad to know I'm not alone. But thanks for trying! XD
Thanks given by:
Unknow command....all (?).
Thanks given by:
Do you not have tools.cfg?
Thanks given by:
Do you not have an equals sign on your keyboard?
//Multiple Crosshair Script by Lantry
//please enter your crosshair choices in the lines below

arxhair = [default.png]         //Assault Rifle cursor goes here (6)
arxhairsz = [15]            //and cursor size goes here
smgxhair = [default.png]         //SMG cursor goes here (4)
smgxhairsz = [15]            //and cursor size goes here
shotgunxhair = [default.png]     //Shotgun cursor goes here (3)
shotgunxhairsz = [15]        //and cursor size goes here
riflexhair = [default.png]         //Carbine cursor goes here (2)
riflexhairsz = [15]            //and cursor size goes here
knifexhair = [default.png]         //knife cursor goes here (0)
knifexhairsz = [15]            //and cursor size goes here
nadexhair = [default.png]     //grenade cursor goes here (8)
nadexhairsz = [15]            //and cursor size goes here
pistolxhair = [default.png]     // pistol cursor goes here (1)
pistolxhairsz = [15]            //and cursor size goes here
akimboxhair = [default.png]     //akimbo cursor goes here (9)
akimboxhairsz = [15]        //and cursor size goes here

add2conloop [
if (= (curweapon) 6) [ loadcrosshair $arxhair; crosshairsize $arxhairsz ]
if (= (curweapon) 4) [ loadcrosshair $smgxhair; crosshairsize $smgxhairsz ]
if (= (curweapon) 3) [ loadcrosshair $shotgunxhair; crosshairsize $shotgunxhairsz ]
if (= (curweapon) 2) [ loadcrosshair $riflexhair; crosshairsize $riflexhairsz ]
if (= (curweapon) 1) [ loadcrosshair $pistolxhair; crosshairsize $pistolxhairsz ]
if (= (curweapon) 0) [ loadcrosshair $knifexhair; crosshairsize $knifexhairsz ]
if (= (curweapon) 8) [ loadcrosshair $nadexhair; crosshairsize $nadexhairsz ]
if (= (curweapon) 9) [ loadcrosshair $akimboxhair; crosshairsize $akimboxhairsz ]
]
I fix for you. HTH

Thanks given by:
* Lantry is confused
it worked for me without the equals sign...
?
Thanks given by:
Not sure how, without it, or the "alias" command, those aliases never existed and couldn't possibly be used without throwing errors.
Thanks given by:
*facepalm*
yeah, I just went and checked the last version I had posted, and it used alias. For some reason, I had gotten rid of alias in the version on my computer, but I guess it still worked cause it was already in my saved.cfg
Thats what I get for staying up past my bedtime XD
It's fixed in my post now. sorry about that.
Thanks given by:
It happens, hehehe. May I suggest that you save some aliases by using a list instead, since you're already depending on tools.cfg for conloop, why not use add2list and at, so you only need 1 alias, rather than 16. :P

Btw, add2list, in it's exact current form, is in scripts.cfg of the SVN development version. Ty again V-Man. :D

Also you may wanna future prep your script by adding one for the combat pistol, it will be weapon 7, since nobody can equip it now, adding support for it wouldn't hurt anything. :)

HTH/HF/GL <3
Thanks given by:
Lantry, why is sniper rifle scope not included? O.O xD
Thanks given by:
Thanks Bukz, I'll look into it.
also, are you suggesting that the combat pistol may be finished soon? :D

viper: I originally had the sniper in as a joke, but didn't want people to get it confused between it and the official one so I removed it.
Thanks given by:
you don't need that in the script.
Put this in autoexec.cfg:
loadcrosshair scope default.png
Changing, of course, "default.png" to the name of the crosshair you prefer.
Thanks given by:
No file directory needed?
Thanks given by:
Nope
Thanks given by:
"loadcrosshair" automatically starts in the "\packages\misc\crosshairs\" folder (on Windows, XD).
Thanks given by:
exact same on everything isn't it?
Thanks given by:
Apparently Macs have a slightly different structure... Ask Waffles.
Thanks given by:
er
use forward slashes. Should work then.
Thanks given by: