I updated the script a little more, so the bot have the ability to move around the camera when it cant find any cobwebs, correct the values to ur own resolution (made on 1440*900).
Code:
#include <ImageSearch.au3>
MsgBox(0,"Notice","Click Ok to start. Make sure you have Mabinogi window maximized.")
Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("!{ESC}", "Stop") ;script can be stopped by pressing ESC
$x1=0
$y1=0
While (1)
Send("{LALT down}")
$result = _ImageSearch("cobweb.jpg",1,$x1,$y1,100) ;change the cobweb.jpg if you want to pick up something else.
if $result=1 Then
Tooltip("Nomnomnom cobwebs ^^...", 0, 0) ;Indicates the item is present on the screen
MouseMove($x1,$y1,3)
MouseClick("left",$x1,$y1,1,3)
Sleep(3000) ;Enough time for the character to go pick up the cobweb. You can change it if you want (2000 = 2 seconds so 1000 = 1 second)
EndIf
If $result=0 Then
Sleep (2000)
MouseMove (722, 445) ;The middle of your screen, x/y mouse position
Sleep (1000)
Tooltip("Searching for cobwebs...", 0, 0) ;Starting to rotate camera
MouseDown("right")
Sleep (1000)
MouseMove (750, 455) ; The middle of your screen plus some right or left amount movement to allow camera rotation
Sleep (1000)
MouseUp("right")
EndIf
WEnd
Func TogglePause()
$Paused = not $Paused
While $Paused
ToolTip("paused")
sleep(100)
WEnd
EndFunc
Func Stop() ;to allow the script to stop
Exit ;same
EndFunc ;same