Hello, I'm trying out some AutoIT programming for the first time.
I'm trying to make a very simple mining bot but i got stuck, here's the code for the loop where i am stuck:
As it is now it searches for the ores but if there aren't any it clicks the 450,450 pixel anyway, which makes the character move. I need help to come up with a solution for this - how can I make it not do anything when it cannot find the ores?
Thanks in advance
I'm trying to make a very simple mining bot but i got stuck, here's the code for the loop where i am stuck:
PHP Code:
While 1
$coord0 = PixelSearch ($pos0[0], $pos0[1], $pos1[0], $pos1[1], 0xD6A252); Search for CopperOre
If Not @error Then MouseClick ("left", $coord0[0], $coord0[1], 1, 15)
Sleep (500)
MouseClick ("left", 450, 450, 1, 20); Drop CopperOre
Sleep (2000)
$coord0 = PixelSearch ($pos0[0], $pos0[1], $pos1[0], $pos1[1], 0x4A494A); Search for IronOre
If Not @error Then MouseClick ("left", $coord0[0], $coord0[1], 1, 15)
Sleep (500)
MouseClick ("left", 450, 450, 1, 20); Drop IronOre
Sleep (2000)
WEnd
Thanks in advance