Posts: 560
Threads: 10
Joined: Jan 2011
You may know it as "Mindfuck"
Posts: 3,780
Threads: 33
Joined: Jun 2010
OK FINE I FIX IT
a = 2
b = 3
alias swap [
a = (+f $a $b);
b = (-f $a $b);
a = (-f $b $a)
]
Posts: 1,823
Threads: 20
Joined: Jun 2010
Even better script, less lines:
a = 2; b = 3
swap = [a = 3; b = 2]
Posts: 25
Threads: 0
Joined: Dec 2010
(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
Posts: 72
Threads: 6
Joined: Jul 2010
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.
Posts: 865
Threads: 35
Joined: Dec 2010
17 Apr 11, 10:36PM
(This post was last modified: 18 Apr 11, 02:54AM by Lantry.)
//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
Posts: 554
Threads: 45
Joined: Dec 2010
I've been wondering where to find a script like that for a while, xD, you just made my day Lantry.
Posts: 3,780
Threads: 33
Joined: Jun 2010
@Yarukinasu:
Glad to know I'm not alone. But thanks for trying! XD
Posts: 72
Threads: 6
Joined: Jul 2010
Unknow command....all (?).
Posts: 523
Threads: 6
Joined: Dec 2010
Do you not have tools.cfg?
Posts: 3,780
Threads: 33
Joined: Jun 2010
18 Apr 11, 01:48AM
(This post was last modified: 18 Apr 11, 01:50AM by V-Man.)
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
Posts: 865
Threads: 35
Joined: Dec 2010
* Lantry is confused
it worked for me without the equals sign...
?
Posts: 1,331
Threads: 44
Joined: Jun 2010
Not sure how, without it, or the "alias" command, those aliases never existed and couldn't possibly be used without throwing errors.
Posts: 865
Threads: 35
Joined: Dec 2010
18 Apr 11, 02:53AM
(This post was last modified: 18 Apr 11, 02:54AM by Lantry.)
*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.
Posts: 1,331
Threads: 44
Joined: Jun 2010
18 Apr 11, 03:21AM
(This post was last modified: 18 Apr 11, 03:22AM by Bukz.)
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
Posts: 951
Threads: 23
Joined: Jun 2010
Lantry, why is sniper rifle scope not included? O.O xD
Posts: 865
Threads: 35
Joined: Dec 2010
18 Apr 11, 04:11AM
(This post was last modified: 18 Apr 11, 04:27AM by Lantry.)
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.
Posts: 3,780
Threads: 33
Joined: Jun 2010
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.
Posts: 229
Threads: 10
Joined: Jun 2010
No file directory needed?
Posts: 1,823
Threads: 20
Joined: Jun 2010
Posts: 3,780
Threads: 33
Joined: Jun 2010
"loadcrosshair" automatically starts in the "\packages\misc\crosshairs\" folder (on Windows, XD).
Posts: 951
Threads: 23
Joined: Jun 2010
exact same on everything isn't it?
Posts: 3,780
Threads: 33
Joined: Jun 2010
Apparently Macs have a slightly different structure... Ask Waffles.
Posts: 3,462
Threads: 72
Joined: Jun 2010
er
use forward slashes. Should work then.
|