arzon4dt / bot-experiment

My Dota 2 Bot Script
114 stars 51 forks source link

How to pick hero when i was a ob or coach #16

Open nathanielYZL opened 4 years ago

nathanielYZL commented 4 years ago

i want to see 10 bots fight in a game as an oberver or coach ,but it could not implement,so when i try to modify your code in hero_selection.lua-Think() like

function Think()
    SelectHero(2, "npc_dota_hero_lina");
    if GetGameMode() == GAMEMODE_AP then
        if GetGameState() == GAME_STATE_HERO_SELECTION then
            InstallChatCallback(function (attr) SelectHeroChatCallback(attr.player_id, attr.string, attr.team_only); end);
        end
...

also there is only me in the room and i am an observer or coach it did not work when i modify other script in this func it works there is only your script is really good for fights could you help me to do this thx

nathanielYZL commented 4 years ago

it worked when i modify the function Think() but when i am a coach or obersver it seems SelectHeroChatCallback can't catch the chat message, so i can not choose hero using chat box :(