All the code seems very unnecessary, as you could just define functions, and then repeat them, as per Diometer's bot.
I thought this had sieve changing when the sieve was done, so I was interested to see how you did this, but, all you were doing is pressing tab, which is hardly a solution..
I am also totally baffled as to why you perform the same search more than once.
To again, point you in the direction of Diometer's bot (it's really useful code, I threw sections of it into a number of bots that I've made since), here is his loot function:
Func Loot()
; Look for and pick up items
Send("{ALTDOWN}")
Sleep(200)
; Search area is 200 x 200 pixel around centre of screen
$loot=0
$counter=0
While ($loot=0 AND $counter<5)
$loot = _ImageSearchArea("loot.BMP",0,$centre_x-100,$centre_y-100,$centre_x+100,$centre_y+100,$loot_x,$loot_y,10 0)
$counter = $counter + 1
Sleep(200)
WEnd
; If we found at least 1 item, we keep looking till we pick up all! :D
While ($loot=1)
MouseMove($loot_x,$loot_y,0)
Sleep(100)
MouseClick("left",$loot_x,$loot_y,3,0)
ResetMouse()
Sleep(300)
$loot = _ImageSearchArea("loot.BMP",0,$centre_x-100,$centre_y-100,$centre_x+100,$centre_y+100,$loot_x,$loot_y,10 0)
WEnd
Send("{ALTUP}")
Sleep(200)
EndFunc
This picks up everything with "ore" in, and, doesn't need to be repeated in your code.
Infact, his bot is so well defined, the main loop is only the basic search/skill/useskill element, and then function calls to perform the other required sections, which keeps it cleaner, and easier to read.
Also makes it easier for the programmer, as you have essentially created standalone scripts that function together.
The only thing I'm not very clear on is how people work out the co-ordinates, but it's cool guys, I don't need a lmgtfy :D
@Pridefulgod (..seriously...?) Just take replace all the images in the folder with images you took yourself. Just use the screenshot function under the Celtic Start button to take pictures of something if you're holding alt.