[Guide] PickUp Bot

08/21/2009 05:58 Trismic#1
So I just figured out how to make a item pick up bot with AutoIt.

1. Download AutoItv3
2. Download ImageSearch (See attachement)
3. Extract ImageSearch.rar
4. Put ImageSearchDLL.dll into C:\Windows
5. Put ImageSearch.au3 into C:\Program Files\AutoIt3\Include

Now you are ready to use the ImageSearch function.

I made the bot so it can pick up Cobwebs (Pretty useful for me Weaving character)

Here's the .au3 code
Code:
#include <ImageSearch.au3>
MsgBox(0,"Notice","Click Ok to start. make sure your ATL key is pressed.")
$x1=0
$y1=0
While WinActive("Mabinogi G7") ;Might change depending on the current generation
$result = _ImageSearch("cobweb.bmp",1,$x1,$y1,100) ;change the cobweb.bmp if you want to pick up something else.
if $result=1 Then
    MouseMove($x1,$y1,3)
    MouseClick("left",$x1,$y1,1,3)
    Sleep(2000) ;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
WEnd
As you can see, while Mabinogi is open, AutoIt will search the image of the word cobweb

The cobweb.bmp is this image
[Only registered and activated users can see links. Click Here To Register...]

Everytime AutoIt founds this image on your screen, it will move the mouse over it and clicks it, waits for 2 seconds, then rescan your screen for the same image.

