Hi,
I am trying lately to come up with a bot that does several things - collect gold, pickup magic/rare/legendary/gem items, repair, sell magic items.
The thing is that on my machine most bots doesn't work. Some are not detecting the cellar, some are not even looking at the right box for the cellar, etc.
So after several hours of reviewing scripts, testing, and some partial coding from my side, I came up with this:
[AutoIt] Sarkoth Farmer - Pastebin.com
I think it is neat.
At the moment that bot gets to the cellar almost every time ... only some time stops just a click away from the checkpoint ... but that doesn't bother me.
What bothers me is that items and gems are not being picked up.
You can see that I have a function, which is getting called properly, for collecting magic items:
Code:
Func LootMagics()
For $gI = 0 to 4
$array = StringSplit($ImageFiles[3][$gI],"|")
$file = $array[1]
$accuracy = $array[2]
$target = _ImageSearchArea($ImgDir & $file, 1, $LootingArea[0], $LootingArea[1], $LootingArea[2], $LootingArea[3], $ISx, $ISy, $accuracy)
If $target > 0 Then
If $Sounds = True Then
SoundPlay($SoundsDir & $SoundFiles[3], 0)
EndIf
$Magics+=1
MouseClick("LEFT", $ISx, $ISy, 1, 1)
Sleep(300 + $LootDelay)
MouseMove(120, 120, 2)
Sleep(100)
If $Sell = True Then
CheckBagFull()
If $FullBag = True Then
$FullBag = False
Sleep(300)
LootMagics()
EndIf
EndIf
EndIf
Next
$MagicLootAttempts+=1
If($MagicLootAttempts >= $MagicLootAmount) Then
Return
Else
LootMagics()
EndIf
EndFunc
I cannot be 100% sure but I believe the problem comes from the image files I am using. Thus I focused on two main things to do so I can improve the bot:
1. Test to make sure that ImageSearch works
2. Create own image files
The problem is that I don't know how to do my own image files and I can't find even a single article on Google for more than 3 hours now. And I can't really complete step 1 without hand-made images
So if someone could help with some guidelines, even a link to external resource works, it would be greatly appreciated!
P.S.
I have no problems when it comes to swimming in deep waters of programming.
Edit:
My box is Win 7 64bit, I have the ImageSearch DLLs for 32 and 64 placed in both %SystemRoot% and %SystemRoot%/system32 (%SystemRoot is the Windows directory). I tried running the script as x64 and as x86 - both times no luck with pickups.
Edit 2:
Just now a rare got dropped with two magic items and two gems - the bot did not pick any of them.