caramen 71 Posted February 3, 2019 Share Posted February 3, 2019 (edited) Hello guys, Seem simple but i dont get it work. I whant to list process only if process list is changing. I canot toggle even playing with some process. #include <Array.au3> Global $aProcessListPrev1 , $aProcessListPrev2 While 1 $aProcessListPrev1 = _ArrayToString(ProcessList (), " :: ", 4, 7, @CRLF, 2, 5) ;_ArrayDisplay($aProcessListPrev1) If $aProcessListPrev1 = $aProcessListPrev2 Then Msgbox(0,"","Scan proc KO") $ToggleProcessList = 1 ;$aProcessListPrev1 = _ArrayToString(ProcessList (), " :: ", 4, 7, @CRLF, 2, 5) $aProcessListPrev2 = _ArrayToString(ProcessList (), " :: ", 4, 7, @CRLF, 2, 5) Else Msgbox(0,"","Scan proc OK") $ToggleProcessList = 0 ;$aProcessListPrev1 = _ArrayToString(ProcessList (), " :: ", 4, 7, @CRLF, 2, 5) $aProcessListPrev2 = _ArrayToString(ProcessList (), " :: ", 4, 7, @CRLF, 2, 5) EndIf If $ToggleProcessList = 1 Then Msgbox(0,"","Toggle 1") Else Msgbox(0,"","Toggle 0") EndIf WEnd #include <Array.au3> Global $aProcessListPrev1 , $aProcessListPrev2 While 1 $aProcessListPrev1 = ProcessList () ;_ArrayDisplay($aProcessListPrev1) If $aProcessListPrev1 = $aProcessListPrev2 Then Msgbox(0,"","Scan proc KO") $ToggleProcessList = 1 ;$aProcessListPrev1 = ProcessList () $aProcessListPrev2 = ProcessList () Else Msgbox(0,"","Scan proc OK") $ToggleProcessList = 0 ;$aProcessListPrev1 = ProcessList () $aProcessListPrev2 = ProcessList () EndIf If $ToggleProcessList = 1 Then Msgbox(0,"","Toggle 1") Else Msgbox(0,"","Toggle 0") EndIf WEnd I dont want to use _ArrayMaxIndex becose i am closing an application to open an other it will not toggle. To say more: I want to get $ToggleProcessList = 0 If Process list does not change and $ToggleProcessList = 1 If process list change I will do same with WinList Edited February 3, 2019 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to post Share on other sites
Subz 826 Posted February 3, 2019 Share Posted February 3, 2019 The first function _ArrayToString is incorrect, what are the last two delimiters "2, 5" when you only have 2 columns? And why only the rows between 4 and 7? Can't you use the processname to get the list down? Link to post Share on other sites
caramen 71 Posted February 3, 2019 Author Share Posted February 3, 2019 I just copy pasted it from help file. To point to an other logic. I need to fix this to use in a function without processname. My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to post Share on other sites
Subz 826 Posted February 3, 2019 Share Posted February 3, 2019 Fix the _ArrayToString and you should be fine. Link to post Share on other sites
caramen 71 Posted February 3, 2019 Author Share Posted February 3, 2019 Thanks. Not sure i think i got it : #include <Array.au3> Global $aProcessListPrev1 , $aProcessListPrev2 , $aProcessListPrev11 = 0 , $aProcessListPrev22 = 0 $aProcessListPrev1 = ProcessList () $aProcessListPrev11 = _ArrayToString($aProcessListPrev1, "|") MsgBox(0,"$aProcessListPrev11",""&$aProcessListPrev11) While 1 ;_ArrayDisplay($aProcessListPrev1) If $aProcessListPrev11 = $aProcessListPrev22 Then Msgbox(0,"","Scan proc IDEM NO NEXT") $ToggleProcessList = 1 ;$aProcessListPrev1 = _ArrayToString(ProcessList (), "|", -1,-1) $aProcessListPrev2 = ProcessList () $aProcessListPrev22 = _ArrayToString($aProcessListPrev2, "|" ) MsgBox(0,"$aProcessListPrev22 NO NEXT",""&$aProcessListPrev22) Else Msgbox(0,"","Scan proc NO IDEM YES NEXT") $ToggleProcessList = 0 ;$aProcessListPrev1 = _ArrayToString(ProcessList (), "|", -1 , -1 ) $aProcessListPrev1 = ProcessList () $aProcessListPrev11 = _ArrayToString($aProcessListPrev1, "|") $aProcessListPrev2 = ProcessList () $aProcessListPrev22 = _ArrayToString($aProcessListPrev2, "|" ) MsgBox(0,"$aProcessListPrev11 YES NEXT",""&$aProcessListPrev11) MsgBox(0,"$aProcessListPrev22 YES NEXT",""&$aProcessListPrev22) EndIf If $ToggleProcessList = 0 Then Msgbox(0,"","Toggle 0 NO IDEM YES NEXT") Else Msgbox(0,"","Toggle 1 YES IDEM NO NEXT") EndIf WEnd Testing... My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to post Share on other sites
caramen 71 Posted February 3, 2019 Author Share Posted February 3, 2019 (edited) Yes it's working. Edited February 3, 2019 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now