Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Multi Processing support (not quite sure what to call it)

$
0
0
hey everyone, I'm not quite new here, I've been reading topics and looking for help here and there, but never really posted.
so my question is that I want to make a program that would work on multiple processes and execute the same functions, it would be hard so I came up with an idea of first writing down all the processes with ProcessList() and then saving them in a txt file with F and T (T = taken, F = free) next to the PID.
I made an array with these numbers and I wanted to assign PIDs to the program, but the problem came in when I created a 2D array, I searched for F and it returned the position of F in the array, while I wanted to get the position of the whole array, so I can extract the PID from it and use it for the program. it's been really a pain to get it to work and so far no success. I'm hoping you guys can help me, here's the code:
[ autoit ]    ( ExpandCollapse - Popup )
#include #include $test = msgbox(1,"Test","Do you want to save the processlist to the text file?") if $test = 1 Then $array = Processlist("Notepad.exe") filedelete("PID.txt") for $i = 1 To $array[0][0] Filewrite("PID.txt",$array[$i][1] &",F" & @CRLF) Next EndIf $PIDs = _FileCountLines("PID.txt") Local $Array2[$PIDs], $arraycheck[$PIDs][$PIDs] _FileReadToArray("PID.txt",$array2) local $arrayPID[$PIDs] for $i = 1 to $PIDs $arrayPID[$i-1] = filereadline("PID.txt", $i) Next local $arraycheck[$PIDs][$PIDs] for $i = 1 to $PIDs $arraycheck[$i-1][$i-1] = StringSplit($array2[$i],",") Next Local $arrays[$PIDs] for $i = 1 to $PIDs $arrays[$i-1] = _ArraySearch($arraycheck[$i-1][$i-1],"F") Next _ArrayDisplay($arraycheck[1][1])
I know it's a mess, I tried different things and nothing really helped. I just hope I missed something that you can point out and I can just get over with it.
thanks for any kind of support!

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>