Code:
; ********************************************************************************************************************
; Simple script for repetitive tasks like milling,disenchanting or prospecting.
; ********************************************************************************************************************
;
; First thing you need to do is capturing the image of the item in your bag that needs to be processed.
; You can simply do this using Windows 7's Snipping Tool or using any other screen capture software of your liking.
; You need to save the image in your script/program folder as a JPG file.Other formats may work too (GIF,PNG,...),I just didn't test them.
;
; Next,
; Open your bags and imagine a rectangle that covers them all.
;
; Start the program.
; Script will first ask you for the action button location.This is the button of the task you want the script to perform that sits on your action bar.
;
; Then it will ask for the Top Left corner and Bottom Right corner of the rectangle that covers your bags.
;
; Finally you'll be asked for the image file name.If it can't find the file,you'll be asked again until you click "Cancel" or enter the correct file name.
;
; If the script can't find the item in your rectangle,it will ask you whether if you want to rescan the same area (maybe you'll get some more from your mailbox,etc...) or end the program.
;
; You also need to enable Auto loot in Interface options -> Control.
;
; Mergun.
#include <ImageSearch.au3>
$exitmsg=""
$answer=6
$filename=""
If WinExists("World of Warcraft") Then
HotKeySet("{ESC}","Ex")
$buttonpos=0
$x=0
$y=0
$errcount=0
$bagtopleft=0
$bagbottomright=0
WinActivate("World of Warcraft")
WinWaitActive("World of Warcraft")
ToolTip("Place your cursor on the ACTION BUTTON (mill,prospect,disenchant...).You have 5 seconds.",0,300,"Coords",2)
Sleep(5000)
$buttonpos=MouseGetPos()
Tooltip("Open up your bags and place your cursor on the TOP LEFT CORNER of scanning area.You have 5 seconds.",0,350,"Coords",2)
Sleep(5000)
$bagtopleft=MouseGetPos()
Tooltip("Open up your bags and place your cursor on the BOTTOM RIGHT CORNER of scanning area.You have 5 seconds.",0,400,"Coords",2)
Sleep(5000)
$bagbottomright=MouseGetPos()
ToolTip("Processing",0,500,"Processing",1)
Do
$filename=InputBox("Image file name","What is the name of the image file that you want to be searched for?")
If WinActive("World of Warcraft") = 0 Then
WinActivate("World of Warcraft")
WinWaitActive("World of Warcraft")
EndIf
If @error=1 Then
Ex("Program terminated")
EndIf
Until FileExists($filename)
While $answer=6
If WinActive("World of Warcraft") = 0 Then
WinActivate("World of Warcraft")
WinWaitActive("World of Warcraft")
EndIf
If _ImageSearchArea($filename,1,$bagtopleft[0],$bagtopleft[1],$bagbottomright[0],$bagbottomright[1],$x,$y,200) Then
MouseClick("left",$buttonpos[0],$buttonpos[1])
Sleep(500)
MouseClick("left",$x,$y)
Sleep(5000)
Else
$errcount=$errcount+1
If $errcount=2 Then
$answer=MsgBox(36,"Confirmation","Item not found in scanning area.Do you want to start again with the same coordinates?")
$errcount=0
EndIf
EndIf
WEnd
MsgBox(0,"Exit msg","Program terminated")
Else
Ex("Warcraft window not found")
EndIf
Func Ex($exitmsg)
If $exitmsg Then
MsgBox(0,"Exit msg",$exitmsg)
Else
MsgBox(0,"Exit msg","Program terminated by user")
EndIf
Exit
EndFunc
And here's the download link;