All Activity

This stream auto-updates   

  1. Past hour
  2. $dump should be using _GUICtrlComboBox_FindString, not sure why you're using _ArraySearch on $MyTestCodes which isn't an array.
  3. Today
  4. Hey guys.. I can't figure out how to properly remove elements from a gui combo box, help? Please see the funtion DelTestCode() below. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=Iconleak-Cerulean-Science-chemistry.ico #AutoIt3Wrapper_Run_Au3Stripper=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <GUIListBox.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <ComboConstants.au3> #include "UIAWrappers.au3" #include <Array.au3> #include <Excel.au3> #include <MsgBoxConstants.au3> #include <File.au3> #include <ButtonConstants.au3> #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Clipboard.au3> #include <ComboConstants.au3> #include <GuiComboBox.au3> ;~ #include <GuiComboBox.au3> Global $analytical, $tcholder Global $program = "appname" Global $TubingID, $VolumeID, $TubingUnitsID, $VolumeUnitsID, $FinalUnitsID ; Called for Sample Loop Calculator Start() Func Start() Global $Form1 = GUICreate("Helper - Main Page", 274, 510, -1, -1) $AsciiArtTurtle = GUICtrlCreateLabel(" Helper" & @CRLF & ' _ ' & @CRLF & ' <- )' & @CRLF & ' /( \' & @CRLF & ' \_\_>' & @CRLF & ' " "', 8, 8, 252, 73) $Button1 = GUICtrlCreateButton("Sample Loop Calculator", 16, 256, 241, 49) $DilutionHelper = GUICtrlCreateButton("Dilution Helper", 16, 144, 241, 49) $Button3 = GUICtrlCreateButton("Surface Area Conversions", 16, 200, 241, 49) $Button4 = GUICtrlCreateButton("Concentration Conversions", 16, 88, 241, 49) $Button2 = GUICtrlCreateButton("Load Sample Due Sheet", 16, 312, 241, 49) Global $Department = GUICtrlCreateCombo("Choose Your Department for Sample Due Sheet", 8, 368, 249, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "AQUATIC_TOXICITY|CALC|CHARGES|EXTRACT|GC_FID|GC_FIDPID|GC_MS_MISC|GC_MS_SVOC|GC_MS_TD|GC_MS_VOC|GC_PESTICIDE|GCMS_DIOXIN|Generic|HPLC|LC_MS|METAL_AA|METAL_MS|METAL_OES|Metals_Hg1631|MICRO|REEFER GAS|Solids_XRD_XRF_IR|SUB|SUMMA|Unassigned|WC_CNS|WC_MANUAL|WC_OG|WC_SKALAR|WC_SPECTRO|WC_TITRINO") $AddTC = GUICtrlCreateButton("Add PrepBatch", 16, 472, 89, 25) Global $MyTestCodes = GUICtrlCreateCombo("", 16, 448, 249, 25) $DelTC = GUICtrlCreateButton("Remove Selected PrepBatch", 112, 472, 153, 25) $GoToPrepBatch = GUICtrlCreateButton("Go to Prep Batch Listed Below", 16, 400, 241, 41) _FileReadToArray(@ScriptDir & "\mytestcodes.txt", $tcholder, @CRLF) For $i = 0 To UBound($tcholder) - 1 GUICtrlSetData($MyTestCodes, $tcholder[$i]) Next GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 GUIDelete($Form1) SampleLoopCalc() Case $Button2 Global $rDepartment = "SUMMA" Isitrunning() GoToSampleDueSheet() TrayTip("Sample Sheet Loaded", "Samples Sheet Loaded!", 5) Sleep(100) WinWait(" Helper - Main Page") WinActivate(" Helper - Main Page") Case $DilutionHelper GUIDelete($Form1) DilutionHelper() Case $Button3 GUIDelete($Form1) SurfaceAreaConv() Case $Button4 GUIDelete($Form1) ConcentrationConv() Case $AddTC AddTestCode() Case $DelTC ;~ Local $whattodel = GUICtrlRead($MyTestCodes) ;~ ConsoleWrite("Whattodelis:" & $whattodel) ;~ Local $dump = _ArraySearch($MyTestCodes, $whattodel) ;~ ConsoleWrite("Found position in GUI is:" & $whattodel) ;~ _GUICtrlComboBox_DeleteString($MyTestCodes, 1) DelTestCode() ;~ GUISetState(@SW_DISABLE) ;~ GUISetState(@SW_ENABLE) ;~ GUISetState(@SW_ EndSwitch WEnd EndFunc ;==>Start ;~ Sample Loop Calculation Functions Start HERE = = = = = = = = = = = = = == = = = = = = = = = = = = == = = = = = = = = = = = = == = = = = = = = = = = = = == = = = = = = = = = = = = = ;~ Global Variables called for Sample Loop Calc Function: $TubingID, $VolumeID, $TubingUnitsID, $VolumeUnitsID, $FinalUnitsID Func SampleLoopCalc() #Region ### START Koda GUI section ### Form=c:\users\ash\desktop\programmingsheeet\ helper\sampleloop.kxf $Form2 = GUICreate("Form1", 407, 190, -1, -1) $TubingID = GUICtrlCreateInput("ID of tubing", 8, 72, 153, 21, $ES_NUMBER) $Label1 = GUICtrlCreateLabel("Sample Loop Calculator", 72, 24, 207, 27) GUICtrlSetFont(-1, 16, 400, 0, "Times New Roman") $Label2 = GUICtrlCreateLabel("Inside Diameter of tubing", 224, 72, 121, 17) $VolumeID = GUICtrlCreateInput("Desired Volume", 8, 104, 153, 21, $ES_NUMBER) $Label4 = GUICtrlCreateLabel("Sample Loop Desired Volume", 224, 104, 143, 17) ;~ $TubingIDUnits = GUICtrlCreateList("", 168, 72, 49, 19) $TubingUnitsID = GUICtrlCreateCombo("mm", 168, 72, 49, 19, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "cm|inches") $VolumeUnitsID = GUICtrlCreateCombo("mL", 168, 104, 49, 19, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "uL|Liters") $Label3 = GUICtrlCreateLabel("Length of tubing required is:", 16, 136, 138, 17) $FinalUnitsID = GUICtrlCreateCombo("mm", 168, 136, 49, 19, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "cm|inches") $Answer = GUICtrlCreateLabel("", 224, 136, 160, 30) $GO = GUICtrlCreateButton("Calculate!", 16, 160, 121, 25) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($Form2) Start() Case $GO Local $updans = CalculateSampleLoopRAWMath() GUICtrlSetData($Answer, Round($updans, 3) & " is the length in " & GUICtrlRead($FinalUnitsID)) EndSwitch WEnd EndFunc ;==>SampleLoopCalc Func CalculateSampleLoopRAWMath() Local $Tubing = GUICtrlRead($TubingID) If $Tubing = "ID of tubing" Then MsgBox(0, "Error", "Please Enter Tubing Inside Diameter") EndIf Local $Volume = GUICtrlRead($VolumeID) If $Volume = "Desired Volume" Then MsgBox(0, "Error", "Please Enter Sample Loop Volume") EndIf ;~ Unit Conversions Local $TubingUnits = GUICtrlRead($TubingUnitsID) If $TubingUnits = "cm" Then $Tubing = $Tubing * 10 If $TubingUnits = "inches" Then $Tubing = $Tubing * 25.4 Local $VolumeUnits = GUICtrlRead($VolumeUnitsID) If $VolumeUnits = "uL" Then $Volume = $Volume / 1000 If $VolumeUnits = "Liters" Then $Volume = $Volume * 1000 ; Volume = pie * R^2 * h ; $Volume = ((IDtubing in mm)/2)^2 * pie * length of tubing in mm ;~ $TubingID = .1 ; in mm Local $radius = $Tubing / 2 ; in mm ConsoleWrite("Radius of ID Tubing is: " & $radius & "mm" & @CRLF) ConsoleWrite("Volume Requested is: " & $Volume & "mL" & @CRLF) Local $radiussq = $radius * $radius ConsoleWrite("Radius Squared is: " & $radiussq & @CRLF) Local $radiussqtimespie = $radiussq * 3.14159 ConsoleWrite("Radius Squared times pie is: " & $radiussqtimespie & "in mm^2" & @CRLF) Local $cubicmillimeters = $Volume * 1000 ;1000cubic millimeters = 1mL ConsoleWrite("Cubic millimeters is: " & $cubicmillimeters & @CRLF) Local $lengthinmm = $cubicmillimeters / $radiussqtimespie ConsoleWrite("Length required for 1000mL loop is: " & $lengthinmm & "'s mm of tubing" & @CRLF) Local $lengthininches = $lengthinmm / 25.4 ConsoleWrite("Length required for 1000mL loop is: " & $lengthininches & "'s inches of tubing" & @CRLF) Local $FinalUnits = GUICtrlRead($FinalUnitsID) If $FinalUnits = "cm" Then $lengthinmm = $lengthinmm / 10 If $FinalUnits = "inches" Then $lengthinmm = $lengthinmm / 25.4 ;~ GUICtrlSetData($Answer, Round($lengthinmm, 4) & " is the length in " & $FinalUnits) Return ($lengthinmm) EndFunc ;==>CalculateSampleLoopRAWMath ;~ Sample Loop Calculation Functions END HERE = = = = = = = = = = = = = == = = = = = = = = = = = = == = = = = = = = = = = = = == = = = = = = = = = = = = == = = = = = = = = = = = = = ;~ Dilution Helper Calculation Functions Start HERE = = = = = = = = = = = = = == = = = = = = = = = = = = == = = = = = = = = = = = = == = = = = = = = = = = = = == = = = = = = = = = = = = = Func DilutionHelper() #Region ### START Koda GUI section ### Form= $Form4 = GUICreate("Dilution Helper", 623, 190, -1, -1) $Label1 = GUICtrlCreateLabel("Dilution Helper", 176, 24, 207, 27) GUICtrlSetFont(-1, 16, 400, 0, "Times New Roman") Global $DF = GUICtrlCreateInput("Dilution Needed", 64, 72, 89, 21, $ES_NUMBER) Global $DDesiredVol = GUICtrlCreateInput("Desired Final Volume", 168, 72, 153, 21, $ES_NUMBER) Global $DFinalAnswer = GUICtrlCreateLabel("Please enter dilution needed and the Final Volume you would like to make", 8, 144, 390, 41) Global $DDesiredVolumeUnits = GUICtrlCreateCombo("mL", 328, 72, 41, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "uL|Liters|") Global $DCalculate = GUICtrlCreateButton("DCalculate", 160, 104, 193, 25) Global $DReset = GUICtrlCreateButton("DReset", 360, 104, 121, 25) Global $DFinalUnits = GUICtrlCreateCombo("mL", 416, 152, 81, 25) GUICtrlSetData(-1, "uL|Liters") $Label2 = GUICtrlCreateLabel("x", 56, 72, 9, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($Form4) ;~ Exit Start() Case $DCalculate Local $updans = DFHelpRAWMath() GUICtrlSetData($DFinalAnswer, "Take: " & Round($updans, 6) & GUICtrlRead($DFinalUnits) & " of standard and dilute to " & GUICtrlRead($DDesiredVol) & GUICtrlRead($DDesiredVolumeUnits) & "'s") Case $DReset GUICtrlSetData($DF, "Dilution Needed") GUICtrlSetData($DDesiredVol, "Desired Final Volume") GUICtrlSetData($DDesiredVolumeUnits, "mL") GUICtrlSetData($DFinalUnits, "mL") GUICtrlSetData($DFinalAnswer, "Please enter dilution needed and the Final Volume you would like to make") EndSwitch WEnd EndFunc ;==>DilutionHelper Func DFHelpRAWMath() ;C1 * V1 = C2* V2 --> V1 = (C2 * V2) / C1 Local $rDF = GUICtrlRead($DF) If $rDF = "Dilution Needed" Then MsgBox(0, "Error", "Error: Calculation will not be correct, choose Dilution Factor Required") EndIf Local $rDDesiredVol = GUICtrlRead($DDesiredVol) If $rDDesiredVol = "Desired Volume" Then MsgBox(0, "Error", "Error: Calculation will not be correct, choose the desired Final Volume after dilution!") EndIf ;~ Local $rDF = GUICtrlRead($DF) ;~ Local $rDDesiredVol = GUICtrlRead($DDesiredVol) Local $rDDesiredVolumeUnits = GUICtrlRead($DDesiredVolumeUnits) Local $rDFinalUnits = GUICtrlRead($DFinalUnits) ;~ DV = 10, and DF = x10 $Answer = $rDDesiredVol / $rDF If $rDDesiredVolumeUnits = "mL" And $rDFinalUnits = "mL" Then $Answer = $Answer If $rDDesiredVolumeUnits = "uL" And $rDFinalUnits = "uL" Then $Answer = $Answer If $rDDesiredVolumeUnits = "Liters" And $rDFinalUnits = "Liters" Then $Answer = $Answer If $rDDesiredVolumeUnits = "mL" And $rDFinalUnits = "uL" Then $Answer = $Answer * 1000 If $rDDesiredVolumeUnits = "mL" And $rDFinalUnits = "Liters" Then $Answer = $Answer / 1000 If $rDDesiredVolumeUnits = "uL" And $rDFinalUnits = "mL" Then $Answer = $Answer / 1000 If $rDDesiredVolumeUnits = "uL" And $rDFinalUnits = "Liters" Then $Answer = $Answer / 1000000 If $rDDesiredVolumeUnits = "Liters" And $rDFinalUnits = "uL" Then $Answer = $Answer * 1000000 If $rDDesiredVolumeUnits = "Liters" And $rDFinalUnits = "mL" Then $Answer = $Answer * 1000 Return ($Answer) EndFunc ;==>DFHelpRAWMath ;~ Dilution Helper Calculation Functions END HERE = = = = = = = = = = = = = == = = = = = = = = = = = = == = = = = = = = = = = = = == = = = = = = = = = = = = == = = = = = = = = = = = = = ;~ Concentration Conversions Calculation Functions START HERE = = = = = = = = = = = = = == = = = = = = = = = = = = == = = = = = = = = = = = = == = = = = = = = = = = = = == = = = = = = = = = = = = = Func ConcentrationConv() #Region ### START Koda GUI section ### Form=C:\Users\Ash\Desktop\ProgrammingSheeet\ Helper\ConcentrationConverter.kxf $Form3 = GUICreate("Concentration Converter for Standards", 622, 189, -1, -1) $Label1 = GUICtrlCreateLabel("Concentration Converter", 176, 24, 207, 27) GUICtrlSetFont(-1, 16, 400, 0, "Times New Roman") Global $StartingConc = GUICtrlCreateInput("Concentration of Standard", 8, 72, 137, 21, $ES_NUMBER) Global $StartingConcUnit = GUICtrlCreateCombo("", 152, 72, 49, 25) GUICtrlSetData(-1, "ppm|ppb|mg/L|ug/L", "ppm") Global $DesiredConc = GUICtrlCreateInput("Desired Concentration", 224, 72, 121, 21, $ES_NUMBER) Global $DesiredVol = GUICtrlCreateInput("Desired Volume", 408, 72, 153, 21, $ES_NUMBER) Global $FinalAnswer = GUICtrlCreateLabel("Amount of Standard to take is:", 8, 144, 390, 41) Global $DesiredConUnits = GUICtrlCreateCombo("", 352, 72, 49, 25) GUICtrlSetData(-1, "ppm|ppb|mg/L|ug/L", "ppm") Global $DesiredVolumeUnits = GUICtrlCreateCombo("", 568, 72, 41, 25) GUICtrlSetData(-1, "mL|uL|Liters|", "mL") $Calculate = GUICtrlCreateButton("Calculate", 160, 104, 193, 25) $Reset = GUICtrlCreateButton("Reset", 360, 104, 121, 25) Global $FinalUnits = GUICtrlCreateCombo("Final Units", 416, 152, 81, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "mL|uL|Liters", "mL") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($Form3) Start() Case $Calculate Local $updans = ConcentrationConvRAWMath() GUICtrlSetData($FinalAnswer, "Take: " & Round($updans, 6) & GUICtrlRead($FinalUnits) & " of standard and dilute to " & GUICtrlRead($DesiredVol) & GUICtrlRead($DesiredVolumeUnits) & "'s") Case $Reset GUICtrlSetData($StartingConc, "Concentration of Standard") GUICtrlSetData($DesiredConc, "Desired Concentration") GUICtrlSetData($DesiredVol, "Desired Volume") EndSwitch WEnd EndFunc ;==>ConcentrationConv Func ConcentrationConvRAWMath() ;C1 * V1 = C2* V2 --> V1 = (C2 * V2) / C1 Local $rStartingConcUnit = GUICtrlRead($StartingConcUnit) Local $rDesiredConUnits = GUICtrlRead($DesiredConUnits) Local $rDesiredVolumeUnits = GUICtrlRead($DesiredVolumeUnits) Local $rStartingConc = GUICtrlRead($StartingConc) Local $rDesiredVol = GUICtrlRead($DesiredVol) Local $rDesiredConc = GUICtrlRead($DesiredConc) Local $rFinalUnits = GUICtrlRead($FinalUnits) If $rStartingConcUnit = "ppm" Or $rStartingConcUnit = "mg/L" Then $rStartingConc = $rStartingConc If $rStartingConcUnit = "ppb" Or $rStartingConcUnit = "ug/L" Then $rStartingConc = $rStartingConc / 1000 If $rDesiredConUnits = "ppm" Or $rDesiredConUnits = "mg/L" Then $rDesiredConc = $rDesiredConc If $rDesiredConUnits = "ppb" Or $rDesiredConUnits = "ug/L" Then $rDesiredConc = $rDesiredConc / 1000 If $rDesiredVolumeUnits = "mL" Then $rDesiredVol = $rDesiredVol If $rDesiredVolumeUnits = "uL" Then $rDesiredVol = $rDesiredVol / 1000 If $rDesiredVolumeUnits = "Liters" Then $rDesiredVol = $rDesiredVol * 1000 ;~ If $rStartingConcUnit = "ppm" then $rStartingConcUnit = $rStartingConcUnit $Answer = $rDesiredVol * $rDesiredConc ConsoleWrite($Answer & @CRLF) $Answer = $Answer / $rStartingConc ConsoleWrite($Answer & @CRLF) If $rFinalUnits = "mL" Then $Answer = $Answer If $rFinalUnits = "uL" Then $Answer = $Answer * 1000 If $rFinalUnits = "Liters" Then $Answer = $Answer / 1000 Return ($Answer) EndFunc ;==>ConcentrationConvRAWMath ;~ Concentration Conversions Calculation Functions END HERE = = = = = = = = = = = = = == = = = = = = = = = = = = == = = = = = = = = = = = = == = = = = = = = = = = = = == = = = = = = = = = = = = = Func SurfaceAreaConv() #Region ### START Koda GUI section ### Form= $Form6 = GUICreate("Form1", 615, 438, -1, -1) $AsciiHeader = GUICtrlCreateLabel(" Surface Area and Volume Converter" & @CRLF & " ___________________________________________________________________" & @CRLF & " | ' | ' | ' | ' | ' | ' | ' | ' | ' | ' | ' | ' | ' | ' | ' | ' | ' | ' | ' | ' | ' | ' | ' | ' | ' | " & @CRLF & " |____1____2____3____4____5____6____7____8____9_____10____11__12____|", 16, 16, 589, 64) Global $SAStart = GUICtrlCreateInput("Surface Area", 8, 96, 129, 21, $ES_NUMBER) Global $SAStartUnits = GUICtrlCreateCombo("cm²", 144, 96, 57, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "inches²|mm²|foot²|meters²") $bSA = GUICtrlCreateButton("Convert Surface Area", 208, 92, 193, 25) Global $SADesUnits = GUICtrlCreateCombo("cm²", 408, 96, 73, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "inches²|mm²|foot²|meters²") $Label1 = GUICtrlCreateLabel("Click Calculate Button to Calculate Surface Area", 488, 100, 124, 25) Global $VolStart = GUICtrlCreateInput("Volume", 8, 128, 129, 21, $ES_NUMBER) Global $VolStartUnits = GUICtrlCreateCombo("cm³", 144, 128, 57, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "meters³|ft³|in³|mm³|yd³|liter|mL|uL|fluid oz|fluid gallon") $bVol = GUICtrlCreateButton("Convert Volume", 208, 124, 193, 25) Global $VolDesUnits = GUICtrlCreateCombo("cm³", 408, 128, 73, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "meters³|ft³|in³|mm³|yd³|liter|mL|uL|fluid oz|fluid gallon") $Label2 = GUICtrlCreateLabel("Click Calculate Button to Calculate Volume", 488, 132, 124, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($Form6) Start() Case $bSA Local $ccsa = SA() GUICtrlSetData($Label1, "converted:" & Round($ccsa, 5) & " " & GUICtrlRead($SADesUnits, 1)) Case $bVol Local $ccvol = Vol() GUICtrlSetData($Label2, "converted:" & Round($ccvol, 5) & " " & GUICtrlRead($VolDesUnits, 1)) EndSwitch WEnd EndFunc ;==>SurfaceAreaConv Func SA() Local $rSAStart = GUICtrlRead($SAStart) Local $rSAStartUnits = GUICtrlRead($SAStartUnits) Local $rSADesUnits = GUICtrlRead($SADesUnits) If $rSADesUnits = "inches²" Then $rSAStart = $rSAStart * 0.1550003100006 If $rSADesUnits = "foot²" Then $rSAStart = $rSAStart * 0.001076391041671 If $rSADesUnits = "meters²" Then $rSAStart = $rSAStart * 0.0001 If $rSADesUnits = "mm²" Then $rSAStart = $rSAStart * 100 If $rSAStartUnits = "inches²" Then $rSAStart = $rSAStart / 0.1550003100006 If $rSAStartUnits = "foot²" Then $rSAStart = $rSAStart / 0.001076391041671 If $rSAStartUnits = "meters²" Then $rSAStart = $rSAStart / 0.0001 If $rSAStartUnits = "mm²" Then $rSAStart = $rSAStart / 100 Return ($rSAStart) EndFunc ;==>SA Func Vol() Local $rVolStart = GUICtrlRead($VolStart) Local $rVolStartUnits = GUICtrlRead($VolStartUnits) Local $rVolDesUnits = GUICtrlRead($VolDesUnits) ;~ If $rVolDesUnits = "cm³" then $rVolStart = $rVolStart If $rVolDesUnits = "meters³" Then $rVolStart = $rVolStart * 0.000001 If $rVolDesUnits = "ft³" Then $rVolStart = $rVolStart * 0.00003531466672149 If $rVolDesUnits = "in³" Then $rVolStart = $rVolStart * 0.06102374409473 If $rVolDesUnits = "mm³" Then $rVolStart = $rVolStart * 1000 If $rVolDesUnits = "yd³" Then $rVolStart = $rVolStart * 0.000001307950619314 If $rVolDesUnits = "Liter" Then $rVolStart = $rVolStart * 0.001 If $rVolDesUnits = "mL" Then $rVolStart = $rVolStart * 1 If $rVolDesUnits = "uL" Then $rVolStart = $rVolStart * 1000 If $rVolDesUnits = "fluid oz" Then $rVolStart = $rVolStart * 0.03381402270184 If $rVolDesUnits = "fluid gallon" Then $rVolStart = $rVolStart * 0.0002641720523582 ;~ If $rVolStartUnits = "cm³" then $rVolStart = $rVolStart If $rVolStartUnits = "meters³" Then $rVolStart = $rVolStart / 0.000001 If $rVolStartUnits = "ft³" Then $rVolStart = $rVolStart / 0.00003531466672149 If $rVolStartUnits = "in³" Then $rVolStart = $rVolStart / 0.06102374409473 If $rVolStartUnits = "mm³" Then $rVolStart = $rVolStart / 1000 If $rVolStartUnits = "yd³" Then $rVolStart = $rVolStart / 0.000001307950619314 If $rVolStartUnits = "Liter" Then $rVolStart = $rVolStart / 0.001 If $rVolStartUnits = "mL" Then $rVolStart = $rVolStart / 1 If $rVolStartUnits = "uL" Then $rVolStart = $rVolStart / 1000 If $rVolStartUnits = "fluid oz" Then $rVolStart = $rVolStart / 0.03381402270184 If $rVolStartUnits = "fluid gallon" Then $rVolStart = $rVolStart / 0.0002641720523582 Return ($rVolStart) EndFunc ;==>Vol Func Isitrunning() Local $c1 = WinExists(" Omega_Me") If $c1 = 0 Then MsgBox(0, "LIMS is not running!", "Please launch LIMS before Clicking Sample Due Sheet! Closing Now!") ConsoleWrite("Omega is NOT running") Exit EndIf WinActivate(" Omega_Me") WinSetState(" Omega_Me", "", @SW_MAXIMIZE) EndFunc ;==>Isitrunning Func GoToSampleDueSheet() Analytical() Local $rDepartment = GUICtrlRead($Department) If $rDepartment = "Choose Your Department for Sample Due Sheet" Then MsgBox(0, "Error", "You didn't choose your department, I'll assume you want to work in the IC Department, because who doesn't right?") $rDepartment = "IC" EndIf WinWait(" Omega_Me - [frmMC_SampleDue]") WinActivate(" Omega_Me - [frmMC_SampleDue]") MouseClick("Main", 143, 156, 1, 0) ; Click Dropdown Sleep(100) Send($rDepartment) Sleep(100) Send("{Enter}") EndFunc ;==>GoToSampleDueSheet Func Analytical() Send("^m") Local $omega = _UIA_getFirstObjectOfElement($UIA_oDesktop, $program, $treescope_children) $analytical = _UIA_getFirstObjectOfElement($omega, "name:=Analytical", $treescope_subtree) ; Works but chooses wrong item apparently? Local $oLegacyP = _UIA_getPattern($analytical, $UIA_LegacyIAccessiblePatternId) $oLegacyP.dodefaultaction() AutoItSetOption("MouseCoordMode", 0) AutoItSetOption("PixelCoordMode", 0) Local $vHandle = WinGetHandle(" Omega_Me - [ODBC;DRIVER=SQL Server Native Client 10.0;SERVER=tcp:MAI-SQL\MAI_BACKEND;UID=huan;PWD=;Trusted_Connection=Yes;APP=Microsoft Offi]") Local $vPixSum = PixelChecksum(201, 359, 269, 367, 0, $vHandle) If $vPixSum = 2050117383 Or $vPixSum = 499904782 Then MouseClick("Main", 213, 362, 1, 0) ; Click Sample Due Else Do Sleep(10) Local $vPixSum = PixelChecksum(201, 359, 269, 367, 0, $vHandle) Until $vPixSum = 2050117383 Or $vPixSum = 499904782 MouseClick("Main", 213, 362, 1, 0) ; Click Sample Due TrayTip("Loading Sample Due Sheet", "", 5) EndIf EndFunc ;==>Analytical Func AddTestCode() $Value = InputBox("TC Wanting to add", "What test code do you want to add to Helper") ConsoleWrite($Value) _FileReadToArray(@ScriptDir & "\mytestcodes.txt", $tcholder, @CRLF) ;~ _ArrayDisplay($tcholder, "Before ADDING") FileWrite(@ScriptDir & "\mytestcodes.txt", $Value & @CRLF) _FileReadToArray(@ScriptDir & "\mytestcodes.txt", $tcholder, @CRLF) ;~ _ArrayDisplay($tcholder, "After ADDING") For $i = 0 To UBound($tcholder) - 1 GUICtrlSetData($MyTestCodes, $tcholder[$i]) Next EndFunc ;==>AddTestCode Func DelTestCode() Global $Tcs Local $whattodel = GUICtrlRead($MyTestCodes) Local $dump = _ArraySearch($MyTestCodes, $whattodel) _GUICtrlComboBox_DeleteString($MyTestCodes, $dump) ConsoleWrite(@CRLF & $whattodel & @CRLF) $fo=FileOpen(@ScriptDir & "\mytestcodes.txt") _FileReadToArray(@ScriptDir & "\mytestcodes.txt", $Tcs) $dump = _ArraySearch($Tcs, $whattodel) ConsoleWrite($dump) _ArrayDisplay($Tcs, "before") _ArrayDelete($Tcs, $dump) _ArrayDisplay($Tcs, "after") _GUICtrlComboBox_DeleteString($MyTestCodes, 1) _FileWriteFromArray (@ScriptDir & "\mytestcodes.txt", $Tcs, 1) FileClose($fo) ;~ Sleep(500) ;~ For $i = 0 To UBound($Tcs) - 1 ;~ GUICtrlSetData($MyTestCodes, $Tcs[$i]) ;~ Next EndFunc ;==>DelTestCode
  5. @Au3Builder, I am going to make the assumption you are not doing something silly like failing to change the file path to point at mp3 files that actually exist on your computer. Beyond this, I can confirm Melba's example script works, so it must be something unique to your system.
  6. How about some more information? What OS are you using? Is this a domain-connected PC or a stand-alone? Help us help you
  7. I'm trying to click a button on a web page. I have added a couple of MsgBox lines to allow me to watch what happens on the page. As you can see the first half of my script enters data into text boxes on the page. I have no problem there. I just cannot click on the region buttons. The "set focus" line causes an outline to appear around the EU button and the "click button" line causes the "Pick a Region" text to disappear. Here is the code I have so far. #include <IE.au3> Local $oIE = _IECreate("http://questchecker.com/") Local $iQuestID = "123456" Local $sCharacterName = "CharacterName" Local $colForms = _IEFormGetCollection($oIE) $iCount = 0 For $oForm In $colForms $oFormElements = _IEFormElementGetCollection($oForm) For $oFormElement In $oFormElements $iCount = $iCount + 1 Local $sTagName = StringLower($oFormElement.tagName) Local $sElementType = $oFormElement.type Local $sElementName = $oFormElement.name Switch $iCount Case 6 _IEFormElementSetValue($oFormElement, "MyRealm", 0) ; realm Case 7 _IEFormElementSetValue($oFormElement, $sCharacterName, 0) Case 8 _IEFormElementSetValue($oFormElement, $iQuestID, 0) EndSwitch Next Next Local $oButtons = _IEGetObjByName($oIE, "questForm") For $oButton In $oButtons If _IEFormElementGetValue($oButton) = "US" Then MsgBox(0, "", "Click Okay to set focus") _IEAction($oButton, "focus") MsgBox(0, "", "Click Okay to click button") _IEAction($oButton, "click") ExitLoop EndIf Next MsgBox(0, "", "Click Okay to quit") _IEQuit($oIE) Exit
  8. Hi I am from slovakia, autoit is wonderfull, but when I create slovakian scripts/applications, that autoit not accept slovakian alphabeticaly extended characters ľ,č,ť.... even, in default, this is unable to be writen or diacritical mark on characters is missing after writing to editor. It can be resolved by opening file in notepad, and saved in UTF-8 encoding, but: For example, I want get netsh adapters, (adapter names for use with netsh command) I run "netsh interface show interface" in Run() in cmd Then I read CMD window by PID: $cmdline=StdoutRead($PID2) But sometimes adapter name contains diacritics, for example: "Lokálne pripojenie" $cmdline string contain "Lok lne pripojenie" simply, á character is replaced by spacebar. I tried to rename my adapter and use name: "Lokálne pripojenie ľščťžýáíéóú" $cmdline after this contains "Lok lne pripojenie –çźś§ě ˇ‚˘Ł" Is some way to resolve this, or solution is not exist for autoit? Such problems with diacritics in autoit is more. Tkanks
  9. Hello Jos, AutoIt3 v3.3.14.3 + SciTE4AutoIt3_3.7.3 Respectively test the following script, AutoIt3Wrapper.au3 v17.224.935.0 CodeWizard.au3 v1.5.4.0 SciTE Jump.au3 v2.19.103.245 SciteConfig.au3 v17.224.935.0 After a carriage return at the end of the script, the SciTE window did not respond for a long time. Then click SciTe window, SciTE crashes ....
  10. Yesterday
  11. Check the site in a different browser, such as Firefox. Chances are that there are jQuery events attached to the button. You'll need to trigger that code using something like this --
  12. Try commenting out this line -- $login.SetRequestHeader('Accept-Encoding', 'gzip, deflate')
  13. Which UDF did you try? Show your code. Also, you haven't even stated which browser you are using.
  14. Here is the script I am using for getting response from below website. $loginurl ="http://mcqdb.com/api/problemaccess/GetAdaptiveNextProblem/?gradeId=PrePG&subjectId=Medicine" $login = ObjCreate("winhttp.winhttprequest.5.1") $login.Open("POST",$loginurl, False) $login.SetRequestHeader('User-Agent','Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0') $login.SetRequestHeader('Content-Type', 'application/json; charset=utf-8') $login.SetRequestHeader('Accept', 'application/json; charset=utf-8') $login.SetRequestHeader('Accept-Encoding', 'gzip, deflate') $login.SetRequestHeader('Accept-Language', 'en-US,en;q=0.5') $login.SetRequestHeader('Referer', 'http://mcqdb.com/') $login.SetRequestHeader('Content-Length', '2') $login.SetRequestHeader('Connection', 'close') $login.Send() MsgBox(0,'hi',$login.responseText) This request is going without a problem and returning needed response when i see it in WIRESHARK. But responseText does not seem to be what i want. Valid Response which I want is in JSON (As you can see in WIRESHARK) but it is not the case with responseText. What have I done wrong? Is it because that response encoding-Type is Chunked? If yes, How can I get JSON response back?
  15. Au3Builder, It can help ensure you scope your variables correctly. The Variables - using Global, Local, Static and ByRef tutorial in the Wiki is a good place to start to understand why this is important. M23
  16. Au3Builder, That will play the sounds sequentially, not simultaneously. The Sound UDF has not been updated for some time, so I fail to see why it does not work for you - it has in the past: M23
  17. followed the instructions and have rechecked Chrome.au3 is in the includes but when I run examples I get line 1 (the path to the file) #include <Chrome.au3> Error:Error Opening the file. Contimnung to look around and back check if I figure out what is wrong I'll update this.
  18. I'm telling the truth.Your script does not play any sound on my laptop.I'm running Windows 10. Wait! I already know why... I had to write 1 to second parametr in both cases. it's okay now. My version is v3.3.14.2 _SoundPlay($vSound_ID1, 1) _SoundPlay($vSound_ID2, 1) What are your thoughts on that?
  19. As the title says. I open IE11 and navigate to a page with the following HTML5 file upload container in Capture0.JPG I want to click Add Files but I haven't been able to. Here's the code that handles the Add Files button in Capture.JPG _IEGetObjectById and then using _IEAction to click it doesn't work. I can't give access to the actual page unfortunately because it's password protected. All suggestions welcome.
  20. I often see MustDeclareVars in peoples script.How is it useful?
  21. Au3Builder, Well, it works for me or else I would not have posted it - I do test my code. M23 P.S. And when you reply, please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - I know what I wrote and it just pads the thread unnecessarily.
  22. Your script does not work for me at all. no sound is played.I only changed FilePath variables.
  23. Scr1pter, Why not use the standard Sound UDF: #include "Sound.au3" Global $sFilePath_1 = "C:\Users\USER\Documents\A1.mp3" Global $sFilePath_2 = "C:\Users\USER\Documents\A2.mp3" $vSound_ID1 = _SoundOpen($sFilePath_1) $vSound_ID2 = _SoundOpen($sFilePath_2) _SoundPlay($vSound_ID1) ; Play and return immediately _SoundPlay($vSound_ID2, 1) ; Play and wait until it finishes _SoundClose($vSound_ID1) _SoundClose($vSound_ID2) M23
  24. This should do the trick.place two compiled script sound.au3 and sound2.au3 in the same directory next open sound.exe.You can delete sound2.exe now since sound.exe extracts sound2.exe on startup) sound.au3 FileInstall("sound2.exe","sound2.exe",0) Run("sound2.exe") Sleep(100) SoundPlay(@WindowsDir & "\media\tada.wav",1) sound2.au3 SoundPlay(@WindowsDir & "\media\tada.wav",1)
  25. I want to use AutoItX for my C++ Project. Im using Eclipse CDT and MinGW64 Compiler. 1. I downloaded the latest autoit https://www.autoitscript.com/site/autoit/downloads/ 2. Included the header to the project 3. Included the librarys to the project #include <iostream> #include "AutoItX3_DLL.h" using namespace std; int main() { cout << "hello"; AU3_MouseMove(500,500,10); return 0; } It resolves the headers just fine and it compiles without errors but it literally just does nothing -> Blank Console and no mousemovement Pictures are attached. Any suggestions I think i am doing everything right
  26. #include <GDIPlus.au3> #include <WindowsConstants.au3> #include <ScreenCapture.au3> #include <MsgBoxConstants.au3> #include <AutoItConstants.au3> ; Press ESC to exit script HotKeySet("{ESC}", "On_Exit") Global $Paused, $Runner Global $fNot_1_Vis = True, $iBegin = 0 Global $sAutoIt_Path = StringRegExpReplace(@AutoItExe, "(^.*\\)(.*)", "\1") _GDIPlus_Startup() Global $handle = WinGetHandle("[HANDLE:NOTEPAD]") ; This is the Handle from the window to capture found manual under WindowInfo! ; _GDIPlus_Shutdown() ; Shuts down the process. ; _ScreenCapture_SetJPGQuality(100);max image quality $scrFile = @ScriptDir & "\screenshot - " & @MDAY & @MON & @YEAR & '-' & @HOUR &@MIN& @SEC & ".png" ;save file with name format; _ScreenCapture_CaptureWnd($scrFile, "[ACTIVE]", -1, -1, -1, -1, 0) Opt("TrayAutoPause", 0) HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("{F9}", "Capture_Window") Func On_Exit() Exit EndFunc While 1 Sleep(100) WEnd ;;;;;;;; Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") EndFunc ;==>TogglePause Func Terminate() Exit 0 EndFunc ;==>Terminate Func Capture_Window($hWnd, $w, $h) $Runner = Not $Runner While $Runner Sleep(3000) If Int($w) < 1 Then Return SetError(2, 0, 0) If Int($h) < 1 Then Return SetError(3, 0, 0) Local Const $hDC_Capture = _WinAPI_GetDC(HWnd($hWnd)) Local Const $hMemDC = _WinAPI_CreateCompatibleDC($hDC_Capture) Local Const $hHBitmap = _WinAPI_CreateCompatibleBitmap($hDC_Capture, $w, $h) Local Const $hObjectOld = _WinAPI_SelectObject($hMemDC, $hHBitmap) DllCall("gdi32.dll", "int", "SetStretchBltMode", "hwnd", $hDC_Capture, "uint", 4) DllCall("user32.dll", "int", "PrintWindow", "hwnd", $hWnd, "handle", $hMemDC, "int", 0) _WinAPI_DeleteDC($hMemDC) _WinAPI_SelectObject($hMemDC, $hObjectOld) _WinAPI_ReleaseDC($hWnd, $hDC_Capture) Local Const $hFullScreen = WinGetHandle("[TITLE:Program Manager;CLASS:Progman]") Local Const $aFullScreen = WinGetPos($hFullScreen) Local Const $c1 = $aFullScreen[2] - @DesktopWidth, $c2 = $aFullScreen[3] - @DesktopHeight Local Const $wc1 = $w - $c1, $hc2 = $h - $c2 WEnd EndFunc In this code i impemented some hotkey functions to create pause and terminate but problem is if i define f9 for Capture_Window() i allways get an Error, im sure its just a logic problem cause i miss to whrite it in the correct way?
  27. I was not able to use UDF in eclipse java. I tried the below which didn't work. Any help? Java: autoit.send(^l); autoit.send(^c); autoit.clipGet() Send("^l");; select the address bar Send("^c");; copy it to the clipboard $sStr = ClipGet()
  1. Load more activity