Jump to content

detecting when screen changes on mouseover


Sarc
 Share

Recommended Posts

Hi there

In diablo2, some of you may be aware (and some not) that when you mouseover stairs to a lower level, or a door, or such and such, a label appears with the name of the new location

now without wanting to go into OCR and so on, i was wondering if there was something i could use to detect that there is a different colour somewhere near the mouse location, and that due to this, we will click

winwaitactive("Diablo II")
sleep(1000)

$PossX = "50,100,150,200,250,300,350,400,450,500,550,600,650,700,750"
$PossY = "50,100,150,200,250,300,350,400,450,500,550"


$ArrayX = StringSplit($PossX, ",")
$ArrayY = StringSplit($PossY, ",")

For $i = 1 To $ArrayX[0]
    for $j = 1 to $ArrayY[0]
        $xcoord = $ArrayX[$i]
        $ycoord = $ArrayY[$j]
    mousemove($xcoord, $ycoord,0)
    
    Next
Next

this is the code i'm using. i've set it to scan the screen in 50,50 blocks.. crude but it will work.. eventually :lmao:

then between mousemove and next, i want to put the check part

any1 knows how i could do this?

would be MOST appreciated :P

Cheers

Link to comment
Share on other sites

Maybe something like this for in there. Could adjust the For loop step size for speed and whatever. Just use this as an idea/example.

For $a = ($xcoord - 25) to ($xcoord + 25)
      For $b = ($ycoord - 25) to ($ycoord + 25)
             If PixelGetColor($xcoord,$ycoord) = $COLOR_OF_LABEL_TEXT Then
                      MouseClick ( "left" , $xcoord, $ycoord)
             EndIf
      Next 
Next
Link to comment
Share on other sites

Thanx Oxin8 for the reply. i've not had chance to try it eyet but it looks good what you've posted

Smirk_zero: i know of a 'bot' that uses such a method. it would be very useful and accurate yes, however i do not know of such ways to create such patches. if you know or have links to somewhere with info on how to create them, it would b most grateful. by the way, when yo say its been tried before, do you mean tried and failed?

Link to comment
Share on other sites

look at the top bot

http://www.d2freedom.com/bots.html

it uses autoit and a mod for colors. if it doesn't do what you want, you could always just use the mod.

yeah i have the mod files from MMbot, however something within the bot is coded to actually use the files. without using the actual bot i cant get the modded part to work, and ofc the bot is password protected so it would be hard to get access to the code used to implement the mod :P

Link to comment
Share on other sites

if i remember right you add a certain parameter when you open diablo in the shortcut. just google around for mods to see how they do it.

thanx, i'll try and have a look now

i thought it might be -direct -txt but it doesnt seem to be :/

Link to comment
Share on other sites

thanx, i'll try and have a look now

i thought it might be -direct -txt but it doesnt seem to be :/

couldn't you just do a quick pixel checksum of the area around the mouse before and after the mouse move? i mean if the tooltip is always in the same place in relationship to the cursor, just do a pixelchecksum() before the move, and then another when the mouse is in position, if the checksum has changed (make sure that the cursor is not in the area being evaluated) then you know something is different, like a tooltip has appeared...

Link to comment
Share on other sites

If u want to mess around with the graphics of the game along with the names of things ur gona need a Table Editor and Excel. Where i learned to mod (just the very basics, but it gives u the genreal idea) is www.planetdiablo.com look on the left bar for modding tutorial.

It explains how you open the mod also (it is -direct -txt). If you need any more help PM me and ill try.

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...