#region --- GuiBuilder code Start --- ; Script generated by AutoBuilder 0.6 Prototype #include #cs #include GUICreate("Quadratic Calculator", 164, 285, (@DesktopWidth - 164) / 2, (@DesktopHeight - 285) / 2, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $pre = GUICtrlCreateLabel("This calculator is for sniper.", 10, 10, 150, 40) $al = GUICtrlCreateLabel("Size", 10, 60, 60, 20) $a = GUICtrlCreateInput("", 80, 60, 70, 20) $bl = GUICtrlCreateLabel("MillDot", 10, 90, 60, 20) $b = GUICtrlCreateInput("", 80, 90, 70, 20) $cl = GUICtrlCreateLabel("Wind", 10, 120, 60, 20) $c = GUICtrlCreateInput("", 80, 120, 70, 20) $calc = GUICtrlCreateButton("Calculate", 40, 160, 80, 20) $ans = GUICtrlCreateLabel("Answers will return here.", 10, 200, 150, 80) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit ElseIf $msg = 10 Then NumCheck() EndIf WEnd Exit Func QuadCalc($a, $b, $c) $x = ($a*25.4)/$b ;$x = -1* ($b) / (2 * $a) ;$y = $a* ($x * $x) + $b* ($x) + $c GUICtrlSetData($ans, "The distance is (" & $x & ") ") ; "," & $x & [(x,y)] EndFunc ;==>QuadCalc Func NumCheck() $varA = GUICtrlRead($a) $varB = GUICtrlRead($b) $varC = GUICtrlRead($c) ;Check if numbers(To be worked out) QuadCalc($varA, $varB, $varC) EndFunc ;==>NumCheck #ce GuiCreate("MyGUI", 232, 232,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Input_1 = GuiCtrlCreateInput("Dist_1", 80, 30, 60, 20) $Input_2 = GuiCtrlCreateInput("Elev_1", 130, 30, 60, 20) $Input_3 = GuiCtrlCreateInput("Wind_1", 180, 30, 60, 20) $Input_4 = GuiCtrlCreateInput("Dist_2", 80, 60, 60, 20) $Input_5 = GuiCtrlCreateInput("Elev_2", 130, 60, 60, 20) $Input_6 = GuiCtrlCreateInput("Wind_2", 180, 60, 60, 20) $Input_7 = GuiCtrlCreateInput("Size", 80, 90, 60, 20) $Input_8 = GuiCtrlCreateInput("MillDot", 130, 90, 60, 20) $Input_9 = GuiCtrlCreateInput("Wind", 180, 90, 60, 20) ;$Button_10 = GuiCtrlCreateButton("Calculate", 180, 130, 60, 20) $Label_11 = GuiCtrlCreateLabel("Label11", 80, 140, 80, 30) $Label_12 = GuiCtrlCreateLabel("Label12", 80, 170, 80, 30) $Label_13 = GuiCtrlCreateLabel("Label13", 80, 200, 80, 30) $Label_14 = GuiCtrlCreateLabel("Elevation", 10, 140, 80, 30) $Label_15 = GuiCtrlCreateLabel("Wind", 10, 170, 80, 30) $Label_16 = GuiCtrlCreateLabel("Distance", 10, 200, 80, 30) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else Check();;; ;sleep(1000) EndSelect WEnd Exit Func Calc($dis1, $dis2, $ele1, $ele2, $wnd1, $wnd2, $wind, $size, $mil) $dis = ($size*25.4)/$mil ;distance [meters] $n = ($dis - $dis1 ) / ($dis2 - $dis1) ;470 - 450 / 500 - 450 = 20/50 $a = ($wnd2 - $wnd1) ;wind2 - wind1 $answer = ($a * $n) + $wnd1 ; (wind diference * queficent n ) + wind1 = wind correction queficent $answer = $answer * $wind ;wind corection [inch ] $answer = $answer/($dis/100) ;wind corection [MOA] ;$answer = $answer/3.5 ;;wind corection [MillDot] $elev = $ele2 - $ele1 ;correction difference $elev = ($elev * $n) + $ele1 ;elevation correction ;$elev = $elev * $wind ;MsgBox(0, "anser wind MOA", $answer);/3.5 Mill ;MsgBox(0, "anser elevation MOA", $elev);/3.5 Mill GUICtrlSetData($Label_11, "e (" & Round($elev, 2) & ") ") GUICtrlSetData($Label_12, "w (" & Round($answer, 2) & ") ") GUICtrlSetData($Label_13, "d (" & Round($dis, 2) & ") ") ; "," & $x & [(x,y)] EndFunc ;==>QuadCalc Func Check() $dis1 = GUICtrlRead($Input_1) $ele1 = GUICtrlRead($Input_2) $wnd1 = GUICtrlRead($Input_3) $dis2 = GUICtrlRead($Input_4) $ele2 = GUICtrlRead($Input_5) $wnd2 = GUICtrlRead($Input_6) $size = GUICtrlRead($Input_7) $mil = GUICtrlRead($Input_8) $wind = GUICtrlRead($Input_9) ;Check if numbers(To be worked out) Calc($dis1, $dis2, $ele1, $ele2, $wnd1, $wnd2, $wind, $size, $mil) EndFunc ;==>NumCheck #endregion --- GuiBuilder generated code End ---