When you run the .au3 put a coin or something to hold the ALT key. (I haven't put the hold ALT key in the .au3)

If you want to pick something else, like gold. Hold ALT and make a screenshot of a gold on the ground. Then, cut the image until you can only see the word Gold. Then save it into a .bmp format and change cobweb.bmp

Make sure the image and the .au3 are in the same folder !

[Only registered and activated users can see links. Click Here To Register...]
Quote:
Originally Posted by argentino View Post
I did some changes to the script to make it look a little like mine, with this you can download the OP jpg file and rename to cobweb.jpg and use it directly, and it will automatically hold alt down no need for a coin.

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
    MouseMove($x1,$y1,3)
    MouseClick("left",$x1,$y1,1,3)
    Sleep(2000) ;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
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
Use the Thanks button [Only registered and activated users can see links. Click Here To Register...]
08/21/2009 08:43 cry8wolf9#2
Quote:
Originally Posted by Trismic View Post
So I just figured out how to make a item pick up bot with AutoIt.

1. Download AutoItv3
2. Download ImageSearch (See attachement)
3. Extract ImageSearch.rar
4. Put ImageSearchDLL.dll into C:\Windows
5. Put ImageSearch.au3 into C:\Program Files\AutoIt3\Include

Now you are ready to use the ImageSearch function.

I made the bot so it can pick up Cobwebs (Pretty useful for me Weaving character)

Here's the .au3 code
Code:
#include <ImageSearch.au3>
MsgBox(0,"Notice","Click Ok to start. make sure your ATL key is pressed.")
$x1=0
$y1=0
While WinActive("Mabinogi G7") ;Might change depending on the current generation
$result = _ImageSearch("cobweb.bmp",1,$x1,$y1,100) ;change the cobweb.bmp if you want to pick up something else.
if $result=1 Then
    MouseMove($x1,$y1,3)
    MouseClick("left",$x1,$y1,1,3)
    Sleep(2000) ;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
WEnd
As you can see, while Mabinogi is open, AutoIt will search the image of the word cobweb

The cobweb.bmp is this image
[Only registered and activated users can see links. Click Here To Register...]

Everytime AutoIt founds this image on your screen, it will move the mouse over it and clicks it, waits for 2 seconds, then rescan your screen for the same image.

When you run the .au3 put a coin or something to hold the ALT key. (I haven't put the hold ALT key in the .au3)

If you want to pick something else, like gold. Hold ALT and make a screenshot of a gold on the ground. Then, cut the image until you can only see the word Gold. Then save it into a .bmp format and change cobweb.bmp

Make sure the image and the .au3 are in the same folder !
First i want to say thank you very much this post helped me fix the bot i was having problems with


now i have a few questions to ask i hope you can answer them
Quote:
Originally Posted by Trismic View Post
MouseClick("left",$x1,$y1,1,3)
ok i get that "left" is for the left mouse button
and the $x1 , $y1 are for the stored data but what are the 1 and 3 for?


also how would i go about searching for more than one image? would i be able to use
$result = _ImageSearch("image1.bmp","image2.bmp","image3.bmp ","image4.bmp",1,$x1,$y1,100)

or would i have to use seprate functions?
08/21/2009 14:10 n3m0k54#3
You can't use:
Code:
$result = _ImageSearch("image1.bmp","image2.bmp","image3.bmp ","image4.bmp",1,$x1,$y1,100)
Because in ImageSearch.au3 function is:
Code:
Func _ImageSearch($findImage,$resultPosition,ByRef $x, ByRef $y,$tolerance)
You have to create different functions.
08/21/2009 14:18 Dark Raccoon#4
Here are some more Pictures:

Gold (No Background; higher Chance of finding the Item):
[Only registered and activated users can see links. Click Here To Register...]

Fomo Scroll (No Background; higher Chance of finding the Item):
[Only registered and activated users can see links. Click Here To Register...]

Gold (Black Background):
[Only registered and activated users can see links. Click Here To Register...]

Fomor Scroll (Black Background):
[Only registered and activated users can see links. Click Here To Register...]
08/21/2009 14:27 argentino#5
I did some changes to the script to make it look a little like mine, with this you can download the OP jpg file and rename to cobweb.jpg and use it directly, and it will automatically hold alt down no need for a coin.

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
	MouseMove($x1,$y1,3)
	MouseClick("left",$x1,$y1,1,3)
	Sleep(2000) ;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
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
08/21/2009 14:31 argentino#6
Sorry for the double post but im pretty sure you can repeat instructions inside a loop cry8wolf9, like this:

$result = _ImageSearch("cobweb.jpg",1,$x1,$y1,100)
$result = _ImageSearch("image2.jpg",1,$x1,$y1,100)
$result = _ImageSearch("image4.jpg",1,$x1,$y1,100)

Long time i dont use Autoit so i dont remember but should work.
08/21/2009 22:18 Cloudsdabomb#7
so do we need to put the picture anywhere? i'm confused do i just change the picture of the gold image to cobweb.jpg if i use argentino's script?
08/21/2009 22:39 Trismic#8
Quote:
Originally Posted by cry8wolf9 View Post
ok i get that "left" is for the left mouse button
and the $x1 , $y1 are for the stored data but what are the 1 and 3 for?
MouseClick ( "button" [, x, y [, clicks [, speed ]]] )
So 1 = Click once
and 3 = Speed of the click? I'm not sure.

Quote:
Originally Posted by Cloudsdabomb View Post
so do we need to put the picture anywhere? i'm confused do i just change the picture of the gold image to cobweb.jpg if i use argentino's script?
Change cobweb.jpg into the gold picture file name. If the picture of the gold is named gold.jpg, change cobweb.jpg into gold.jpg
08/21/2009 23:28 Dark Raccoon#9
Quote:
Originally Posted by Cloudsdabomb View Post
so do we need to put the picture anywhere? i'm confused do i just change the picture of the gold image to cobweb.jpg if i use argentino's script?
I think I know what you mean.

You just gotta put the Pic you wanna use into the same folder as the .exe/.au3 and use the Pic's name in the script as told above.
08/22/2009 16:07 Cloudsdabomb#10
k thanks dark
08/22/2009 18:15 wossen#11
Dark how did you find or make Gold with No Background ?
08/22/2009 18:34 Dark Raccoon#12
Quote:
Originally Posted by wossen View Post
Dark how did you find or make Gold with No Background ?
I just used a Screenie and cut everything out using Macromedia Fireworks..

Btw, this can also be used to make a GoldFarming Bot.
08/24/2009 04:40 cry8wolf9#13
Quote:
Originally Posted by Dark Raccoon View Post
I just used a Screenie and cut everything out using Macromedia Fireworks..

Btw, this can also be used to make a GoldFarming Bot.
i agree and it works great, im loving it :)
08/24/2009 17:31 n3m0k54#14
It's very useful not only for Mabinogi ^^
08/24/2009 18:38 wossen#15
$result = _ImageSearch("cobweb.jpg",1,$x1,$y1,100) can someone help me to understand this what does the 100 do or say?