[Guide] PickUp Bot

09/13/2010 15:15 FrobiddenXD#166
Ok i a have Auto It V3 now i put all the files in there i did that now what i do
09/14/2010 22:40 Trismic#167
Quote:
Originally Posted by FrobiddenXD View Post
Ok i a have Auto It V3 now i put all the files in there i did that now what i do
Can't you read?
10/06/2010 22:08 Nitzlplix#168
Anyone else getting hackshielded with this? When I tried this last monthish I got hackshielded right off the bat, but now it's finding a few and then hackshielding.
10/12/2010 06:45 AndrewHa#169
I have a question, where do you place your bot for cobwebs or golds?
10/25/2010 16:02 KevSmash#170
No one answered a question on page 3 or 4 about detecting multiple images, and the only help offered was a terrible work around. There's a function inside of the imsagesearch.au3 file that clearly shows you how to detect multiple images, it's documented like you wouldn't believe.

My question-- does anyone know if au3 supports anonymous functions or classes. It clearly support functions and classes.

And on another note I finally got the image detect to work and I'm kind of surprised no one spent a minute of their time helping other people.

If you're still stuck on getting it to work.
1) you need to make your own images, no one wants to fuck around guessing your screen resolution and in game resolution.
2) turn off any gamma/contrast/brightness programs you use
3) make sure the imagesearch dll is both in your C:\windows\ directory, and in the directory of the script that includes it (just to be safe)
4) make sure the imagesearch.au3 file is in the directory of your script, and is called with an include inside your script
5) read the imagesearch.au3 file there's plenty of documentation in there about useful functions you can use, there's more than just 1 function that the author created.
6) if you're on vista, run your compiled exe as administrator

Finally, don't trust random posts here. Please clearly don't read the documentation and have things backwards, especially about the transparency and tolerance of image detection.

It's unfortunate that the quality of script used to cheat is so low.
10/30/2010 08:52 Hitsuqaya#171
4) make sure the imagesearch.au3 file is in the directory of your script, and is called with an include inside your script

I got a bit confused at this part, could you restate it?
11/11/2010 21:11 KevSmash#172
The imagesearch.au3 file is a set of functions that don't come with autoit.
They were made by someone else, but the cobweb bot uses these functions. So you need the code, which is conveniently stored in "imagesearch.au3".

You want to include this code in your script, so instead of messing around figuring out how to send autoitv3 relative or absolute paths to the script, you can just put it into the same directory as your script.

c:\users\n2n\mabi\bots\cobweb_bot\cobweb_bot.au3
c:\users\n2n\mabi\bots\cobweb_bot\imagesearch.au3

First line in cobweb_bot.au3 is:

#include <ImageSearch.au3>
06/11/2011 20:24 Jwguy#173
Tried Argentino's quoted script, with the auto-alt. It doesn't work, though. Tried with plenty of images, both varying in quality and type, from Jpeg to PNG, from Fullscreen to Windowed, and zoomed in and zoomed out. Doesn't move to anything unless you attempt to rotate the camera, at which point it's more likely to send you off into the distance somewhere.
06/23/2011 01:23 linxindao#174
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
Ok so, you seem to know what you're doing, so I've got a question, I took your code, tried to understand it as best I could and then tried to make this from it:
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("herb.jpg",1,$x1,$y1,100) ;change the herb.jpg if you want to pick up something else.
if $result=1 Then
	MouseMove($x1,$y1,3)
	MouseClick("left",$x1,$y1,1,3)
	Sleep(1000) ;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)
