Autoit Controlclick

Programlama ve Script dilleri konusunda bilgi paylaşım alanıdır.
Cevapla
darendeli
Byte4
Byte4
Mesajlar: 195
Kayıt: 06 Haz 2016, 16:55
Teşekkür etti: 1 kez
Teşekkür edildi: 6 kez

Autoit Controlclick

Mesaj gönderen darendeli »

Kod: Tümünü seç

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 233, 100, 192, 124)
$Button1 = GUICtrlCreateButton("Başı Boş  Zombi Ordusu", 8, 16, 217, 65)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit

		Case $Button1
			ShellExecute("http://www.oyunskor.com/oyna52546.htm")
         pixel()


	EndSwitch
WEnd


Func  pixel()
ControlClick ("Başıboş Zombi Ordusu - Google Chrome", "", 660972432, "left", 1, 949, 135)
Sleep(10*1000)
ControlClick ("Başıboş Zombi Ordusu - Google Chrome", "", 660972432, "left", 1, 504, 521)
EndFunc

coordinatları giriyorum ama tıklamıyor
Kullanıcı avatarı
BlueLife
Kilobyte1
Kilobyte1
Mesajlar: 292
Kayıt: 29 Ağu 2014, 20:42
Teşekkür etti: 46 kez
Teşekkür edildi: 68 kez

Re: Autoit Controlclick

Mesaj gönderen BlueLife »

@darendeli

Belki pencerenin bulunamıyordu. Once pencerenın kimliğini bulalım istersen. Sen control clikcleri tekrar denersin. Ben alternatif örnek vereyim.

Kod: Tümünü seç

Func  pixel()
	Local $Title = "Başıboş Zombi"
	Local $WinList, $Hwnd = 0

	For $I = 1 to 100
		$WinList = WinList($Title)
		For $i = 1 To $WinList[0][0]
			If $WinList[$i][0] <> "" And BitAND(WinGetState($WinList[$i][1]), 2) Then
				$Hwnd = $WinList[$i][1]
				ExitLoop
			EndIf
		Next
		If IsHWnd($Hwnd) Then ExitLoop
		Sleep(100)
	Next
	;Pencere bilgisi bulunamazsa hatalı don
	If IsHWnd($Hwnd) = 0 Then Return SetError(1,0,0)
	
	;ControlClick ($Hwnd, "", 660972432, "left", 1, 949, 135)

	WinActivate($Hwnd)

	SendKeepActive($Hwnd)
	BlockInput(1)
	
	;Tıklanacak konum ayarlanacak
	MouseClick("", 100, 100, 1, 1) ;
	BlockInput(0)
EndFunc
darendeli
Byte4
Byte4
Mesajlar: 195
Kayıt: 06 Haz 2016, 16:55
Teşekkür etti: 1 kez
Teşekkür edildi: 6 kez

Re: Autoit Controlclick

Mesaj gönderen darendeli »

id sürekli degisiyordu text ile tıklattırdım ama 2. sinde takılıyor bu seferde 2.si buton basıyor ama islemiyor

Kod: Tümünü seç

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 233, 100, 192, 124)
$Button1 = GUICtrlCreateButton("Başı Boş  Zombi Ordusu", 8, 16, 217, 65)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
   $nMsg = GUIGetMsg()
   Switch $nMsg
      Case $GUI_EVENT_CLOSE
         Exit

      Case $Button1
         ShellExecute("http://www.oyunskor.com/oyna52546.htm")
         pixel()


   EndSwitch
WEnd

Func  pixel()
   Local $Title = "Başıboş Zombi"
   Local $WinList, $Hwnd = 0

   For $I = 1 to 100
      $WinList = WinList($Title)
      For $i = 1 To $WinList[0][0]
         If $WinList[$i][0] <> "" And BitAND(WinGetState($WinList[$i][1]), 2) Then
            $Hwnd = $WinList[$i][1]
            ExitLoop
         EndIf
      Next
      If IsHWnd($Hwnd) Then ExitLoop
      Sleep(100)
   Next
   ;Pencere bilgisi bulunamazsa hatalı don
   If IsHWnd($Hwnd) = 0 Then Return SetError(1,0,0)

   ControlClick ($Hwnd, "", "Chrome Legacy Window", "left", 1, 945, 130)
   Sleep(9*1000)
   ControlClick ($Hwnd, "", "Chrome Legacy Window", "left", 1, 506, 523)


   WinActivate($Hwnd)

   SendKeepActive($Hwnd)
   BlockInput(1)

   ;Tıklanacak konum ayarlanacak
   ;MouseClick("", 100, 100, 1, 1) ;
   BlockInput(0)
EndFunc
Cevapla

“Programlama ve Script dilleri” sayfasına dön