mikeyww wrote: ↑28 Jan 2022, 15:03
I thought that I provided all possible examples, but if none of them work, then I am out of ideas. Others may have additional suggestions for you.
Setting a timer does not actually define a variable called "timer", but my last example shows how to execute a labeled subroutine when a timer expires.
this probably wont work
i think i might create 2 script instead
buff.ahk
attack.ahk
then pause attack.ahk everytime i buff
do you think this will work??
Code: Select all
PostMessage, 0x0111, 65306,,, attack.ahk - AutoHotkey ; Pause.
buff.ahk
Code: Select all
ins::
sleep, 180000 ;- 3mins
send 9
sleep, 500
PostMessage, 0x0111, 65306,,, attack.ahk - AutoHotkey ; Pause.
attack.ahk
Code: Select all
home::
Loop
{
attack()
Sleep, 200
}
attack()
ImageSearch, Attackx, AttackY, 353, 215, 716, 523, attack.png
if(ErrorLevel) {
Loot()
} else if(!ErrorLevel) {
MouseMove, %AttackX%, %AttackY%
sleep, 100
Click, Down
sleep, 30
Click, Up
return
} else {
sleep, 30
return
}
}
Loot()
ImageSearch, Lootx, LootY, 353, 215, 716, 523, loot.png
if(ErrorLevel) {
return
} else if(!ErrorLevel) {
MouseMove, %LootX%, %LootY%
sleep, 100
Click, Down
sleep, 30
Click, Up
return
} else {
sleep, 30
return
}