Posts: 1,823
Threads: 20
Joined: Jun 2010
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)
Posts: 37
Threads: 1
Joined: Mar 2011
Thank You, now it works ^^
Posts: 1
Threads: 0
Joined: Mar 2011
Love the nade timer
execpt it doesn't work for me...
Posts: 37
Threads: 1
Joined: Mar 2011
It's the same for me. When I try to launch the game with the script, I get an AssaultCube fatal error.
Posts: 3,780
Threads: 33
Joined: Jun 2010
For the nade timer? o_O
Do you have tools.cfg installed?
Posts: 37
Threads: 1
Joined: Mar 2011
14 Mar 11, 03:52AM
(This post was last modified: 14 Mar 11, 03:53AM by BarricadeX75.)
Properly installed.
CrossHair Anim works fine.
Posts: 865
Threads: 35
Joined: Dec 2010
14 Mar 11, 04:30AM
(This post was last modified: 14 Mar 11, 04:31AM by Lantry.)
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.
Posts: 3,780
Threads: 33
Joined: Jun 2010
14 Mar 11, 05:01AM
(This post was last modified: 14 Mar 11, 05:01AM by V-Man.)
Fatal error though??
augh.
Linux ftl?
* V-Man dodges rotten tomatoes
Posts: 1,823
Threads: 20
Joined: Jun 2010
If you ask V-Man, we made a YAIYAIYAI script a loooonggg time ago.
Posts: 3,780
Threads: 33
Joined: Jun 2010
Lantry, what changes did you make to the nade timer script that made it stable for you? Perhaps the changes will benefit others.
Posts: 865
Threads: 35
Joined: Dec 2010
14 Mar 11, 09:20PM
(This post was last modified: 14 Mar 11, 09:21PM by Lantry.)
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.
Posts: 3,780
Threads: 33
Joined: Jun 2010
Linux, I knew it. :(
I wonder what about Linux makes this script throw an exception??
Posts: 1,331
Threads: 44
Joined: Jun 2010
16 Mar 11, 05:28AM
(This post was last modified: 16 Mar 11, 05:31AM by Bukz.)
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. ^
Posts: 951
Threads: 23
Joined: Jun 2010
Is there a script for finding logs (common)?
Posts: 3,780
Threads: 33
Joined: Jun 2010
Not yet, but that's a great idea.
Posts: 25
Threads: 0
Joined: Dec 2010
18 Mar 11, 02:25AM
(This post was last modified: 18 Mar 11, 11:22PM by Yarukinasu.)
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.
Posts: 3,462
Threads: 72
Joined: Jun 2010
And what does this gem do?
Posts: 1,331
Threads: 44
Joined: Jun 2010
18 Mar 11, 03:41AM
(This post was last modified: 18 Mar 11, 03:48AM by Bukz.)
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
Posts: 1,823
Threads: 20
Joined: Jun 2010
How high level can you get, when Cubescript is already high level?
Posts: 1,331
Threads: 44
Joined: Jun 2010
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.
Posts: 37
Threads: 1
Joined: Mar 2011
18 Mar 11, 09:41AM
(This post was last modified: 18 Mar 11, 10:05AM by BarricadeX75.)
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 "3X4-axis"] [sleep 200 [newent clip 0 4 2 3]; echo "3Y4-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.
Posts: 15
Threads: 2
Joined: Mar 2011
18 Mar 11, 10:55AM
(This post was last modified: 18 Mar 11, 11:04AM by Sambu.)
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
Posts: 1,331
Threads: 44
Joined: Jun 2010
18 Mar 11, 11:15AM
(This post was last modified: 18 Mar 11, 11:15AM by Bukz.)
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)
Posts: 15
Threads: 2
Joined: Mar 2011
oh, so i just paste a scritp on the next line?
Posts: 1,331
Threads: 44
Joined: Jun 2010
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
Posts: 15
Threads: 2
Joined: Mar 2011
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
Posts: 1,331
Threads: 44
Joined: Jun 2010
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
]
Posts: 3,780
Threads: 33
Joined: Jun 2010
@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.
Posts: 25
Threads: 0
Joined: Dec 2010
21 Mar 11, 02:01AM
(This post was last modified: 27 Mar 11, 09:40PM by Yarukinasu.)
(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
Posts: 625
Threads: 57
Joined: Oct 2010
? I may have asked this question b4 but how can I have auto-reload JUST for pistol ?
|