fix please

Ask gaming related questions (AHK v1.1 and older)
vitorcastro
Posts: 47
Joined: 18 Apr 2021, 19:09

fix please

Post by vitorcastro » 16 May 2021, 21:44

wTitle = MEmu
Loop {
WinWait, %wTitle%
SetTimer, MEmu, 100

WinWaitClose
SetTimer, MEmu, Off

}
Memu:

PixelSearch,,, 688, 319, 688, 319, 0x06ce07, 100
If !ErrorLevel ; Skip if pixel was found
Return
SetKeyDelay, 100
ControlSend,, {F3}, %wTitle%

PixelSearch,,, 327, 61, 327, 61, 0x840c1a, 100
If !ErrorLevel ; Skip if pixel was found
Return
SetKeyDelay, 100
ControlSend,, {F2}, %wTitle%
Return
esc::exitapp
F5::Pause ; press F5 to play/pause



i tried to mix almost work but the second option to use mana potions to restore my mana until i want, only works when i lose hp the option on (f3) thats it the f2 function is working together only when f3 is active
vitorcastro
Posts: 47
Joined: 18 Apr 2021, 19:09

Re: fix please

Post by vitorcastro » 16 May 2021, 21:46

i tried hard to make it but still failed please help me if you can add and extra color key option in f1 will be godly
User avatar
boiler
Posts: 16973
Joined: 21 Dec 2014, 02:44

Re: fix please

Post by boiler » 16 May 2021, 22:20

Seriously? You posted code yet again without putting it between code tags? Why do you expect anyone should take the time to help you when you disrespect the forum and the mods this way?
twiz
Posts: 11
Joined: 08 Nov 2013, 03:34

Re: fix please

Post by twiz » 20 May 2021, 01:14

I think the problem is you are using "If !ErrorLevel Return", so if the first PixelSearch found the correct pixel it would NEVER get to the second PixelSearch. The only way the script would send F2 is if the pixels were missing from BOTH searches.

Code: Select all

wTitle = MEmu
SetKeyDelay, 100

Loop {
	WinWait, %wTitle%
	SetTimer, MEmu, 100

	WinWaitClose, %wTitle%
	SetTimer, MEmu, Off
}
Return

MEmu:
	PixelSearch,,, 688, 319, 688, 319, 0x06ce07, 100
	If ErrorLevel
		Send, {F3}

	PixelSearch,,, 327, 61, 327, 61, 0x840c1a, 100
	If ErrorLevel
		Send, {F2}
Return

Esc::ExitApp
F5::Pause ; press F5 to play/pause
Post Reply

Return to “Gaming Help (v1)”