|
You last visited: Today at 17:08
Advertisement
Autoit multiple windows
Discussion on Autoit multiple windows within the AutoIt forum part of the Coders Den category.
10/17/2013, 15:00
|
#1
|
elite*gold: 0
Join Date: Sep 2010
Posts: 473
Received Thanks: 104
|
Autoit multiple windows
Hi
IS it possible to make autoit work with multiple window for example i have 5 windows of running game, now i need when i start bot to ask me what window i want to choose. Please help
|
|
|
10/17/2013, 15:27
|
#2
|
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
|
You can click on the window you want to have and then use
Code:
$sWindowTitle = WinGetTitle("[active]")
to get the current Title, so you can work with it.
|
|
|
10/17/2013, 15:43
|
#3
|
elite*gold: 0
Join Date: Sep 2010
Posts: 473
Received Thanks: 104
|
i dont know what you mean im new in this can you show me in my code ?
Code:
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseX64=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
Global $Paused
Hotkeyset("{F8}","Quit")
Hotkeyset("{F7}","TogglePause")
$hwnd = WinGetHandle("Game")
AutoItSetOption("WinTitleMatchMode", 4)
If ProcessExists("game.exe") Then
WinActivate($hwnd)
Else
MsgBox(0, "Error", "Game is not running.")
EndIf
While 1
Winsetstate($hwnd,"",@SW_MINIMIZE) ; setting window to work minimized
Sleep(200)
ControlSend($hwnd,"","","{TAB}")
Sleep(200)
ControlSend($hwnd,"","","{3}")
Sleep(3000)
ControlSend($hwnd,"","","{4}")
Sleep(1000)
ControlSend($hwnd,"","","{4}")
Sleep(7000)
WEnd
Func TogglePause()
$Paused = NOT $Paused
While $Paused
sleep(100)
ToolTip('BOT PAUSED', 533, 362)
WEnd
ToolTip("")
EndFunc ;==>Toggle pause on/off
Func Quit()
Exit
EndFunc ;==>Quits bot
so i started 5 windows and all have the same name, now i dont know how to recognize what window to choose and how
|
|
|
10/17/2013, 15:45
|
#4
|
elite*gold: 15
Join Date: Aug 2012
Posts: 3,041
Received Thanks: 6,394
|
Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Lister", 173, 235, 192, 146, BitOr($GUI_SS_DEFAULT_GUI, $WS_CAPTION))
$procLST = GUICtrlCreateList("", 16, 8, 137, 149)
$exeTXT = GUICtrlCreateInput("Process Name (with .exe)", 16, 168, 137, 21)
$lstBTN = GUICtrlCreateButton("List Processes!", 16, 200, 139, 25)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $lstBTN
GUICtrlSetData($procLST, '')
$proc = ProcessList(GUICtrlRead($exeTXT))
For $i = 1 To UBound($proc) - 1
$node = $proc[$i][0] & ' - PID: ' & $proc[$i][1]
GUICtrlSetData($procLST, $node)
Next
EndSwitch
WEnd
this should work in most cases
|
|
|
10/17/2013, 16:11
|
#5
|
elite*gold: 95
Join Date: May 2011
Posts: 982
Received Thanks: 189
|
titels can be the same for multiple windows i think. use the window handle to identify them.
_ArrayAdd($windows,WinGetHandle(""))
MsgBox(0,"","Added Window " & WinGetTitle(WinGetHandle("")))
adds the handle of the active window to $windows
|
|
|
10/17/2013, 16:12
|
#6
|
elite*gold: 0
Join Date: Sep 2010
Posts: 473
Received Thanks: 104
|
Thanks man i love you it works to get process list but i modified gui a bit
Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 387, 187, 293, 233)
$lstBTN = GUICtrlCreateButton("Detect running windows", 8, 8, 145, 25)
$Button2 = GUICtrlCreateButton("Start bot", 160, 8, 105, 25)
$Button3 = GUICtrlCreateButton("Toggle pause", 272, 8, 105, 25)
$procLST = GUICtrlCreateList("", 8, 40, 145, 136)
;$exeTXT = GUICtrlCreateInput("game.exe", 16, 168, 137, 21)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $lstBTN
GUICtrlSetData($procLST, '')
$proc = ProcessList("game.exe")
For $i = 1 To UBound($proc) - 1
$node = $proc[$i][0] & ' - PID: ' & $proc[$i][1]
GUICtrlSetData($procLST, $node)
Next
EndSwitch
WEnd
Now can you help when i click "Detect running windows" i get list, now how to make it when i chose window i want to start and press start button to get focus on chosen window and activate it ? My last wish
|
|
|
10/17/2013, 16:46
|
#7
|
elite*gold: 15
Join Date: Aug 2012
Posts: 3,041
Received Thanks: 6,394
|
GUI was just an example
Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#include <String.au3>
#include <Array.au3>
$Form1 = GUICreate("Lister", 173, 235, 192, 146, BitOr($GUI_SS_DEFAULT_GUI, $WS_CAPTION))
$procLST = GUICtrlCreateList("", 16, 8, 137, 149)
$exeTXT = GUICtrlCreateInput("Process Name (with .exe)", 16, 168, 137, 21)
$lstBTN = GUICtrlCreateButton("List Processes!", 16, 200, 139, 25)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $lstBTN
GUICtrlSetData($procLST, '')
$proc = ProcessList(GUICtrlRead($exeTXT))
For $i = 1 To UBound($proc) - 1
$node = $proc[$i][0] & ' - PID: ' & $proc[$i][1]
GUICtrlSetData($procLST, $node)
Next
Case $procLST ; when you click the listbox, this event will fire
If (GUICtrlRead($procLST) <> "") Then
Local $pid = _StringBetween(GUICtrlRead($procLST), "PID: ", "")
Local $titleLST = WinList()
For $i = 1 To $titleLST[0][0]
If $titleLST[$i][0] <> "" And WinGetProcess($titleLST[$i][1]) = $pid[0] Then
WinActivate($titleLST[$i][1])
ExitLoop
EndIf
Next
EndIf
EndSwitch
WEnd
|
|
|
10/17/2013, 16:55
|
#8
|
elite*gold: 0
Join Date: Sep 2010
Posts: 473
Received Thanks: 104
|
Thanks very much <3
|
|
|
10/17/2013, 17:05
|
#9
|
elite*gold: 15
Join Date: Aug 2012
Posts: 3,041
Received Thanks: 6,394
|
Quote:
Originally Posted by mlukac89
Thanks very much <3
|
It was my pleasure
|
|
|
|
Similar Threads
|
AutoClicker for Multiple Windows?
09/23/2013 - Lineage 2 - 0 Replies
Best Lineage 2 Clicker for multiple windows?
been searching like a mad man
|
Multiple Windows
02/20/2010 - GW Bots - 1 Replies
What is the code to select the specific window for GWCA? I have 2 injected GW copies and I want to run one bot per copy.
|
AionSZ in multiple windows?
10/25/2009 - Aion - 3 Replies
Hi, im just curious if its possible to run Aion SZ to boon one character, an open up another aion session to play as another character on the same account at same time? is this possible?
|
Multiple wow windows on a mac
02/15/2008 - WoW Exploits, Hacks, Tools & Macros - 1 Replies
basically to open multiple wows follwo this
1. open ur wow foler
2. right click on the wow launcher, and click show package contents
3.in the contents folder click the MacOS folder
4.in the MacOS folder double click the cmd prompt program called "World Of warcraft"
5. a cmd prompt well come up w8 a sec and it well open another wow window
|
Multiple Windows
06/08/2006 - Conquer Online 2 - 2 Replies
Is there any chance to get a hack's or some information to
how to open more than 2 ´clients in CO2?
Im sitting here frustrated looking for information and hacks.
|
All times are GMT +2. The time now is 17:08.
|
|