Jump to content


Photo

Diablo III - Looting Script Help.


  • Please log in to reply
7 replies to this topic

#1 Epic

Epic
  • Members
  • 5 posts

Posted 10 June 2012 - 11:41 PM

Hello all,

(Inspired by, credit, and most scripting from 'randallf's post: <!-- l --><a class="postlink-local" href="http://www.autohotkey.com/community/viewtopic.php?f=15&t=87067">viewtopic.php?f=15&t=87067</a><!-- l -->)

I'm now trying out running it on full windowed 1680x1050

I want to create a script for Diablo III that whenever I press the hotkey (I use '=' sign) It will auto scan, and loot all Blues, Yellows, and Browns... Greens too I suppose.

My problem, is it's grossly inaccurate; a third of the time it gets an item. The other 2/3s it clicks something random or detects nothing at all!
I understand how there's so many pixels, and even one can fit the profile and the mouse will click there... and be wrong.

Is there a better way than what I have so far, or if there's a way to have AHK detect a good 10 or so of the right color in a spot (not just a pixel) before triggering a positive color match, then click?

Thanks, here's it so far:

=::							;HotKey
ItemFound = 0						;Loot
Loop, 3
{
   YellowScanClick(0, 90, 1679, 888)
}

Return
F12::							;Terminate App F12
Exitapp

YellowScanClick(X1, Y1, X2, Y2)
{
   Global ItemFound
   PixelSearch, xloc, yloc, %X1%, %Y1%, %X2%, %Y2%, 0x00FF00, 2, Fast ;Greens
   If !ErrorLevel
   {
      ItemFound := 1
      MouseClick,, %xloc%, %yloc%,, 3
      Sleep, 500
   }
   PixelSearch, xloc, yloc, %X1%, %Y1%, %X2%, %Y2%, 0x00FFFF, 2, Fast ;Yellows
   If !ErrorLevel
   {
      ItemFound := 1
      MouseClick,, %xloc%, %yloc%,, 3
      Sleep, 500
   }
   PixelSearch, xloc, yloc, %X1%, %Y1%, %X2%, %Y2%, 0x2F64BF, 2, Fast ;Legendaries
   If !ErrorLevel
   {
      ItemFound := 1
      MouseClick,, %xloc%, %yloc%,, 7
      Sleep, 500
   }
   PixelSearch, xloc, yloc, %X1%, %Y1%, %X2%, %Y2%, 0xFF6969, 2, Fast ;Blues!
   If !ErrorLevel
   {
      ItemFound := 1
      MouseClick,, %xloc%, %yloc%,, 7
      Sleep, 500
   }
Return
}


#2 SlayerMK

SlayerMK
  • Members
  • 14 posts

Posted 11 June 2012 - 06:37 PM

this is written in AHK_L, not sure of compatibility with others.
what i use when playing, also basic structure of what i use for actual Bots.
Doesn't have Green(sets) yet, but you could add it it using whats there as a template.

Searchs a predefined rectangle around your character
was made while in Windowed Full screen 1680x1050

Push 1 on your number pad for it to run through once, if you want more cycles, make it into a loop or keep pushing 1 untill everything is looted lol.
use - to close the script
pops up ToolTips (debuging i guess) if found
otherwise pops up ToolTips in another spot if not found.

Hope This Helps
Pm'd OP


#3 jjruhle

jjruhle
  • Members
  • 1 posts

Posted 23 June 2012 - 09:25 AM

How did you actually get it to recognize the image? On mine, it seems like Diablo 3 client has blocked the image searching or something... No matter what I do, it never seems to find the pixel... Even with a variation of 250.

Any ideas?

#4 Puttah

Puttah
  • Members
  • 63 posts

Posted 23 June 2012 - 01:23 PM

How did you actually get it to recognize the image? On mine, it seems like Diablo 3 client has blocked the image searching or something... No matter what I do, it never seems to find the pixel... Even with a variation of 250.

Any ideas?

Try taking a screenshot with the client open, and then paste that into paint. You'll see that it only sees what's behind the client, which is exactly what the pixelsearch is finding as well.
I have no idea why it's doing that...

#5 SlayerMK

SlayerMK
  • Members
  • 14 posts

Posted 23 June 2012 - 04:37 PM

