PDA

View Full Version : Some thought about script syntax



straffo
12th May 2004, 07:57 AM
Fist let say it's a nice tool.

I find some features not intuitives for me :)

for example I would prefer having a declaration part to set the fonction associated to a cms button like :

cms.b1.fonction = HOLD KP5 KP8
cms.b2.fonction = KP8
I don't find very intuitive to have a look to the cms gui to see what have been affected to B1 or B2.

A substitute would be to have the cms gui integrated in the script editor.

I would like to see some alias it would be better for sharing script.
Example I got this code from JNOV aces High script



pulse(d1) = js3.b4;
timer(offdelay,d2,5) = d1 and not d2;
cms.b100 = d2 and not js3.b4;


if it's like this a snippet it's not difficult to write js1 like in my config instead of js3 like in JNOV config.
But when script is long and complex
With an alias.


Js3 is fighterstick;
pulse(d1) = fighterstick.b4;
timer(offdelay,d2,5) = d1 and not d2;
cms.b100 = d2 and not fighterstick.b4;


It'll work like the %define ,I didn't check if the %define can be used to make the same code

I need also an hardware modification to be able to set an output bit so I'll be able to start and stop my coffee maker...
... well forget this :)

Revvin
12th May 2004, 08:08 AM
I need also an hardware modification to be able to set an output bit so I'll be able to start and stop my coffee maker[/b]

I believe Michael has a script that does that and also automatically logs on here and post replies while he's off gaming, all this time we were talking to CMS AI :D

Bob Church
12th May 2004, 03:56 PM
It's a a little rudimentary, but you can do most of what you mention. Maybe not to the degree that you'd like, but most of it is possible one way or another....

>> for example I would prefer having a declaration part to set the fonction associated to a cms button like:

cms.b1.fonction = HOLD KP5 KP8
cms.b2.fonction = KP8 <<

That has to be done in the GUI, but that&#39;s what the GUI is for, assigning buttons, axes, and characters. Some place you have to pick a button and tell it what it&#39;s to do. If you do it there first, e.g. program cms.b1 to "HOLD KP5 KP8" and cms.b2 as "KP8" in the GUI, then down in the script you can write:

%define LookForwardUp cms.b1
%define LookForward cms.b2

From then on you can just refer to LookForward and LookForwardUp in the script and you wouldn&#39;t need to back out of the editor to find out what the buttons were doing. While your "cms.b1.fonction" does let you assign the keys from the script, it doesn&#39;t give you the slightest clue what the cms.b1.fonction actually is and you&#39;re still going to have to define things in the script in terms of cms.b1 anyway unless you put a wrapper on it like the LookForward and LookForwardUp %defines.

>> I would like to see some alias it would be better for sharing script. Example I got this code from JNOV aces High script...

pulse(d1) = js3.b4;
timer(offdelay,d2,5) = d1 and not d2;
cms.b100 = d2 and not js3.b4; <<

You can do that now. The only limitation is that the entire %define has to be on a single line, and it can&#39;t reference another %define. You could certainly write the above snippet as a macro. It&#39;s a little long, I don&#39;t know if it will break on the board, so I&#39;ll do a shorter one for an example:

%define gunCamera timer( offDelay, d1, 20 ) = js1.b1; cms.b1 = d1

Now the CMS file:

script
gunCamera;
endScript

will compile as:

script
timer( offDelay, d1, 20 ) = js1.b1;
cms.b1 = d1;
endScript

As for naming the controls, you can do that but you want to name the whole control. No dots. Suppose you got a map with a FighterStick on JS1 and a ProThrottle on JS2:

%define Trigger js1.b1
%define Throttle js2.a3

but you didn&#39;t have a ProThrottle and wanted to use the throttle wheel on the stick, you could just change the second one to:

%define Throttle js1.a3

and the script would get modified. The biggest problem would be getting the writers of the original scripts to name all the controls to begin with rather than using the JSx nomenclature. Of course, a good search-and-replace would fix them for you pretty quickly.

Anyway, you can do most of what you want. Maybe future versions will come a bit closer to doing it all.

- Bob

The StickWorks
http://www.stickworks.com

straffo
12th May 2004, 04:13 PM
Thank a lot I&#39;ll do something like that .

As a C/C++ programmer I&#39;m never affraid of complex macro :D

MichaelCHProd
12th May 2004, 10:39 PM
***syntax error***

Revvin
12th May 2004, 11:15 PM
^ Now see he&#39;s a variable out and you&#39;ve crashed him..now his femme-bot Debby will have to re-initialise him :)

MichaelCHProd
12th May 2004, 11:23 PM
ERRORS Detected, Press F1 to continue, F3 to enter Setup

Revvin
12th May 2004, 11:29 PM
Damn someone put a call out for Nathan and tell him Michael needs formatting again :)

MichaelCHProd
12th May 2004, 11:31 PM
Insert Irish Whiskey Here-----> :o

Revvin
12th May 2004, 11:33 PM
Mmm Debby did say that Nathan-bot was far more productive and reliable, time to upgrade Michael to Michael ME :D

MichaelCHProd
12th May 2004, 11:38 PM
Welcome to Michael ME..... Howe mAy I......spark spark.... bIlL gAtEs Is God....



pLeAsE sTaNd By....ftp://ftp.chproducts.com/pub/Postings/Fire.JPG


InSeRt CrEdIt CaRd NOW