This Thread isn't about throwing a script at someone. I rather wish to have a place for sharing Ideas and Questions - and most over all, Solutions ! The Solution should be a single subject on its own, with all needed parts. Please contribute but dont link full Scripts - better explain parts of it ! THANKS. Important, if you have not done yet, how to get the minimum Script for your TARGET Script Editor: Start "TARGET GUI" find useful PDFs within the dropdown "How do I ?" - remember this, you may need it to identify Names for Buttons or Switches click on NEW CONFIGURATION give any name you want select all devices you have and you want to include in your Script click NEXT - NEXT and View Script select and copy all close TARGET GUI open TARGET Script Editor click Menu and hit the "new", select Target-Code (tmc) and give a name select all and delete it, paste what you've copied previously from TARGET GUI REFERENCES T.A.R.G.E.T - Script Editor Basics Button-Names can be found in TARGET GUI – dropdown-box “HOW DO I ?” I'd like to kick the whole thing of with an example. There are 2 more examples I'd like to share with some interessting "need-to-know" if this Thread becomes "active". Excuse any typos. --- IDEA: switch HUDs using the Boat Switch (Pic1). "normal HUD" to "mining HUD" to "scanning HUD" -> using the default keys as defined in the SC-controls m=mining-HUD / TAB=scanning-HUD VARIABLES needed: (definitions for Variables have to be between "includes" and int main()) int BSB_INIT[1]; int BSF_INIT[1]; //(1 means you define an array with the lenght of 1 - and its an Integer value) int BSB_STOP[1]; int BSF_STOP[1]; int EventhandlerINC[1]; MAPPINGS needed: (Mappings are somewhere in main(), just below your device-definitions) MapKey(&Throttle, BSF, EXEC("HUD_MiningSWITCH(1);")); //(MapKey = do something if the according Switch (BSF in this case) has been activated) MapKeyR(&Throttle, BSF, EXEC("HUD_MiningSWITCH(2);")); //(MapKeyR = do something if the according Switch (BSF in this case) has been released or deactivated) MapKey(&Throttle, BSB, EXEC("HUD_SCANSWITCH(1);")); MapKeyR(&Throttle, BSB, EXEC("HUD_SCANSWITCH(2);")); VARIABLES values needed: (best place is just before the end of main() .. you may make a remark at this last brace main(){ ... } // end of main BSB_INIT[0]=0; BSF_INIT[0]=0; //([0] means you address the very first Integer from your array which has space for one Integer, you fill it with the value 0, its used as a flag) BSB_STOP[0]=0; BSF_STOP[0]=0; EventhandlerINC=0; EVENT HANDLER needed: (in most cases you dont need any Event Handler, but the function is a good example how you can make use of it) (watch out for "//add event handling code here" add the Event Handler code below this line) if (Throttle[BSB] & BSB_STOP[0]==0) { BSB_INIT[0]=1; BSB_STOP[0]=1; printf("BSB_INIT=%d BSB attention BoatSwitch is not BSM but BSB \xa",BSB_INIT[0]); //(debugging, optional) } if (Throttle[BSF] & BSF_STOP[0]==0) { BSF_INIT[0]=1; BSF_STOP[0]=1; printf("BSF_INIT=%d BSF attention BoatSwitch is not BSM but BSF \xa",BSF_INIT[0]); } EventhandlerINC[0]=EventhandlerINC[0]+1; if (EventhandlerINC[0]>=2) { BSB_STOP[0]=1; BSF_STOP[0]=1; } EXPLANATION of this code and the Event Handler: The EventHandler is running anytime you make any input on your Warthog. It also runs when you start up the Script. The EventHandler is stumbling over any Definition of Switches and because of that it runs several times while starting the Script. The first line of code is looking for the Boatswitch in its backward position (BSB). If this is the case and BSB_STOP[0] is still 0, the Script memorize this result in BSB_INIT[0]. To avoid any further runs of this code-section, BSB_STOP[0] gets a 1 (so this procedure wont run again). There's a printf example which is handy for debugging purposes. Then theres also a check for BSF, its the BoatSwitch in front-position. Sometimes it was not enough to let the EventHandler run only once. Thats why I do run it at least 2 times. This is what EventhandlerINC[0] is needed for. If the EventHandler ran twice it will be terminated by BSB_STOP[0]=1 and BSF_STOP[0]=1. The EventHandler will still run each time, but there is no custom code running anymore. The Reason to do that in EventHandler is to find out what position the Boat-Switch has. Maybe its not in the middle where it should be. Imagine the Scanning-HUD. You can switch to this HUD by pressing TAB and you can switch back by pressing TAB again. So its a trigger and not really a switch. Since its a trigger, if it's BSB instead BSM when the Script is starting and you pull the Switch from BSB to BSM a TAB will be fired and you change your HUD. Thats not a big deal because you could simply press TAB on your Keyboard to fix this. But I took it to show this as a good example to use the EventHandler. FUNCTIONS needed: (Functions are being placed after main(){} - just below the last brace and //end of main) int HUD_SCANSWITCH(int modus) { if (modus==1 & BSB_INIT[0]==0 & BSB_STOP[0]==1) { ActKey(KEYON+PULSE+TAB); } if (modus==2 & BSB_INIT[0]==0 & BSB_STOP[0]==1) { ActKey(KEYON+PULSE+TAB); } if (modus==2 & BSB_INIT[0]==1 & BSB_STOP[0]==1) { BSB_INIT[0]=0; } } int HUD_MiningSWITCH(int modus) { if (modus==1 & BSF_INIT[0]==0 & BSF_STOP[0]==1) { ActKey(KEYON+PULSE+'m'); } if (modus==2 & BSF_INIT[0]==0 & BSF_STOP[0]==1) { ActKey(KEYON+PULSE+'m'); } if (modus==2 & BSF_INIT[0]==1 & BSF_STOP[0]==1) { BSF_INIT[0]=0; } } EXPLANATIONS of those 2 Functions: Lookup at your Mappings. There is an execution defined when the Switch becomes active. If BSF becomes active, EXEC("HUD_MiningSWITCH(1); will be executed. This will start the second Function above. The "1" is coming into the Function (its an opcode) and will be saved as "modus" within the Function. If the Switch BSF has been activated, the Function is called and "modus" has the value=1. Check the first comparison "if (modus==1 & BSF_INIT[0]==0 & BSF_STOP[0]==1)". If the Switch has been activated AND BSF_INIT[0]=0 (the Switch was not in BSF position at start) AND the BSF_STOP[0]=1 (the EventHandler does no more do any code for this) THEN do fire a 'm' to switch to miningmode with ActKey(KEYON+PULSE+'m'); (this instruction fires the m just once, please refer to the manual its worth to check these things out). In the last if, the Functions are checking if the BSF or BSB has been released AND the BSB/BSF_INIT value was 1 (Switch position was not in the middle) and if so, do nothing but delete the BSB/BSF_INIT value to not stumble over it again. This "if" avoids to send a TAB or a 'm' if initially the Boat Switch was not in the middle when starting the script. -----