if $result=0 Then
	Send("{LALT up}")
	$result = _ImageSearch("manaherb.jpg",1,$x1,$y1,100)
		if $result=1 Then
			MouseMove($x1,$y1,3)
			MouseClick("left",$x1,$y1,1,3)
			Sleep(3000)
		if $result=0 Then
			$result = _ImageSearch("baseherb.jpg",1,$x1,$y1,100)
				if $result=1 Then
				MouseMove($x1,$y1,3)
				MouseClick("left",$x1,$y1,1,3)
				Sleep(3000)
				if $result=0 Then
					$result = _ImageSearch("bloodyherb.jpg",1,$x1,$y1,100)
						if $result=1 Then
							MouseMove($x1,$y1,3)
							MouseClick("left",$x1,$y1,1,3)
							Sleep(3000)
						if $result=0 Then
							$result = _ImageSearch("goldenherb.jpg",1,$x1,$y1,100)
								if $result=1 Then
									MouseMove($x1,$y1,3)
									MouseClick("left",$x1,$y1,1,3)
									Sleep(3000)
								if $result=0 Then
									$result = _ImageSearch("sunherb.jpg",1,$x1,$y1,100)
										if $result=1 Then
											MouseMove($x1,$y1,3)
											MouseClick("left",$x1,$y1,1,3)
											Sleep(3000)
										EndIf
								EndIf
						EndIf
				EndIf
		EndIf
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
my idea is to have it auto search for herb patches and pick them (for use in homesteads) does this code look right or am I doing it wrong? Help would be appreciated for a noob like me :3
06/23/2011 01:44 adam_j#175
Why not just do a file to array, coupled with a progressive search loop, to search all the images in the array, followed by a case switch, should you wish to perform any unique actions?

That'd have saved you quite a lot of time, and made it a lot less complex.

By the way, it would be more effective to trial your script, and ask for advice on why things aren't working, rather than asking for someone to do all your work for you.

Btw, that many IF scenarios in a single branch is just unnecessary, especially as your scenarios are not mutually exclusive. If you fail the first test, it's naturally going to progress to the next test, regardless of whether you force it to or not.

Code:
While 1
$result = _ImageSearch("goldenherb.png",1,$x1,$y1,50)
If result = 1 then actions go here.
Endif


$result = _ImageSearch("manaherb.png",1,$x1,$y1,50)
If result = 1 then actions go here.
Endif
Wend
The script would be forced to examine both IF statements, to see if they are true or false.
06/23/2011 04:15 Trismic#176
If you are on Win7, try to compile it as an .exe and run it as admin.
06/23/2011 05:25 SSDarkLink#177
Quote:
Originally Posted by Trismic View Post
If you are on Win7, try to compile it as an .exe and run it as admin.
or right click the .au3 file and run as (x86).
06/23/2011 11:25 adam_j#178
Quote:
Originally Posted by Trismic View Post
If you are on Win7, try to compile it as an .exe and run it as admin.
No idea who you're replying to, the previous poster didn't mention anything about problems RUNNING the script..

But to add to what you posted, you don't need to compile it to get a script to run as admin, just add "#RequireAdmin" to your script.

I put it at the top with my includes, in pretty much every script.
06/27/2011 11:25 linxindao#179
Quote:
Originally Posted by adam_j View Post
Why not just do a file to array, coupled with a progressive search loop, to search all the images in the array, followed by a case switch, should you wish to perform any unique actions?

That'd have saved you quite a lot of time, and made it a lot less complex.

By the way, it would be more effective to trial your script, and ask for advice on why things aren't working, rather than asking for someone to do all your work for you.

Btw, that many IF scenarios in a single branch is just unnecessary, especially as your scenarios are not mutually exclusive. If you fail the first test, it's naturally going to progress to the next test, regardless of whether you force it to or not.

Code:
While 1
$result = _ImageSearch("goldenherb.png",1,$x1,$y1,50)
If result = 1 then actions go here.
Endif


$result = _ImageSearch("manaherb.png",1,$x1,$y1,50)
If result = 1 then actions go here.
Endif
Wend
The script would be forced to examine both IF statements, to see if they are true or false.
Thanks, I don't really know what I'm doing with this and I was taking a stab without really knowing anything about this program or command lines. I barely understand C++ and was hoping somebody like you could point me in the right direction.
06/27/2011 12:31 kotarou3#180
Quote:
Originally Posted by linxindao View Post
Thanks, I don't really know what I'm doing with this and I was taking a stab without really knowing anything about this program or command lines. I barely understand C++ and was hoping somebody like you could point me in the right direction.
It's AutoIT script...