d2qol 1.5.0 - Quality of Life Utility

Discuss Median XL!
User avatar
ryunp
Lava Lord
93 | 45
Common Love Badge
Earned over 20 cookies
Common Guide Badge
Created a complete character guide
Common Patron Badge
Patreon Contributor
1.3.6 fixed bug causing Drop Item to fail in fullscreen modes.

Have not been able to find much information on AHK bugs related to Windows language differences. If running the project as an AHK native program works on non-English Windows, than installing AutoHotKey and running src/d2qol.ahk will get it running until further revelations.
MedianUV
Jungle Hunter
29 | 4
Although I have no need for this (have my own noob AHK scripts to handle crafts/shopping) ...
Your AHK is a goldmine of things I might want for things in the future.
The way you constructed the GUI, especially ... well played

One thing that I rely heavily upon that you don't seem to do is ImageSearch
That's how I go about getting AHK to recognize that an oil of craft needs to go to a certain x,y - for example

Cheers
User avatar
ryunp
Lava Lord
93 | 45
Common Love Badge
Earned over 20 cookies
Common Guide Badge
Created a complete character guide
Common Patron Badge
Patreon Contributor
MedianUV wrote:The way you constructed the GUI, especially ... well played

I've failed to update this app many times in the past because I would get caught up building a framework for UI components. This time everything is statically defined and while not being completely satisfied with the approach, it works fine. I've tried to at least separate concerns into their own files.


MedianUV wrote:One thing that I rely heavily upon that you don't seem to do is ImageSearch

I was not able to get ImageSearch to perform correctly despite using variations in parameters, image croppings, and image types. I would love to know how you get it to work properly. Hit me up in Discord, we can collab and both learn some stuff!


My next major update is to add a Crafting tab to support moving over the item being rerolled and automatically placing crafting materials in cube. I've prototyped logic for this before, but couldn't get the image detection working. A big concern is different resolutions/renderers may cause matching issues.
MedianUV
Jungle Hunter
29 | 4
1::
ImageSearch, Oil_X, Oil_Y, 410, 200, 715, 480,*25 %A_ScriptDir%\OilCraft.png
MouseClickDrag, Left, %Oil_X%, %Oil_Y%, 450, 269
MouseClick, Left
MouseClick, Left, 244, 362
MouseMove, 360, 319
Return

Image


^^ There it is. Mainly what I use to craft.
If you put in a condition for arcane crystals ... say it looks for a color in the cube and doesn't see...
Then you have yourself a cubing script
User avatar
aerial
Ice Clan
577 | 157
Common Popularity Badge
Has a thread with over 10.000 views
Great Love Badge
Earned over 100 cookies
Common Guide Badge
Created a complete character guide
Another useful feature would be reopening gambling screen with press of 1 button.
User avatar
Quirinus
Amazon Warrior
1694 | 162
Common Posting Badge
Posted over 1.000 messages
Common Popularity Badge
Has a thread with over 10.000 views
Great Love Badge
Earned over 100 cookies
Common Supporter Badge
Donated 1 time
Great Contribution Badge
Is an active forum collaborator / developer
ryunp wrote:
MedianUV wrote:The way you constructed the GUI, especially ... well played

I've failed to update this app many times in the past because I would get caught up building a framework for UI components. This time everything is statically defined and while not being completely satisfied with the approach, it works fine. I've tried to at least separate concerns into their own files.


MedianUV wrote:One thing that I rely heavily upon that you don't seem to do is ImageSearch

I was not able to get ImageSearch to perform correctly despite using variations in parameters, image croppings, and image types. I would love to know how you get it to work properly. Hit me up in Discord, we can collab and both learn some stuff!


My next major update is to add a Crafting tab to support moving over the item being rerolled and automatically placing crafting materials in cube. I've prototyped logic for this before, but couldn't get the image detection working. A big concern is different resolutions/renderers may cause matching issues.


1. full screen and windowed mode colors are different iirc. I solved it by using 2 sets of cropped images, one for each. might have used disable desktop composition.
2. your image has to be cropped so that it doesn't include the background square (0 pixels from it), while still being unique to the item. so what MedianUV did is not good, as it will only work for him and maybe a few other people. you can check my crops in my script/images.
3. i used tolerance 10 it seems. I remember testing this a bunch.
4. im probably forgetting something else, since I did this a long time ago. brightness/gamma/video mode also probably affects the images.
5. i used cropped images of each square (they are all a bit different due to the background) to detect empty ones, so I could make the script move items from stash<->inv, etc.

this doesn't mean this is the best approach, it's just something that worked for my script and people that used it.

a much better approach would be to look at d2stats item handling code and use it for this.

aerial wrote:Another useful feature would be reopening gambling screen with press of 1 button.


this one is a bit tricky, it's hard to get it to work 100%, at least when I tried it. clicking on the npc keeps it from moving though, that helps. but using image search is harder since the npc is animated, and might move if not clicked on constantl/often enough.

again, reading the npc from the game's memory would be a better approach.
"but if it's simple it's not that hard" - Quirinus 2017
"small things like this are not a big deal" - Quirinus 2017
User avatar
ryunp
Lava Lord
93 | 45
Common Love Badge
Earned over 20 cookies
Common Guide Badge
Created a complete character guide
Common Patron Badge
Patreon Contributor
Quirinus wrote:a much better approach would be to look at d2stats item handling code and use it for this.


I'm familiar with DllCall() and how it operates, but I have limited experience and not familiar with d2 memory layouts.

Quirinus wrote:
aerial wrote:Another useful feature would be reopening gambling screen with press of 1 button.


this one is a bit tricky, it's hard to get it to work 100%, at least when I tried it. clicking on the npc keeps it from moving though, that helps. but using image search is harder since the npc is animated, and might move if not clicked on constantl/often enough.


Scripts for gambling aren't that bad as NPCs do not move while being used. Having a hotkey to identify the NPC clicking location before each session of gambling is really all it requires, since the 'Gamble' menu item is just an offset.

Image scanning does work well on 800x600 and 640x480:
► Testing OK


But it breaks down with up-scaling. The interpolation of both the sprites bitmap and math of the inventory cell locations adds up to entirely frustrating experience. Here is the same item in 5 different inventory cells:
► Interpolation Plz


A somewhat viable solution was to expand the mask over all the volatile pixels to isolate the invariants. But it's far too laborious, for instance Oil of Luck on 1024x768 was detecting in all cells with this image/mask (without the sampling markers, naturally):
► Matching Sprite


Meh. I'll stay away from image detection. That way as long as the game's behavior stays consistent, the utility will still assist with them. I've got a couple clever and effective ideas for identifying target item zones within game, so we shall see. I may look into memory reading, but want to keep this utility reasonably maintainable for now.
User avatar
Quirinus
Amazon Warrior
1694 | 162
Common Posting Badge
Posted over 1.000 messages
Common Popularity Badge
Has a thread with over 10.000 views
Great Love Badge
Earned over 100 cookies
Common Supporter Badge
Donated 1 time
Great Contribution Badge
Is an active forum collaborator / developer
Oh yeah upscaling with image detection is lol.

I'll probably take a stab at memory reading for items, if i find time, which is unlikely. Qq
"but if it's simple it's not that hard" - Quirinus 2017
"small things like this are not a big deal" - Quirinus 2017
geminata
Skeleton
2 | 0
d2clicker was way too hard to use but it's really ez and useful thank you!
User avatar
krys
Rust Claw
80 | 11
you can check my script and see if you want to use some features/functions for easier life
viewtopic.php?f=4&t=2116&p=159975#p159975