noah- / d2bs

D2BS: Diablo 2 Botting System, a JS API to perform human-like actions utilizing Mozilla Spidermonkey
104 stars 66 forks source link

Help getting PD2 Gamelist GameServer and Difficulty values #41

Open croboy opened 2 years ago

croboy commented 2 years ago

Hello

Can you please add support for PD2 Join List.

When you refresh games, I want to able to join a game based on the GameServer or the Difficulty.

But in the current gamelist for Vanilla D2, it doesn't get those values.

getGameList: function () { var i, text, gameList;

text = this.getText(4, 432, 393, 160, 173);
//D2Bot.printToConsole(text);
print(text);

if (text) {
    gameList = [];

    for (i = 0; i < text.length; i += 1) {
        gameList.push({
            gameName: text[i][0],   // This puts Game name in
            players: text[i][1],          // This gets Total Players in the game
                                                                     // NEED TO ADD GAMESERVER HERE (gs)
                                                                     // NEED TO ADD GAME DIFFICULTY HERE (norm, nm, hell)
        });

    }

    //JSON.parse(JSON.stringify(gameList));
    //print(JSON.stringify(gameList));
    //D2Bot.printToConsole(JSON.stringify(gameList));

    return gameList;

}

return false;

} Any help would be greatly appreciated!