#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance [Forced]
CoordMode, Pixel, Screen
Buy = 0
Sell = 0
Delay = 10000
^0:: Pause
^9::
Loop{
;Watch for Buy Signal
ImageSearch, FoundX, FoundY, 27, 230, 161, 269, *w20 *h20 *TransBlack *1 C:\Users\bqe27\OneDrive\Desktop\AutoHotKey Images\BuyLabel.tiff
;If found click mouse on random screen location, send ctrl + f key combo, send ctrl + b key combo.
If (ErrorLevel = 0 and Buy = 0)
{
MouseClick, Left, 1747, 248, 1, 0
delay = 10
Send ^{f}
delay = 10
Send ^{b}
Buy = 1
Sell = 0
}
;If not found do nothing
Else If (ErrorLevel = 1)
{
}
;Watch for Sell Signal
ImageSearch, FoundX, FoundY, 27, 230, 161, 269, *w20 *h20 *TransBlack *1 C:\Users\bqe27\OneDrive\Desktop\AutoHotKey Images\SellLabel.tiff
;If found click mouse on random screen location, send ctrl + f key combo, send ctrl + s key combo.
If (ErrorLevel = 0 and Sell = 0)
{
MouseClick, Left, 1747, 248, 1, 0
delay = 10
Send ^{f}
delay = 10
Send ^{s}
Buy = 0
Sell = 1
}
;If not found do nothing
Else If (ErrorLevel = 1)
{
}
;Watch for Yellow label
ImageSearch, FoundX, FoundY, 27, 230, 161, 269, *w20 *h20 *TransBlack *1 C:\Users\bqe27\OneDrive\Desktop\AutoHotKey Images\YellowLabel.tiff
;If found click mouse on random screen location, send ctrl + f key combo, send ctrl + s key combo.
If (ErrorLevel = 0 and Buy = 1)
{
Buy = 0
Sell = 0
}
;If not found do nothing
Else If (ErrorLevel = 1)
{
}
;Watch for Magenta label
ImageSearch, FoundX, FoundY, 27, 230, 161, 269, *w20 *h20 *TransBlack *1 C:\Users\bqe27\OneDrive\Desktop\AutoHotKey Images\MagentaLabel.tiff
;If found click mouse on random screen location, send ctrl + f key combo, send ctrl + s key combo.
If (ErrorLevel = 0 and Sell = 1)
{
Buy = 0
Sell = 0
}
;If not found do nothing
Else If (ErrorLevel = 1)
{
}
}Return