Just found AutoHotkey and I love it! Its so powerful.
Problem is I'm not good with computer programming. I can’t give too much details about the app as the Dev’s are pretty sharp and will ban any account even looking like a script/bot, hence the use of mouse clicks.
Script purpose: To activate two windows and click on the image which appears only every 15 minutes (pending lag/etc). The script will detect the appearance of the image in the two windows and “hijack” the mouse to activate the two windows and click on the image on both these two windows and return control to user in an endless loop.
This is the current code which clicks every 1 min on the preset positions.
Code:
Loop 14400
{
WinWait, Title | Subtitle - Mozilla Firefox,
IfWinNotActive, Title | Subtitle - Mozilla Firefox, , WinActivate, Title | Subtitle - Mozilla Firefox,
WinActivate, Title | Subtitle- Mozilla Firefox,
WinWaitActive, Title | Subtitle- Mozilla Firefox,
MouseClick, left, 435, 339, 2, 0
Sleep, 200
WinWait, Title | Subtitle- Google Chrome,
IfWinNotActive, Title | Subtitle- Google Chrome, , WinActivate, Title | Subtitle- Google Chrome,
WinActivate, Title | Subtitle- Google Chrome,
WinWaitActive, Title | Subtitle- Google Chrome,
MouseClick, left, 487, 316, 2, 0
MouseMove, 400, 400
Sleep, 60000
}
^1::
{
exitapp
}
Image search works but it doesn't loop indefinitely and clicks on current mouse position if image is not found.
Code:
CoordMode, Pixel, Screen
ImageSearch, imageX, imageY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, C:\Documents and Settings\Hansel\My Documents\Games\Horn.bmp ; the smaller and more precise the image the better, you can use printscreen and mspaint to make these easily enough.
WinWait, Title | Subtitle - Mozilla Firefox,
IfWinNotActive, Title | Subtitle - Mozilla Firefox, , WinActivate, Title | Subtitle - Mozilla Firefox,
WinActivate, Title | Subtitle - Mozilla Firefox,
WinWaitActive, Title | Subtitle - Mozilla Firefox,
WinWait, Title | Subtitle - Google Chrome,
IfWinNotActive, Title | Subtitle - Google Chrome, , WinActivate, Title | Subtitle - Google Chrome,
WinActivate, Title | Subtitle - Google Chrome,
WinWaitActive, Title | Subtitle - Google Chrome,
Click %imageX%, %imageY%, left
Sleep 200
Click %imageX%, %imageY%, left
^1:: exitapp