Jump to content

Best way to go about this


Recommended Posts

Making up a quick loader for Diablo 2 to log on to battle net.

So the script loads my D2 short cut, and have a mouse click to bring me into the main screen.

At this point I'm curious what function to use to find the Multiplayer button. Than run into the same task with choosing character, etc.

Thank you.

Link to comment
Share on other sites

A D2 loader to skip the intro would be as simple as:

$Path = "D:\Diablo II"
Run($Path & "\Diablo II.exe")
WinWaitActive("Diablo II")
Sleep(1000)
Send("{ESC}")
Sleep(100)
Send("{ESC}")
Sleep(500)
MouseDown("primary")
MouseUp("primary")

And I doubt it would be much harder to do the login, just find out how many pixels you would need the mouse to move down and then do:

$pos=MouseGetPos()
MouseMove($pos[0],$pos[1]+50,0) ; for example 50
Sleep(200) ; doesn't have to be 200
MouseDown("primary")
MouseUp("primary")

That would click on the Battle.net button, if the pixel count is accurate; then:

Sleep(2000) ; more/less depending on how long it takes you to get to that screen
Send("username") ; the username box is already selected when you get to the login so no clicking needed
Send("{TAB}")
Send("password")
Send("{ENTER}")

And that would log you in. As for the character selection you can do the same as what I just showed you, just find out the coordinates of each character and key whichever in. There might be a different way to do it but this seems like the most logical to me, I used it and it logged me in fine with the sleep times and pixel counts I used in the example; hope it works for you.

Edited by coppacity
Link to comment
Share on other sites

Is there a way to get it to do something like a pixel search on the diablo 2 buttons? I noticed they're all the same color so I'm not quite sure if there's anyway around it. Problem is sometimes it ends up missing the buttons.

Link to comment
Share on other sites

Is there a way to get it to do something like a pixel search on the diablo 2 buttons? I noticed they're all the same color so I'm not quite sure if there's anyway around it. Problem is sometimes it ends up missing the buttons.

PixelGetColor Should do what you are looking for. Just search for the right color in the right zone of the button, as written things are different, so a button with Login and a button with Charachter written on it, also if the same color, should be different in a same point of it. Edited by niubbone
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...