Hi
I am new into Keyboard Maestro, so far I was using AutoHotkey to execute few simple scripts in 2D game called 'Tibia' on Windows.
Basically what I need is a macro which will watch pixel location on the screen while the game is on, and then if the pixel get specific colour it will press the key. However if the specific colour is keep being on the screen, the macro needs to keep pressing the key but with small pauses (0.5 sec for example).
I will appreciate it if someone could help me/give me some tips how to make it work on Keyboard Maestro.
Below the AutoHotkey scripts for your reference. First one is checking the mouse location (x, y) and colour ID. The other two work just as I describe it above.
Script1:
z:: ; Control+Alt+Z hotkey.
MouseGetPos, MouseX, MouseY
PixelGetColor, color, %MouseX%, %MouseY%
MsgBox The color at the current cursor position is %color% x= %MouseX% y= %MouseY% .
return
Script2:
Loop,
{
If WinActive("Tibia")
{
PixelGetColor, Check40, 1215, 219
If (Check40 == 0x423F3C){
SendInput {F3}
Sleep, 200
}
}
Sleep, 50
}
Script3:
#SingleInstance, Force
SetKeyDelay,0
x75 := 1299
HealthY := 286
Loop,
{
If WinActive("Tibia")
{
PixelGetColor, Check75, %x75%, %HealthY%
If (Check75 != 0x4F4FDB)
Send, {F5}
}
Sleep, 400
}
Return
Thank you for your help!!