Jump to content

Diablo II Pick-It need idea's / support


Recommended Posts

Hey guys im trying to make a "pickit" for my game to automatically pickup "Rare" items which are yellow. Heres the code i got sofar.

; Script Start - Add your code below here
Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
AutoItSetOption ( "PixelCoordMode", 0 ); Do not change this parameter! It's needed for windowed D2.
WinActivate("Diablo II")
WinMove("Diablo II", "", 0, 0)
$Rares = 0xD8B864
$Uniques = 0x9C826B
$Sets = 0x21D74A


Send("{ALTDOWN}")

While 1
WinWaitActive("Diablo II", "")
$RareFind = PixelSearch(235, 173, 600, 424, $Rares)
If @error = 0 Then
    Sleep(500)
    Send("{ALTUP}")
    $RareFind2 = PixelChecksum($Rarefind[0],$Rarefind[1],$Rarefind[2], $Rarefind[3])
    if @error = 1  Then
    Send("{ALTDOWN}")
    MouseClick("left", $rarefind[0], $rarefind[1])
    endif
    #Region --- CodeWizard generated code Start ---
;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=Warning
#EndRegion --- CodeWizard generated code End ---
Else
    $coord = PixelSearch( 0, 0, 800, 600,0x738639)
EndIf
WEnd

I tried to make it so. It would search for the rare, if it found it it would send alt up, which makes items invisible so the bot doesnt click a yellow wall, or anything, then if it didnt find it, which means its an item, it would make the items visible again and click it.

Heres an image of what im trying to do.

Posted Image

So whats wrong with my pickit. And how do i make it more efficient with not clicking walls or non-item objects.

Link to comment
Share on other sites

Try this:

Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
AutoItSetOption ( "PixelCoordMode", 0 ); Do not change this parameter! It's needed for windowed D2.
WinActivate("Diablo II")
WinMove("Diablo II", "", 0, 0)
$Rares = 0xD8B864
$Uniques = 0x9C826B
$Sets = 0x21D74A
Global $Item1_Check = False
Global $Item2_Check = False
Send("{ALTDOWN}")



While 1
WinWaitActive("Diablo II", "")
$RareFind = PixelSearch(235, 173, 600, 424, $Rares)
If Not @error Then
    $Item1_Check = True
    Sleep(500)
    Send("{ALTUP}")
    $RareFind2 = PixelChecksum($Rarefind[0],$Rarefind[1],$Rarefind[2], $Rarefind[3])
    If Not @error Then
        $Item2_Check = True
        Send("{ALTDOWN}")
            If $Item1_Check = True And $Item2_Check = True Then
                MouseClick("left", $rarefind[0], $rarefind[1])
            EndIf
            Global $Item1_Check = False
            Global $Item2_Check = False
        EndIf
EndIf
WEnd

Edit: Oops, thought RareFind & RareFind2 were both pixelsearches <.<

Edited by will88
Link to comment
Share on other sites

I think it would work.

But i need to figure out the

$RareFind2 = PixelChecksum($Rarefind[0],$Rarefind[1],$Rarefind[2], $Rarefind[3])

Problem.

I dont know how to format the pixelsearch coordinates as X... Y..X...Y.. for pixelchecksum

Edited by ecstatic
Link to comment
Share on other sites

I think it would work.

But i need to figure out the

$RareFind2 = PixelChecksum($Rarefind[0],$Rarefind[1],$Rarefind[2], $Rarefind[3])

Problem.

I dont know how to format the pixelsearch coordinates as X... Y..X...Y.. for pixelchecksum

As far as I know, you can only get the X,Y position from PixelSearch([0] & [1]). Edited by will88
Link to comment
Share on other sites

My only problem is, it clicks non-item objects also. I cant specify a area because it may change at will.

I tried to make it so when the items disappeared it would research it to make sure it isnt a object.

Anyone have some other idea's?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...