P51_Rider
1st February 2010, 12:21 AM
Hello all,
Before I start, I have read through the manual once, read the online help page, and even read the Idiiots guide. I have been reading the forums a bunch over the last week, and have integrated many snippets of scripts into my CMS > MAPs.
Programming in the GUI has been a no brainer. But I have been using BIPED with Dhauzimmers drivers for years, and consider myself pretty accomplished in that scripting format. I really want to be proficient at CMS too.
CMS is a little more daunting, but so was BIPED when I started. But I do have one issue that I ran into about a week ago. I solved the issue by using a totally different method ( script ) but keep remembering the previous issue and it is bugging me to no end.
I was trying to %Define a switched mode button with this script.
I have left my comments to myself within the script, but am still not quite sure of some of the issues.
----------------------------------------------------------------------------
Code:
script
// Set Switched Button
//%DEFINE shifted js1.b4 //original definition
%DEFINE shifted (js1.b4) // found at CH Hanger not working either
// Set Modes thru the CMS buttons
sequence
cms.b125 = js1.b10 AND shifted; //try inverting shifted and buttons
cms.b126 = js1.b7 AND shifted; //check to see if I can assign cms buttons this way
cms.b127 = js1.b9 AND shifted;
cms.b128 = js1.b8 AND shifted;
endsequence
sequence
IF( cms.b125 ) THEN
CURRENTMODE = MODE1;
ELSE
IF( B126 ) THEN
CURRENTMODE = MODE2;
ELSE
IF( b127 ) THEN
CURRENTMODE = MODE3;
ELSE
IF( b128 ) THEN
CURRENTMODE = MODE4;
ENDIF
ENDIF
ENDIF
ENDIF
endsequence
sequence
if ([CURRENTMODE == MODE1])
then cms.b1 = js1.b1; //DX1
endif
if ([CURRENTMODE == MODE1])
then cms.b2 = js1.b1 AND shifted; //DX2
endif
if ([CURRENTMODE == MODE2])
then cms.b3 = js1.b1; //DX3
endif
if ([CURRENTMODE == MODE2])
then cms.b4 = js1.b1 AND shifted; //DX4
endif
if ([CURRENTMODE == MODE3])
then cms.b5 = js1.b1; //DX5
endif
if ([CURRENTMODE == MODE3])
then cms.b6 = js1.b1 AND shifted; //DX6
endif
if ([CURRENTMODE == MODE4])
then cms.b7 = js1.b1; //DX7
endif
if ([CURRENTMODE == MODE4])
then cms.b8 = js1.b1 AND shifted; //DX8
endif
endsequence
endScript
---------------------------------------------------
All of the JS were set to DirectX = disabled and none none set in function. CMS buttons were assigned each of the DX buttons correspondingly (B1 - DX1 B2-DX2 and so on).
Each time I ran the script tester, it would give no errors, and no errors when downloading the map.
But when then testing in the Calibration Applet, it would show button 1, then button 2, then button 1 and 2. The response on keypress were eratic and I never saw any button output beyond 1 or 2.
Outside of CH Manager, like in DIView, nothing seemed to work either.
I am using another type of script for the time being, but not understanding why this one didnt work is getting to me, and not understaning makes my future scripts suspect.
After all, one day I aspire to be an UBerScripter like Bob Church or DonULFonso. :salute:
OMT, this scripting is becoming less intemidating, and is actually becoming FUN.
Just trying to shake this one problem so I can move on.
Before I start, I have read through the manual once, read the online help page, and even read the Idiiots guide. I have been reading the forums a bunch over the last week, and have integrated many snippets of scripts into my CMS > MAPs.
Programming in the GUI has been a no brainer. But I have been using BIPED with Dhauzimmers drivers for years, and consider myself pretty accomplished in that scripting format. I really want to be proficient at CMS too.
CMS is a little more daunting, but so was BIPED when I started. But I do have one issue that I ran into about a week ago. I solved the issue by using a totally different method ( script ) but keep remembering the previous issue and it is bugging me to no end.
I was trying to %Define a switched mode button with this script.
I have left my comments to myself within the script, but am still not quite sure of some of the issues.
----------------------------------------------------------------------------
Code:
script
// Set Switched Button
//%DEFINE shifted js1.b4 //original definition
%DEFINE shifted (js1.b4) // found at CH Hanger not working either
// Set Modes thru the CMS buttons
sequence
cms.b125 = js1.b10 AND shifted; //try inverting shifted and buttons
cms.b126 = js1.b7 AND shifted; //check to see if I can assign cms buttons this way
cms.b127 = js1.b9 AND shifted;
cms.b128 = js1.b8 AND shifted;
endsequence
sequence
IF( cms.b125 ) THEN
CURRENTMODE = MODE1;
ELSE
IF( B126 ) THEN
CURRENTMODE = MODE2;
ELSE
IF( b127 ) THEN
CURRENTMODE = MODE3;
ELSE
IF( b128 ) THEN
CURRENTMODE = MODE4;
ENDIF
ENDIF
ENDIF
ENDIF
endsequence
sequence
if ([CURRENTMODE == MODE1])
then cms.b1 = js1.b1; //DX1
endif
if ([CURRENTMODE == MODE1])
then cms.b2 = js1.b1 AND shifted; //DX2
endif
if ([CURRENTMODE == MODE2])
then cms.b3 = js1.b1; //DX3
endif
if ([CURRENTMODE == MODE2])
then cms.b4 = js1.b1 AND shifted; //DX4
endif
if ([CURRENTMODE == MODE3])
then cms.b5 = js1.b1; //DX5
endif
if ([CURRENTMODE == MODE3])
then cms.b6 = js1.b1 AND shifted; //DX6
endif
if ([CURRENTMODE == MODE4])
then cms.b7 = js1.b1; //DX7
endif
if ([CURRENTMODE == MODE4])
then cms.b8 = js1.b1 AND shifted; //DX8
endif
endsequence
endScript
---------------------------------------------------
All of the JS were set to DirectX = disabled and none none set in function. CMS buttons were assigned each of the DX buttons correspondingly (B1 - DX1 B2-DX2 and so on).
Each time I ran the script tester, it would give no errors, and no errors when downloading the map.
But when then testing in the Calibration Applet, it would show button 1, then button 2, then button 1 and 2. The response on keypress were eratic and I never saw any button output beyond 1 or 2.
Outside of CH Manager, like in DIView, nothing seemed to work either.
I am using another type of script for the time being, but not understanding why this one didnt work is getting to me, and not understaning makes my future scripts suspect.
After all, one day I aspire to be an UBerScripter like Bob Church or DonULFonso. :salute:
OMT, this scripting is becoming less intemidating, and is actually becoming FUN.
Just trying to shake this one problem so I can move on.