#region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Version=Beta #AutoIt3Wrapper_Res_Fileversion=.009 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #AutoIt3Wrapper_Res_File_Add=C:\Users\Administrator\Desktop\wcmdtool64\wCmdtool.exe #AutoIt3Wrapper_Res_File_Add=C:\Users\Administrator\Desktop\wcmdtool64\imbapi.dll #AutoIt3Wrapper_Res_File_Add=C:\Users\Administrator\Desktop\wcmdtool64\SMBusOkHook64.dll #AutoIt3Wrapper_Res_File_Add=C:\Users\Administrator\Desktop\wcmdtool64\imbdrv.cat #AutoIt3Wrapper_Res_File_Add=C:\Users\Administrator\Desktop\wcmdtool64\imbdrv.inf #AutoIt3Wrapper_Res_File_Add=C:\Users\Administrator\Desktop\wcmdtool64\imbdrv.sys #AutoIt3Wrapper_Res_File_Add=C:\Users\Administrator\Desktop\wcmdtool64\IntelIPMIService.exe #AutoIt3Wrapper_Res_File_Add=C:\Users\Administrator\Desktop\wcmdtool64\SetupIMB.exe #AutoIt3Wrapper_Res_File_Add=C:\Users\Administrator\Desktop\wcmdtool64\sleep.exe #AutoIt3Wrapper_Add_Constants=n #endregion ;**** Directives created by AutoIt3Wrapper_GUI **** #include #include #include #include #include #include Opt('MustDeclareVars', 1) Local $Label1, $Label2, $Label3, $Label4, $Label5, $Label6, $Label7, $label8, $Label9, $Label10, $Label11, $Label12, $Label13, $Label14, $Label15, $label16, $msg, $Zone1updown, $GroupZone Local $Label17, $Label18, $Label19, $Label20, $Label21, $Label22, $Label23, $Label24 Local $input1, $input2, $input3, $input4, $input5, $input6, $input7, $input8 Local $Zonetxt1, $Zonetxt2, $Zonetxt3, $Zonetxt4, $Zonetxt5, $Zonetxt6, $Zonetxt7 , $Zone2updown, $Zone3updown, $Zone4updown, $Zone5updown, $Zone6updown, $Zone7updown, $Zone8updown Local $SetButton1, $SetButton2, $SetButton3, $SetButton4, $SetButton5, $SetButton6, $SetButton7, $SetButton8 Local $ReadOut1, $ReadOut2, $ReadOut3, $ReadOut4, $ReadOut5, $ReadOut6, $ReadOut7, $ReadOut8, $ReadOutText1, $ReadOutText2, $ReadOutText3, $ReadOutText4, $ReadOutText5, $ReadOutText6, $ReadOutText7, $ReadOutText8 Local $30, $31, $32, $33, $34, $35, $36, $37, $info0, $info1, $info2, $info3, $info4, $info5, $info6, $info7 Dim $LabelArray Func FanController() $ReadOutText1 = "ZONE0 RPM" $ReadOutText2 = "ZONE1 RPM" $ReadOutText3 = "ZONE2 RPM" $ReadOutText4 = "ZONE3 RPM" $ReadOutText5 = "ZONE4 RPM" $ReadOutText6 = "ZONE5 RPM" $ReadOutText7 = "ZONE6 RPM" $ReadOutText8 = "ZONE7 RPM" GUICreate("Fan Speed Control", 770, 470) ; will create a dialog box that when displayed is centered $GroupZone = GUICtrlCreateGroup("ZONES", 10, 5, 60, 450) GUICtrlCreateGroup("CURRENT STATUS", 90, 5, 150, 450) GUICtrlCreateGroup("ADJUST", 260, 5, 235, 450) GUICtrlCreateGroup("DESCRIPTION", 510, 5, 240, 450) $input1 = GUICtrlCreateInput("20", 300, 43, 85, 30) $Zone1updown = GUICtrlCreateUpdown($input1) $input2 = GUICtrlCreateInput("20", 280, 100, 75, 23) $Zone2updown = GUICtrlCreateUpdown($input2) $input3 = GUICtrlCreateInput("20", 280, 150, 75, 23) $Zone3updown = GUICtrlCreateUpdown($input3) $input4 = GUICtrlCreateInput("20", 280, 200, 75, 23) $Zone4updown = GUICtrlCreateUpdown($input4) $input5 = GUICtrlCreateInput("20", 280, 250, 75, 23) $Zone5updown = GUICtrlCreateUpdown($input5) $input6 = GUICtrlCreateInput("20", 280, 300, 75, 23) $Zone6updown = GUICtrlCreateUpdown($input6) $input7 = GUICtrlCreateInput("20", 280, 350, 75, 23) $Zone7updown = GUICtrlCreateUpdown($input7) $input8 = GUICtrlCreateInput("20", 280, 400, 75, 23) $Zone8updown = GUICtrlCreateUpdown($input8) ; Create Zone Labels $Label1 = GUICtrlCreateLabel("ZONE 0", 20, 50, 40, 20) $Label2 = GUICtrlCreateLabel("ZONE 1", 20, 100, 40, 20) $Label3 = GUICtrlCreateLabel("ZONE 2", 20, 150, 40, 20) $Label4 = GUICtrlCreateLabel("ZONE 3", 20, 200, 40, 20) $Label5 = GUICtrlCreateLabel("ZONE 4", 20, 250, 40, 20) $Label6 = GUICtrlCreateLabel("ZONE 5", 20, 300, 40, 20) $Label7 = GUICtrlCreateLabel("ZONE 6", 20, 350, 40, 20) $Label8 = GUICtrlCreateLabel("ZONE 7", 20, 400, 40, 20) $Label9 = GUICtrlCreateLabel($info0, 520, 50, 130, 20) $Label10 = GUICtrlCreateLabel($info1, 520, 100, 130, 20) $Label11 = GUICtrlCreateLabel($info2, 520, 150, 130, 20) $Label12 = GUICtrlCreateLabel($info3, 520, 200, 130, 20) $Label13 = GUICtrlCreateLabel($info4, 520, 250, 130, 20) $Label14 = GUICtrlCreateLabel($info5, 520, 300, 130, 20) $Label15 = GUICtrlCreateLabel($info6, 520, 350, 130, 20) $Label16 = GUICtrlCreateLabel($info7, 520, 400, 130, 20) $Label17 = GUICtrlCreateLabel(Dec($30) & "0", 180, 50, 40, 20) $Label18 = GUICtrlCreateLabel(Dec($31) & "0", 180, 100, 40, 20) $Label19 = GUICtrlCreateLabel(Dec($32) & "0", 180, 150, 40, 20) $Label20 = GUICtrlCreateLabel(Dec($33) & "0", 180, 200, 40, 20) $Label21 = GUICtrlCreateLabel(Dec($34) & "0", 180, 250, 40, 20) $Label22 = GUICtrlCreateLabel(Dec($35) & "0", 180, 300, 40, 20) $Label23 = GUICtrlCreateLabel(Dec($36) & "0", 180, 350, 40, 20) $Label24 = GUICtrlCreateLabel(Dec($37) & "0", 180, 400, 40, 20) ; Create Zone Color GUICtrlSetColor($Label1, 0xff0000) GUICtrlSetColor($Label2, 0xff0000) GUICtrlSetColor($Label3, 0xff0000) GUICtrlSetColor($Label4, 0xff0000) GUICtrlSetColor($Label5, 0xff0000) GUICtrlSetColor($Label6, 0xff0000) GUICtrlSetColor($Label7, 0xff0000) GUICtrlSetColor($Label8, 0xff0000) ; $SetButton1 = GUICtrlCreateButton("SetSpeedZ0", 380, 42, 100, 40) ; $SetButton2 = GUICtrlCreateButton("SetSpeedZ1", 380, 92, 100, 40) ; $SetButton3 = GUICtrlCreateButton("SetSpeedZ2", 380, 142, 100, 40) ; $SetButton4 = GUICtrlCreateButton("SetSpeedZ3", 380, 192, 100, 40) ; $SetButton5 = GUICtrlCreateButton("SetSpeedZ4", 380, 242, 100, 40) ; $SetButton6 = GUICtrlCreateButton("SetSpeedZ5", 380, 292, 100, 40) ; $SetButton7 = GUICtrlCreateButton("SetSpeedZ6", 380, 342, 100, 40) ; $SetButton8 = GUICtrlCreateButton("SetSpeedZ7", 380, 392, 100, 40) $ReadOut1 = GUICtrlCreateLabel($ReadOutText1, 100, 50, 70, 40) $ReadOut2 = GUICtrlCreateLabel($ReadOutText2, 100, 100, 70, 40) $ReadOut3 = GUICtrlCreateLabel($ReadOutText3, 100, 150, 70, 40) $ReadOut4 = GUICtrlCreateLabel($ReadOutText4, 100, 200, 70, 40) $ReadOut5 = GUICtrlCreateLabel($ReadOutText5, 100, 250, 70, 40) $ReadOut6 = GUICtrlCreateLabel($ReadOutText6, 100, 300, 70, 40) $ReadOut7 = GUICtrlCreateLabel($ReadOutText7, 100, 350, 70, 40) $ReadOut8 = GUICtrlCreateLabel($ReadOutText8, 100, 400, 70, 40) GUIStartGroup() GUISetState() ; ParseWsensData() While (1) $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $input1 Run("C:\Users\Administrator\Desktop\wcmdtool64\wCmdtool.exe 20 c0 15 05 00 01 " & Hex(GUICtrlRead($input1),2), "") ParseWsensData() Case $msg = $input2 Run("C:\Users\Administrator\Desktop\wcmdtool64\wCmdtool.exe 20 c0 15 05 01 01 " & Hex(GUICtrlRead($input2),2), "") ParseWsensData() Case $msg = $input3 Run("C:\Users\Administrator\Desktop\wcmdtool64\wCmdtool.exe 20 c0 15 05 02 01 " & Hex(GUICtrlRead($input3),2), "") ParseWsensData() Case $msg = $input4 Run("C:\Users\Administrator\Desktop\wcmdtool64\wCmdtool.exe 20 c0 15 05 03 01 " & Hex(GUICtrlRead($input4),2), "") ParseWsensData() Case $msg = $input5 Run("C:\Users\Administrator\Desktop\wcmdtool64\wCmdtool.exe 20 c0 15 05 04 01 " & Hex(GUICtrlRead($input5),2), "") ParseWsensData() Case $msg = $input6 Run("C:\Users\Administrator\Desktop\wcmdtool64\wCmdtool.exe 20 c0 15 05 05 01 " & Hex(GUICtrlRead($input6),2), "") ParseWsensData() Case $msg = $input7 Run("C:\Users\Administrator\Desktop\wcmdtool64\wCmdtool.exe 20 c0 15 05 06 01 " & Hex(GUICtrlRead($input7),2), "") ParseWsensData() Case $msg = $input8 Run("C:\Users\Administrator\Desktop\wcmdtool64\wCmdtool.exe 20 c0 15 05 07 01 " & Hex(GUICtrlRead($input8),2), "") ParseWsensData() ;============================================================================================== EndSelect WEnd EndFunc Func Read_WSensor() EndFunc Local $wsstdoutvar, $wsstderrvar, $ZoneAddress, $stdoutwsid, $AddressArray, $runid, $errline, $line Local $STDERR_CHILD, $STDOUT_CHILD Func RunRedirect() $runid = Run(@ComSpec & " /c C:\Users\Administrator\Desktop\wcmdtool64\wSensors.exe", "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) While 1 $line = StdoutRead($runid) If @error Then ExitLoop If ($line <> "")Then $LabelArray = StringSplit($line, @CR) Wend While 1 $errline = StderrRead($runid) If @error Then ExitLoop If ($errline <> "")Then MsgBox(64, "ERROR", $errline) Wend EndFunc Func ParseWsensData() RunRedirect() ;Local $parseStringid = FileOpen($parsefile, 0) ;if $parseStringid = -1 Then MsgBox(1, "OUCH", "Error at openfile") ;Local $parsedata = FileRead($parseStringid) ;if @error Then ;MsgBox(1, "OUCH", "Error at Readfile" & @error) ;ExitLoop ;EndIf For $line in $LabelArray if StringInStr($line, ":")AND NOT StringInStr($line, "Iteration") Then if StringInStr(StringLeft($line, 3), "30") then $30 = $line if StringInStr(StringLeft($line, 5), "31") then $31 = $line if StringInStr(StringLeft($line, 5), "32") then $32 = $line if StringInStr(StringLeft($line, 5), "33") then $33 = $line if StringInStr(StringLeft($line, 5), "34") then $34 = $line if StringInStr(StringLeft($line, 5), "35") then $35 = $line if StringInStr(StringLeft($line, 5), "36") then $36 = $line if StringInStr(StringLeft($line, 5), "37") then $37 = $line EndIf Next $LabelArray = StringSplit($30, @TAB) $30 = StringMid($LabelArray[1], 27, 2 ) $info0 = $LabelArray[2] GUICtrlSetData($Label9, $info0) GUICtrlSetData($Label17, Dec($30) & "0") if (StringIsXDigit($30)) then GUICtrlSetColor($Label1, 0x00ff00) Else GUICtrlSetColor($Label1, 0xff0000) EndIf $LabelArray = StringSplit($31, @TAB) $31 = StringMid($LabelArray[1], 27, 2 ) $info1 = $LabelArray[2] GUICtrlSetData($Label10, $info1) GUICtrlSetData($Label18, Dec($31) & "0") if (StringIsXDigit($31)) then GUICtrlSetColor($Label2, 0x00ff00) Else GUICtrlSetColor($Label2, 0xff0000) EndIf $LabelArray = StringSplit($32, @TAB) $32 = StringMid($LabelArray[1], 27, 2 ) $info2 = $LabelArray[2] GUICtrlSetData($Label11, $info2) GUICtrlSetData($Label19, Dec($32) & "0") if (StringIsXDigit($32)) then GUICtrlSetColor($Label3, 0x00ff00) Else GUICtrlSetColor($Label3, 0xff0000) EndIf $LabelArray = StringSplit($33, @TAB) $33 = StringMid($LabelArray[1], 27, 2 ) $info3 = $LabelArray[2] GUICtrlSetData($Label12, $info3) GUICtrlSetData($Label20, Dec($33) & "0") if (StringIsXDigit($33)) then GUICtrlSetColor($Label4, 0x00ff00) Else GUICtrlSetColor($Label4, 0xff0000) EndIf $LabelArray = StringSplit($34, @TAB) $34 = StringMid($LabelArray[1], 27, 2 ) $info4 = $LabelArray[2] GUICtrlSetData($Label13, $info4) GUICtrlSetData($Label21, Dec($34) & "0") if (StringIsXDigit($34)) then GUICtrlSetColor($Label5, 0x00ff00) Else GUICtrlSetColor($Label5, 0xff0000) EndIf $LabelArray = StringSplit($35, @TAB) $35 = StringMid($LabelArray[1], 27, 2 ) $info5 = $LabelArray[2] GUICtrlSetData($Label14, $info5) GUICtrlSetData($Label22, Dec($35) & "0") if (StringIsXDigit($35)) then GUICtrlSetColor($Label6, 0x00ff00) Else GUICtrlSetColor($Label6, 0xff0000) EndIf $LabelArray = StringSplit($36, @TAB) $36 = StringMid($LabelArray[1], 27, 2 ) $info6 = $LabelArray[2] GUICtrlSetData($Label15, $info6) GUICtrlSetData($Label23, Dec($36) & "0") if (StringIsXDigit($36)) then GUICtrlSetColor($Label7, 0x00ff00) Else GUICtrlSetColor($Label7, 0xff0000) EndIf $LabelArray = StringSplit($37, @TAB) $37 = StringMid($LabelArray[1], 27, 2 ) $info7 = $LabelArray[2] GUICtrlSetData($Label16, $info7) GUICtrlSetData($Label24, dec($37) & "0") if (StringIsXDigit($37)) then GUICtrlSetColor($Label8, 0x00ff00) Else GUICtrlSetColor($Label8, 0xff0000) EndIf local $LabelArray EndFunc Func ChangeSpeed() EndFunc Func Crunch_Input() EndFunc FanController() ParseWsensData() ; Need to Get fans/spesd etc. and load into GUI ***