Jump to content

I'm stuck on what to do next :(


Recommended Posts

I'm wanting to make a diablo 2 bot for learning purposes.. a den of evil bot. I've started and got to the point where it gets in game.. but i guess now the hardest part comes.. the pathing or the moving.. detecting what map is loaded and how to move from point a to point b.. this is where i was stuck 2 years ago and couldn't figure it out and i gave up lol. I couldn't understand how to do it and maybe I still can't. Maybe i need a different project lol but i'm open to any comments or suggestions or help.

I need a start on how to make my bot move. How to get it to detect what map has been loaded and how to move from the start to the den. I tried searching, i treid reading many other bot topics and i read about setting waypoints and memory reading and all that. But that doesn't work in Diablo 2 does it. Oh well Here is my code.. up to the point it gets into the game.

Dim $UN = IniRead(@ScriptDir & "\Setup.ini","UNPW","Username","Not Found")
Dim $PW = IniRead(@ScriptDir & "\Setup.ini","UNPW","Password","Not Found")
Dim $D2Dir = IniRead(@ScriptDir & "\Setup.ini","D2Dir","Diablo Directory","Not Found")
Dim $Charslot = IniRead(@ScriptDir & "\Setup.ini","Charslot","Slot#","Not Found")
Dim $String = StringSplit(IniRead(@ScriptDir & "\Setup.ini", "Random", "String", "Not Found"), ",")
Dim $Exit = HotKeySet("{ESC}","Stop")
Dim $Gn = GameName()

Func Stop()
    Exit
EndFunc


Run($D2Dir) ; Opens d2
WinWait("Diablo II") ; Waits for d2 to activate
WinActivate("Diablo II")
WinWaitActive("Diablo II")
Send(50) ; gives cpu time to think
WinMove("Diablo II","",0,0) ; moves d2 window to top left
Sleep(2800) ; waits for it to get to login screen
Send("{TAB}") ; moves to account login input box
Sleep(50)
Send($UN) ; types username
Sleep(50)
Send("{TAB}") ; moves to password input box
Sleep(50)
Send($PW) ; types password
Sleep(50)
Send("{ENTER}") ; submits un & pw

While 1 ; Will add option to choose different chars later
    Select 
        Case $Charslot = 1
            MouseClick("left",180,160,1)
        ExitLoop
    EndSelect
WEnd

Func GameName() ; this Function creates a random game name.
    $Name = ""
    $iLength = Random(3, 15, 1)      ; Create a random length between 3 and 15 characters
    For $x = 1 to $iLength           ; <=== x determines which character you are currently at in the string
        $y = Random(1, 62, 1)
        Switch $y
            Case 1 to 10             ; y is between 1 and 10
                $Name &= Chr($y + 47); Numbers 0-9     ;<== y + 47 will equal ASCII codes 48 - 57
            Case 11 to 36            ; y is between 11 and 36
                $Name &= Chr($y + 54); Letters A-Z     ;<== y + 54 will equal ASCII codes 65 - 90
            Case 37 to 62            ; y is between 37 and 62
                $Name &= Chr($y + 60); Letters a-z     ;<== y + 60 will equal ASCII codes 97 - 122
        EndSwitch
    Next
    Return $Name
EndFunc

Sleep(200) 
Send("{ENTER}") ; submits char selection
Sleep(2000) ; waits 2 seconds before clicking create game
MouseClick("left", 595, 485, 1) ; clicks create game.
Sleep(200) 
Send($Gn) ; types game name
Sleep(200)
Send("{TAB}") ; moves to game pass
Sleep(200)
Send($Gn) ; types game pass
Sleep(200)
Send("{ENTER}") ; submits random game name and pass
Sleep(3000) ; waits 3 seconds to enter game

Here is the .ini

[UNPW]
Username = UN
Password = PW

[D2Dir]
Diablo Directory = C:\Program Files\Diablo II\Diablo II.exe -w -ns -skiptobnet

[CharSlot]
Slot# = 1
Link to comment
Share on other sites

What will I have to mod? I've spent the past couple hours reading tutorials and finding tools to read mpq's and read a 36 page pdf tutorial.. didn't have anything about changing the color and that's what i need to do isn't it.. I saw a d2 bot work on youtube that made the diablo 2 screen modded black completely and made a path of a blue line the path it has to follow from point a to point b.. is that what i have to do? seems even more complicated to make a d2 pathing bot than a WoW travel bot to me now T_T has anyone here actually made a d2 pathing bot?

Link to comment
Share on other sites

Do you need to code it in autoit?

Otherwise redvex is an great gateway program that you can use.

you could google for more info if you want.

Most/best diablo 2 bots are made with autoit to login and create games and redvex to control the character+pickup etc.

[center][/center]

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