sumkid Posted October 7, 2007 Share Posted October 7, 2007 is there anyone to make a program that would check if a certain program is running then say if i press 1 it will press 1 in all copies of that program. like if i was playing a game and had multiple accounts put them all by eachother and pressed 1 it would send 1 to all 5 of them? if this is possible can anyone tell me how? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 7, 2007 Moderators Share Posted October 7, 2007 ProcessList+WinList+ControlSend That someone will be you . Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
sumkid Posted October 7, 2007 Author Share Posted October 7, 2007 would you mind giving me some example? i dont quite understand Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 7, 2007 Moderators Share Posted October 7, 2007 would you mind giving me some example? i dont quite understand ProcessList("Process.exe") << Read a var to an array WinList() << Read a var to an Array Loop Match window to the ProcessID... WinGetProcess($var[$i][1]) If ProcessID matches Win's Process ID Then ControlSend($var[$i][1], etc...) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
sumkid Posted October 8, 2007 Author Share Posted October 8, 2007 (edited) err so i have this Sleep(2000) HotKeySet("{ESC}","qt") While 1 $a=ProcessList ("myprocess.EXE") WinList ($a) ControlSend WEnd If _IsPressed('31') Then (what goes here?) EndIf Func qt() Exit EndFunc so the If _IsPressed('31') Then part of the code is seeing if one is pressed then whatever i put below it would do. so how can i make it send 1 to multiple processes now? i dont get how to use control send err. im not even sure if this code will work. Edited October 8, 2007 by sumkid Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 8, 2007 Moderators Share Posted October 8, 2007 err so i have this Sleep(2000) HotKeySet("{ESC}","qt") While 1 $a=ProcessList ("myprocess.EXE") WinList ($a) ControlSend WEnd If _IsPressed('31') Then (what goes here?) EndIf Func qt() Exit EndFunc so the If _IsPressed('31') Then part of the code is seeing if one is pressed then whatever i put below it would do. so how can i make it send 1 to multiple processes now? i dont get how to use control send err. im not even sure if this code will work.You need to read on how to use ProcessList and WinList Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
sumkid Posted October 8, 2007 Author Share Posted October 8, 2007 (edited) err im really confused... anyway you could guide me to the right direction? Edited October 8, 2007 by sumkid Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 8, 2007 Moderators Share Posted October 8, 2007 err im really confused... anyway you could guide me to the right direction?Sorry, I'm doing this intentionally... if someone else wants to give you the answer rather than make you work for it, they are more than welcome... but I've given you the foundation... you need to take the time if you really need it to understand that foundation. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
sumkid Posted October 8, 2007 Author Share Posted October 8, 2007 ok i think i have gotten off to the right start thanks Smoke, ill tell you guys if i have any more problems. Link to comment Share on other sites More sharing options...
sumkid Posted October 8, 2007 Author Share Posted October 8, 2007 (edited) err back with another problem... i have this: expandcollapse popupSleep(2000) HotKeySet("{ESC}","qt") $hexKey = '0x' & $hexKey $list = ProcessList("process.exe") for $i = 1 to $list[0][0] msgbox(0, $list[$i][0], $list[$i][1]) next $var = WinList() For $i = 1 to $list[0][0] If $list[$i][0] <> "" AND IsVisible($list[$i][1]) Then MsgBox(0, "Details", "Title=" & $list[$i][0] & @LF & "Handle=" & $list[$i][1]) EndIf Next Func IsVisible($handle) If BitAnd( WinGetState($handle), 2 ) Then Return 1 Else Return 0 EndIf EndFunc Func _IsPressed($hexKey) If _IsPressed('31') Then ControlSend($list, "", "Edit1", "1") EndIf If _IsPressed('32') Then ControlSend($list, "", "Edit1", "2") EndIf If _IsPressed('33') Then ControlSend($list, "", "Edit1", "3") EndIf If _IsPressed('34') Then ControlSend($list, "", "Edit1", "4") EndIf If _IsPressed('35') Then ControlSend($list, "", "Edit1", "5") EndIf If _IsPressed('36') Then ControlSend($list, "", "Edit1", "6") EndIf If _IsPressed('37') Then ControlSend($list, "", "Edit1", "7") EndIf If _IsPressed('38') Then ControlSend($list, "", "Edit1", "8") EndIf If _IsPressed('39') Then ControlSend($list, "", "Edit1", "9") EndIf If _IsPressed(41) Then ControlSend($list, "", "Edit1", "a") EndIf If _IsPressed(44) Then ControlSend($list, "", "Edit1", "d") EndIf If _IsPressed(53) Then ControlSend($list, "", "Edit1", "s") EndIf If _IsPressed(57) Then ControlSend($list, "", "Edit1", "w") EndIf EndFunc Func qt() Exit EndFunc it just opens and closes... Edited October 8, 2007 by sumkid Link to comment Share on other sites More sharing options...
rambo3889 Posted October 8, 2007 Share Posted October 8, 2007 (edited) Since i got nothing to do at the moment i thought i just would help here : But you should really read the help file, and if this is for some shitty game bot, i nearly can garantuee you that you it will help to read it. This should work: (Of course you need to modify it a bit) #include <array.au3> #include <misc.au3> $YourProcessname="SciTE.exe" $Processlist=ProcessList($YourProcessName);Just assuming that there is only one process with that name $Windowlist=WinList() _ArrayDisplay($Windowlist) _ArrayDisplay($Processlist) While 1 _Checkkeys() Sleep(25) WEnd Func _Checkkeys() if _IsPressed("31") Then for $i=1 to $Windowlist[0][0] ConsoleWrite($i&"/"&$Windowlist[0][0]&@CRLF) if WinGetProcess($Windowlist[$i][0]) = $Processlist[1][1] then ;Just assuming that there is only one process with that name' MsgBox(0,0,$Windowlist[$i][0]); Do your send here EndIf Next EndIf EndFunc Edited October 8, 2007 by rambo3889 My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! youre the best in town Fight! Link to comment Share on other sites More sharing options...
rambo3889 Posted October 8, 2007 Share Posted October 8, 2007 (edited) You dont have any loops in it Edit : You do have loops, but none which keeps the script running Edited October 8, 2007 by rambo3889 My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! youre the best in town Fight! Link to comment Share on other sites More sharing options...
sumkid Posted October 8, 2007 Author Share Posted October 8, 2007 so how could a i add a loop that would keep the code going? if i put it i will get it has no WEnd statement... Link to comment Share on other sites More sharing options...
sumkid Posted October 8, 2007 Author Share Posted October 8, 2007 err anyone? Link to comment Share on other sites More sharing options...
rambo3889 Posted October 10, 2007 Share Posted October 10, 2007 (edited) I dont know if you still need this but believe this shall work: expandcollapse popup#include <misc.au3> Sleep(2000) HotKeySet("{ESC}", "qt") Dim $keys[13][2] = [ ["31", "1"], ["32", "2"], ["33", "3"], ["34", "4"], ["35", "5"], ["36", "6"], ["37", "7"], ["38", "8"], ["39", "9"], ["41", "a"], ["44", "d"], ["53", "s"], ["57", "w"]] $list = ProcessList("SciTE.exe") $var = WinList() While 1 _TrackKeys() Sleep(10) WEnd Func _TrackKeys() For $1 = 0 To 12 If _IsPressed($keys[$1][0]) Then _sendtoWin($1) Next EndFunc ;==>_TrackKeys Func _sendtoWin($nr) For $1 = 1 To $var[0][0] If $var[$1][0] <> "" And IsVisible($var[$1][1]) And (WinGetProcess($var[$1][0]) == $list[1][1]) Then ;~ Send($keys[$nr][1]) ControlSend($var[$1][0], "", "Edit1", $keys[$nr][1]) EndIf Next EndFunc ;==>_sendtoWin Func IsVisible($handle) If BitAND(WinGetState($handle), 2) Then Return 1 Else Return 0 EndIf EndFunc ;==>IsVisible Func qt() Exit EndFunc ;==>qt Edited October 10, 2007 by rambo3889 My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! youre the best in town Fight! Link to comment Share on other sites More sharing options...
Blue_Drache Posted October 10, 2007 Share Posted October 10, 2007 *gives Rambo a spoon* Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
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