make sure you put Coordmode, Pixel, Relative at the top of your scripts
and i've found, from searching the forums, that Pixelsearch will not work or rarely works with Aero Mode on and wont work in Full Screen (i think)
to turn aero off, go to Control Panel --> Personalization -->Windows Classic, and put your screen in either Window or FS window.

Hope this helps ^

#6 Tes

Tes
  • Members
  • 3 posts

Posted 25 June 2012 - 12:02 AM

this is written in AHK_L, not sure of compatibility with others.
what i use when playing, also basic structure of what i use for actual Bots.
Doesn't have Green(sets) yet, but you could add it it using whats there as a template.

Searchs a predefined rectangle around your character
was made while in Windowed Full screen 1680x1050

Push 1 on your number pad for it to run through once, if you want more cycles, make it into a loop or keep pushing 1 untill everything is looted lol.
use - to close the script
pops up ToolTips (debuging i guess) if found
otherwise pops up ToolTips in another spot if not found.

Hope This Helps

Pm'd OP

Could you please provide your looting script?
Thanks in advance.

#7 SlayerMK

SlayerMK
  • Members
  • 14 posts

Posted 27 June 2012 - 09:00 PM

this is written in AHK_L, not sure of compatibility with others.
what i use when playing, also basic structure of what i use for actual Bots.
Doesn't have Green(sets) yet, but you could add it it using whats there as a template.

Searchs a predefined rectangle around your character
was made while in Windowed Full screen 1680x1050


Hope This Helps

Pm'd OP

Could you please provide your looting script?
Thanks in advance.

Sure i suppose i could do that :p
Tooltips are/were for debugging, just never around to taking them out
this is right out of my bot script, i just removed a few ControlSetText's that relate to my gui :p
Enjoy
CoordMode, Pixel, Window ;put these at the top of your script
CoordMode, Tooltip, Window ;put these at the top of your script
Loop, 2
    {
PixelSearch, Rx, Ry, 556, 256, 1065, 600, 0xFFFF00, 1, RGB FAST ;;Rare Pickup
sleep 300
If Errorlevel
        {
            sleep 1000
            ToolTip, Rare Missing, 1600, 425
            SetTimer, RemoveToolTip, 500
        }
Else
        {
            sleep 100
            MouseClick left, %Rx%, %Ry%, Down
            ToolTip, Rare Found, 900, 300
            SetTimer, RemoveToolTip, 1000
            sleep 500
        }
}
loop, 3
    {
	PixelSearch, Px, Py, 556, 256, 1065, 600, 0x6969FF, 3, RGB FAST ;;Magic Pickup
sleep 300
If Errorlevel
        {
            sleep 1000
            ToolTip, Magic Missing, 1600, 400
            SetTimer, RemoveToolTip, 500
            Break
        }

else
        {
            sleep 200
            MouseClick left, %Px%, %Py%, Down
            sleep 75
	    ToolTip, Magic Found, 900, 300
            SetTimer, RemoveToolTip, 1000
            sleep 500
        }
}
Loop, 2
    {
PixelSearch, Vx, Vy, 556, 256, 1065, 600, 0xBF642F, 1, RGB FAST ;;legendary pickup 
sleep 300
If Errorlevel
    {
        sleep 1000
        ToolTip, Legendary Missing, 1600, 450
        SetTimer, RemoveToolTip, 1000
        Break
    }
Else
        {
            sleep 200
            MouseClick, left, %Vx%, %Vy%, Down
            ToolTip, Legendary Found, 900, 300
            SetTimer, RemoveToolTip, 1000
            sleep 100
        }
}
Loop, 3
    {
PixelSearch, Gx, Gy, 556, 256, 1065, 600, 0x777777, 3, RGB FAST ;;White Pickup
sleep 300
If Errorlevel
        {
        sleep 1000
        ToolTip, White Missing, 1600, 475
        SetTimer, RemoveToolTip, 1000
        Break
        }
Else 
        {
        sleep 200
        MouseClick, left, %Gx%, %Gy%, Down
        ToolTip, White Found, 900, 300
        SetTimer, RemoveToolTip, 1000
        }
}
Known bugs: clicking spots where it thinks items are but just randomly found a matching pixel on the floor lol and the rectangle it searches could be larger if needed.

#8 guest

guest
  • Guests

Posted 22 September 2012 - 09:24 PM

yolo\
is it possibleto give me a autohokey bot or loot bot
i created my script... and its not workinghwell