Macro auto click Topic is solved

Poser vos questions de programmation en AutoHotkey
Mavisyukituyj

Macro auto click

06 Oct 2020, 12:46

Bonsoir,
je voudrais que la ahk appuis sur la touch f des qu'il vois une image
a peu comme si dessou mais avec la touch f

Code: Select all

SetTitleMatchMode=2
WinGet, client, ID, Blade & Soul
CoordMode, Pixel, Screen
WinActivate, ahk_id %client%
MouseGetPos,,, WinID, WinCon
SetControlDelay 0


Loop
{
	ImageSearch, FoundX, FoundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *50 escape.png
	if ErrorLevel = 0
	{
		ControlSend, ahk_parent, {Escape}, ahk_id %WinID%
		sleep 3000
	}
	else if ErrorLevel = 1
	{
	sleep 100
	}
	else if ErrorLevel = 2
	{
	MsgBox Cannot open image or bad format
	ExitApp
	}
}
return
[Mod edit: [code][/code] tags added.]
User avatar
joedf
Posts: 8958
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Macro auto click  Topic is solved

06 Oct 2020, 13:35

Il faut simplement changer la ligne suivante de:

Code: Select all

ControlSend, ahk_parent, {Escape}, ahk_id %WinID%
à ceci:

Code: Select all

ControlSend, ahk_parent, f, ahk_id %WinID%
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Mavisghsyyhy

Re: Macro auto click

07 Oct 2020, 04:28

Merci beaucoup de ta réponse !
MavisVamirion1

Re: Macro auto click

07 Oct 2020, 05:03

Maintenant j'ai ça, pas de message d'erreur pour l'image ou autre mais ça ne marche pas.
Quand l'icone que j'ai mis en png "iconef.png" apparais a l'écran il n'appuis pas sur la touch f! :c

Code: Select all

SetTitleMatchMode=2
WinGet, client, ID, Blade & Soul
CoordMode, Pixel, Screen
WinActivate, ahk_id %client%
MouseGetPos,,, WinID, WinCon
SetControlDelay 0


Loop
{
	ImageSearch, FoundX, FoundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *50 iconef.png
	if ErrorLevel = 0
	{
		ControlSend, ahk_parent, f, ahk_id %WinID%
		sleep 100
	}
	else if ErrorLevel = 1
	{
	sleep 100
	}
	else if ErrorLevel = 2
	{
	MsgBox Cannot open image or bad format
	ExitApp
	}
}
return
[Mod edit: [code][/code] tags added.]

Return to “J'ai besoin d'aide”

Who is online

Users browsing this forum: No registered users and 41 guests