Dota 2
BOT EXPERIMENT Credit:FURIOUSPUPPY
Dr. Zed Mar 3, 2017 @ 5:16am
hero_selection patch
Hey there. Thanks for the script. I was messing around with your "hero_selection.lua". I added a way to check if human players have done picking else pick at 30 sec to go. I thought you might be interested in adding the code back into your script:

local picks = {}; -- TODO -- 1. determine which slots contain players - don't pick for those slots -- 2. determine what heroes have already been picked - don't pick those heroes - DONE -- 4. copy the default behavior of picking everything at once after players have picked - DONE -- 5. add some jitter, so the bots pick at slightly more random times -- 6. reimplement farm priority based system function Think() -- only pick if humans have picked or time gets to 30 sec if GameTime() < 52 and not IsHumansDonePicking() then return; end -- pick for radiant for _,i in pairs(GetTeamPlayers(TEAM_RADIANT)) do if IsPlayerInHeroSelectionControl(i) then if IsPlayerBot(i) then hero = GetRandomHero() SelectHero(i, hero); end end end -- pick for dire for _,i in pairs(GetTeamPlayers(TEAM_DIRE)) do if IsPlayerInHeroSelectionControl(i) then if IsPlayerBot(i) then hero = GetRandomHero() SelectHero(i, hero); end end end end function IsHumansDonePicking() -- check radiant for _,i in pairs(GetTeamPlayers(TEAM_RADIANT)) do if GetSelectedHeroName(i) == "" and not IsPlayerBot(i) then return false; end end -- check dire for _,i in pairs(GetTeamPlayers(TEAM_DIRE)) do if GetSelectedHeroName(i) == "" and not IsPlayerBot(i) then return false; end end -- else humans have picked return true; end
and
function GetPicks() local selectedHeroes = {}; for _,i in pairs(GetTeamPlayers(TEAM_RADIANT)) do local hName = GetSelectedHeroName(i); if (hName ~= nil and hName ~= "") then selectedHeroes = hName;
end
end
for _,i in pairs(GetTeamPlayers(TEAM_DIRE)) do
local hName = GetSelectedHeroName(i);
if (hName ~= nil and hName ~= "") then
selectedHeroes = hName;
end
end
return selectedHeroes;
end
Last edited by Dr. Zed; Mar 3, 2017 @ 5:18am
< >
Showing 1-1 of 1 comments
Меня завут Зона!  [developer] Mar 3, 2017 @ 5:43am 
Sure, I'll looking forward to this.
< >
Showing 1-1 of 1 comments
Per page: 1530 50