Slashdot Mirror


Diablo II JavaScript Parser Automates D2 Gameplay

mikegogulski writes "d2jsp is an embedded implementation of a JavaScript engine for executing user program code (scripts) inside Diablo II. d2jsp can be used to make Diablo II do almost anything that can be done in the game by a human player, and some things (such as knowing the immunities of monsters four screens away) that cannot. d2jsp has an installed base in the tens of thousands, an active user community of over 6500, and hundreds of active projects in its script database. Work progresses toward the Holy Grail of Diablo II hack development, the Complete Diablo Bot, which will eventually enable the entire game to be played automatically without human intervention. All Your RPG Are Belong To Us!"

1 of 108 comments (clear)

  1. Re:How does it work? by njaguar · · Score: 3, Informative

    In theory, this would be possible for any game.
    How it works is, let's say you want to move.

    script: move(x,y);

    This would move your player as if you clicked those coordinates on the screen yourself (though other stuff is involved, it's game x y, which is not actual screen coordinates at all, so requires other things as well). d2jsp calls the function that "clicking" would, but does NOT use keypress or mouseclick events. It calls the functions as though the game itself were calling them.
    In short, it requires lots of reverse engineering, as you can imagine. "Move" is about as simple of a function as one could imagine, other than "print", which again hijacks the print function inside Diablo II. d2jsp (in the latest version I am working on) can literally do almost *everything* that a player sitting there could. It's no longer a matter of can't. :)

    Of course, a picture is always worth a thousand words, so getting someone to demo you a script in action would probably answer all of your questions. That, and of course looking at the scripts themselves.