Sub COM1set
if ((HIDMacros.IsButtonPressed("COM1", 11)/(-128))+(HIDMacros.IsButtonPressed("COM1", 16)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 23)/(-128))+(HIDMacros.IsButtonPressed("COM1", 24)/(-128))= 4 then
com1_wholeright_18 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 10)/(-128))+(HIDMacros.IsButtonPressed("COM1", 16)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 23)/(-128))+(HIDMacros.IsButtonPressed("COM1", 24)/(-128))= 4 then
com1_wholeright_19 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 10)/(-128))+(HIDMacros.IsButtonPressed("COM1", 15)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 22)/(-128))+(HIDMacros.IsButtonPressed("COM1", 24)/(-128))= 4 then
com1_wholeright_20 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 15)/(-128))+(HIDMacros.IsButtonPressed("COM1", 16)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 22)/(-128))+(HIDMacros.IsButtonPressed("COM1", 24)/(-128))= 4 then
com1_wholeright_21 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 14)/(-128))+(HIDMacros.IsButtonPressed("COM1", 16)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 22)/(-128))+(HIDMacros.IsButtonPressed("COM1", 24)/(-128))= 4 then
com1_wholeright_22 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 14)/(-128))+(HIDMacros.IsButtonPressed("COM1", 15)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 22)/(-128))+(HIDMacros.IsButtonPressed("COM1", 24)/(-128))= 4 then
com1_wholeright_23 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 11)/(-128))+(HIDMacros.IsButtonPressed("COM1", 15)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 22)/(-128))+(HIDMacros.IsButtonPressed("COM1", 24)/(-128))= 4 then
com1_wholeright_24 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 11)/(-128))+(HIDMacros.IsButtonPressed("COM1", 14)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 22)/(-128))+(HIDMacros.IsButtonPressed("COM1", 24)/(-128))= 4 then
com1_wholeright_25 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 10)/(-128))+(HIDMacros.IsButtonPressed("COM1", 14)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 22)/(-128))+(HIDMacros.IsButtonPressed("COM1", 24)/(-128))= 4 then
com1_wholeright_26 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 10)/(-128))+(HIDMacros.IsButtonPressed("COM1", 11)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 22)/(-128))+(HIDMacros.IsButtonPressed("COM1", 24)/(-128))= 4 then
com1_wholeright_27 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 11)/(-128))+(HIDMacros.IsButtonPressed("COM1", 16)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 22)/(-128))+(HIDMacros.IsButtonPressed("COM1", 24)/(-128))= 4 then
com1_wholeright_28 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 10)/(-128))+(HIDMacros.IsButtonPressed("COM1", 16)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 22)/(-128))+(HIDMacros.IsButtonPressed("COM1", 24)/(-128))= 4 then
com1_wholeright_29 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 10)/(-128))+(HIDMacros.IsButtonPressed("COM1", 15)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 22)/(-128))+(HIDMacros.IsButtonPressed("COM1", 23)/(-128))= 4 then
com1_wholeright_30 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 15)/(-128))+(HIDMacros.IsButtonPressed("COM1", 16)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 22)/(-128))+(HIDMacros.IsButtonPressed("COM1", 23)/(-128))= 4 then
com1_wholeright_31 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 14)/(-128))+(HIDMacros.IsButtonPressed("COM1", 16)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 22)/(-128))+(HIDMacros.IsButtonPressed("COM1", 23)/(-128))= 4 then
com1_wholeright_32 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 14)/(-128))+(HIDMacros.IsButtonPressed("COM1", 15)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 22)/(-128))+(HIDMacros.IsButtonPressed("COM1", 23)/(-128))= 4 then
com1_wholeright_33 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 11)/(-128))+(HIDMacros.IsButtonPressed("COM1", 15)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 22)/(-128))+(HIDMacros.IsButtonPressed("COM1", 23)/(-128))= 4 then
com1_wholeright_34 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 11)/(-128))+(HIDMacros.IsButtonPressed("COM1", 14)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 22)/(-128))+(HIDMacros.IsButtonPressed("COM1", 23)/(-128))= 4 then
com1_wholeright_35 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 10)/(-128))+(HIDMacros.IsButtonPressed("COM1", 14)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 22)/(-128))+(HIDMacros.IsButtonPressed("COM1", 23)/(-128))= 4 then
com1_wholeright_36 = 1
end if
if (HIDMacros.IsButtonPressed("COM1", 31)/(-128))= 1 And (HIDMacros.IsButtonPressed("COM1", 32)/(-128))= 0 And (HIDMacros.IsButtonPressed("COM1", 30)/(-128))= 0 And (HIDMacros.IsButtonPressed("COM1", 27)/(-128))= 0 then
com1_decright_00 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 31)/(-128))+(HIDMacros.IsButtonPressed("COM1", 32)/(-128)))= 2 then
com1_decright_10 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 30)/(-128))+(HIDMacros.IsButtonPressed("COM1", 32)/(-128)))= 2 then
com1_decright_20 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 30)/(-128))+(HIDMacros.IsButtonPressed("COM1", 31)/(-128)))= 2 then
com1_decright_30 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 27)/(-128))+(HIDMacros.IsButtonPressed("COM1", 31)/(-128)))= 2 then
com1_decright_40 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 27)/(-128))+(HIDMacros.IsButtonPressed("COM1", 30)/(-128)))= 2 then
com1_decright_50 = 1
end if
if (HIDMacros.IsButtonPressed("COM1", 30)/(-128))= 1 And (HIDMacros.IsButtonPressed("COM1", 32)/(-128))= 0 And (HIDMacros.IsButtonPressed("COM1", 31)/(-128))= 0 And (HIDMacros.IsButtonPressed("COM1", 27)/(-128))= 0 then
com1_decright_60 = 1
end if
if (HIDMacros.IsButtonPressed("COM1", 27)/(-128))= 1 And (HIDMacros.IsButtonPressed("COM1", 31)/(-128))= 0 And (HIDMacros.IsButtonPressed("COM1", 30)/(-128))= 0 And (HIDMacros.IsButtonPressed("COM1", 32)/(-128))= 0 then
com1_decright_70 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 27)/(-128))+(HIDMacros.IsButtonPressed("COM1", 32)/(-128)))= 2 then
com1_decright_80 = 1
end if
if (HIDMacros.IsButtonPressed("COM1", 32)/(-128))= 1 And (HIDMacros.IsButtonPressed("COM1", 31)/(-128))= 0 And (HIDMacros.IsButtonPressed("COM1", 30)/(-128))= 0 And (HIDMacros.IsButtonPressed("COM1", 27)/(-128))= 0 then
com1_decright_90 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 8)/(-128))= 1 )then
com1_lastright_0 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 7)/(-128))= 1 )then
com1_lastright_2 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 6)/(-128))= 1 )then
com1_lastright_5 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 3)/(-128))= 1 )then
com1_lastright_7 = 1
end if
right_com1_frequency_whole = com1_wholeright_18 * 118 + com1_wholeright_19 * 119 + com1_wholeright_20 * 120 + com1_wholeright_21 * 121 + com1_wholeright_22 * 122 + com1_wholeright_23 * 123 + com1_wholeright_24 * 124 + com1_wholeright_25 * 125 + com1_wholeright_26 * 126 + com1_wholeright_27 * 127 + com1_wholeright_28 * 128 + com1_wholeright_29 * 129 + com1_wholeright_30 * 130 + com1_wholeright_31 * 131 + com1_wholeright_32 * 132 + com1_wholeright_33 * 133 + com1_wholeright_34 * 134 + com1_wholeright_35 * 135 + com1_wholeright_36 * 136 + 0
right_com1_frequency_decimal = com1_decright_00 * 0 + com1_decright_10 * 0.1 + com1_decright_20 * 0.2 + com1_decright_30 * 0.3 + com1_decright_40 * 0.4 + com1_decright_50 * 0.5 + com1_decright_60 * 0.6 + com1_decright_70 * 0.7 + com1_decright_80 * 0.8 + com1_decright_90 * 0.9
right_com1_frequency_last = com1_lastright_0 * 0 + com1_lastright_2 * 0.02 + com1_lastright_5 * 0.05 + com1_lastright_7 * 0.07
right_com1_freq = right_com1_frequency_whole + right_com1_frequency_decimal + right_com1_frequency_last
right_com1_active=HIDMacros.IsButtonPressed("COM1", 4)/(-128)
if ((HIDMacros.IsButtonPressed("COM1", 55)/(-128))+(HIDMacros.IsButtonPressed("COM1", 59)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 64)/(-128))= 3 then
com1_wholeleft_18 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 55)/(-128))+(HIDMacros.IsButtonPressed("COM1", 56)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 58)/(-128))+(HIDMacros.IsButtonPressed("COM1", 64)/(-128))= 4 then
com1_wholeleft_19 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 54)/(-128))+(HIDMacros.IsButtonPressed("COM1", 56)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 58)/(-128))+(HIDMacros.IsButtonPressed("COM1", 63)/(-128))= 4 then
com1_wholeleft_20 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 54)/(-128))+(HIDMacros.IsButtonPressed("COM1", 56)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 63)/(-128))+(HIDMacros.IsButtonPressed("COM1", 64)/(-128))= 4 then
com1_wholeleft_21 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 54)/(-128))+(HIDMacros.IsButtonPressed("COM1", 56)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 62)/(-128))+(HIDMacros.IsButtonPressed("COM1", 64)/(-128))= 4 then
com1_wholeleft_22 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 54)/(-128))+(HIDMacros.IsButtonPressed("COM1", 56)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 62)/(-128))+(HIDMacros.IsButtonPressed("COM1", 63)/(-128))= 4 then
com1_wholeleft_23 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 54)/(-128))+(HIDMacros.IsButtonPressed("COM1", 56)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 59)/(-128))+(HIDMacros.IsButtonPressed("COM1", 63)/(-128))= 4 then
com1_wholeleft_24 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 54)/(-128))+(HIDMacros.IsButtonPressed("COM1", 56)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 59)/(-128))+(HIDMacros.IsButtonPressed("COM1", 62)/(-128))= 4 then
com1_wholeleft_25 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 54)/(-128))+(HIDMacros.IsButtonPressed("COM1", 56)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 58)/(-128))+(HIDMacros.IsButtonPressed("COM1", 62)/(-128))= 4 then
com1_wholeleft_26 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 54)/(-128))+(HIDMacros.IsButtonPressed("COM1", 56)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 58)/(-128))+(HIDMacros.IsButtonPressed("COM1", 59)/(-128))= 4 then
com1_wholeleft_27 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 54)/(-128))+(HIDMacros.IsButtonPressed("COM1", 56)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 59)/(-128))+(HIDMacros.IsButtonPressed("COM1", 64)/(-128))= 4 then
com1_wholeleft_28 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 54)/(-128))+(HIDMacros.IsButtonPressed("COM1", 56)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 58)/(-128))+(HIDMacros.IsButtonPressed("COM1", 64)/(-128))= 4 then
com1_wholeleft_29 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 54)/(-128))+(HIDMacros.IsButtonPressed("COM1", 55)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 58)/(-128))+(HIDMacros.IsButtonPressed("COM1", 63)/(-128))= 4 then
com1_wholeleft_30 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 54)/(-128))+(HIDMacros.IsButtonPressed("COM1", 55)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 63)/(-128))+(HIDMacros.IsButtonPressed("COM1", 64)/(-128))= 4 then
com1_wholeleft_31 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 54)/(-128))+(HIDMacros.IsButtonPressed("COM1", 55)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 62)/(-128))+(HIDMacros.IsButtonPressed("COM1", 64)/(-128))= 4 then
com1_wholeleft_32 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 54)/(-128))+(HIDMacros.IsButtonPressed("COM1", 55)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 62)/(-128))+(HIDMacros.IsButtonPressed("COM1", 63)/(-128))= 4 then
com1_wholeleft_33 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 54)/(-128))+(HIDMacros.IsButtonPressed("COM1", 55)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 59)/(-128))+(HIDMacros.IsButtonPressed("COM1", 63)/(-128))= 4 then
com1_wholeleft_34 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 54)/(-128))+(HIDMacros.IsButtonPressed("COM1", 55)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 59)/(-128))+(HIDMacros.IsButtonPressed("COM1", 62)/(-128))= 4 then
com1_wholeleft_35 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 54)/(-128))+(HIDMacros.IsButtonPressed("COM1", 55)/(-128)))+(HIDMacros.IsButtonPressed("COM1", 58)/(-128))+(HIDMacros.IsButtonPressed("COM1", 62)/(-128))= 4 then
com1_wholeleft_36 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 42)/(-128))+(HIDMacros.IsButtonPressed("COM1", 47)/(-128))= 2) then
com1_decleft_00 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 47)/(-128))+(HIDMacros.IsButtonPressed("COM1", 48)/(-128))= 2) then
com1_decleft_10 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 46)/(-128))+(HIDMacros.IsButtonPressed("COM1", 48)/(-128))= 2) then
com1_decleft_20 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 46)/(-128))+(HIDMacros.IsButtonPressed("COM1", 47)/(-128))= 2) then
com1_decleft_30 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 43)/(-128))+(HIDMacros.IsButtonPressed("COM1", 47)/(-128))= 2) then
com1_decleft_40 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 43)/(-128))+(HIDMacros.IsButtonPressed("COM1", 46)/(-128))= 2) then
com1_decleft_50 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 42)/(-128))+(HIDMacros.IsButtonPressed("COM1", 46)/(-128))= 2) then
com1_decleft_60 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 42)/(-128))+(HIDMacros.IsButtonPressed("COM1", 43)/(-128))= 2) then
com1_decleft_70 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 43)/(-128))+(HIDMacros.IsButtonPressed("COM1", 48)/(-128))= 2) then
com1_decleft_80 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 42)/(-128))+(HIDMacros.IsButtonPressed("COM1", 48)/(-128))= 2) then
com1_decleft_90 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 40)/(-128))= 1 )then
com1_lastleft_0 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 39)/(-128))= 1 )then
com1_lastleft_2 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 38)/(-128))= 1 )then
com1_lastleft_5 = 1
end if
if ((HIDMacros.IsButtonPressed("COM1", 35)/(-128))= 1 )then
com1_lastleft_7 = 1
end if
left_com1_frequency_whole = com1_wholeleft_18 * 118 + com1_wholeleft_19 * 119 + com1_wholeleft_20 * 120 + com1_wholeleft_21 * 121 + com1_wholeleft_22 * 122 + com1_wholeleft_23 * 123 + com1_wholeleft_24 * 124 + com1_wholeleft_25 * 125 + com1_wholeleft_26 * 126 + com1_wholeleft_27 * 127 + com1_wholeleft_28 * 128 + com1_wholeleft_29 * 129 + com1_wholeleft_30 * 130 + com1_wholeleft_31 * 131 + com1_wholeleft_32 * 132 + com1_wholeleft_33 * 133 + com1_wholeleft_34 * 134 + com1_wholeleft_35 * 135 + com1_wholeleft_36 * 136 + 0
left_com1_frequency_decimal = com1_decleft_00 * 0 + com1_decleft_10 * 0.1 + com1_decleft_20 * 0.2 + com1_decleft_30 * 0.3 + com1_decleft_40 * 0.4 + com1_decleft_50 * 0.5 + com1_decleft_60 * 0.6 + com1_decleft_70 * 0.7 + com1_decleft_80 * 0.8 + com1_decleft_90 * 0.9
left_com1_frequency_last = com1_lastleft_0 * 0 + com1_lastleft_2 * 0.02 + com1_lastleft_5 * 0.05 + com1_lastleft_7 * 0.07
left_com1_freq = left_com1_frequency_whole + left_com1_frequency_decimal + left_com1_frequency_last
left_com1_active=HIDMacros.IsButtonPressed("COM1", 5)/(-128)
com1_result = (right_com1_freq * right_com1_active + left_com1_freq * left_com1_active)*100
HIDMacros.FSXEvent "COM_RADIO_SET", "&h"&com1_result
'HIDMacros.Debug(com1_result)
end sub