-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
287 lines (267 loc) · 12.3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<style>
.col-md-12 { margin-bottom: 20px; }
#command {
white-space: pre;
word-wrap: break-word;
}
.fa.overlay {
background-color: rgba(0,0,0,0.5);
border-radius: 25%;
color: red;
margin-left: -26px;
margin-top: 44px;
position: absolute;
}
.hero { height: 71px; width: 127px; }
.hero.taken {
-webkit-filter: grayscale(1);
}
.members { }
.slot {
background: #666;
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' version='1.1' height='71px' width='127px'><text text-anchor='middle' x='63' y='40' fill='lightgray' font-size='18'>Empty</text></svg>");
background-repeat: no-repeat;
box-shadow: inset 0 0 10px #222;
display: inline-block;
height: 71px;
margin: 0;
width: 127px;
}
.slot img { vertical-align: initial; }
.slot.selected {
border: solid 3px #0f0;
box-shadow: inset 0 0 10px #0f0;
box-sizing: content-box;
margin: -3px;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script type="text/javascript">
var heroes = {
'Abaddon': { broken: true, id: 'abaddon' },
'Alchemist': { broken: true, id: 'alchemist' },
'Ancient Apparition': { broken: true, id: 'ancient_apparition' },
'Anti-Mage': { broken: true, id: 'antimage' },
'Arc Warden': { broken: true, id: 'arc_warden' },
'Axe': { id: 'axe' },
'Bane': { id: 'bane' },
'Batrider': { broken: true, id: 'batrider' },
'Beastmaster': { broken: true, id: 'beastmaster' },
'Bloodseeker': { id: 'bloodseeker' },
'Bounty Hunter': { id: 'bounty_hunter' },
'Brewmaster': { broken: true, id: 'brewmaster' },
'Bristleback': { id: 'bristleback' },
'Broodmother': { broken: true, id: 'broodmother' },
'Centaur Warrunner': { broken: true, id: 'centaur' },
'Chaos Knight': { id: 'chaos_knight' },
'Chen': { broken: true, id: 'chen' },
'Clinkz': { broken: true, id: 'clinkz' },
'Clockwerk': { broken: true, id: 'rattletrap' },
'Crystal Maiden': { id: 'crystal_maiden' },
'Dark Seer': { broken: true, id: 'dark_seer' },
'Dark Willow': { broken: true, id: 'dark_willow' },
'Dazzle': { id: 'dazzle' },
'Death Prophet': { id: 'death_prophet' },
'Disruptor': { broken: true, id: 'disruptor' },
'Doom': { broken: true, id: 'doom_bringer' },
'Dragon Knight': { id: 'dragon_knight' },
'Drow Ranger': { id: 'drow_ranger' },
'Earth Spirit': { broken: true, id: 'earth_spirit' },
'Earthshaker': { id: 'earthshaker' },
'Elder Titan': { broken: true, id: 'elder_titan' },
'Ember Spirit': { broken: true, id: 'ember_spirit' },
'Enchantress': { broken: true, id: 'enchantress' },
'Enigma': { broken: true, id: 'enigma' },
'Faceless Void': { broken: true, id: 'faceless_void' },
'Gyrocopter': { broken: true, id: 'gyrocopter' },
'Huskar': { broken: true, id: 'huskar' },
'Invoker': { broken: true, id: 'invoker' },
'Io': { broken: true, id: 'wisp' },
'Jakiro': { id: 'jakiro' },
'Juggernaut': { id: 'juggernaut' },
'Keeper of the Light': { broken: true, id: 'keeper_of_the_light' },
'Kunkka': { id: 'kunkka' },
'Legion Commander': { broken: true, id: 'legion_commander' },
'Leshrac': { broken: true, id: 'leshrac' },
'Lich': { id: 'lich' },
'Lifestealer': { broken: true, id: 'life_stealer' },
'Lina': { id: 'lina' },
'Lion': { id: 'lion' },
'Lone Druid': { broken: true, id: 'lone_druid' },
'Luna': { id: 'luna' },
'Lycan': { broken: true, id: 'lycan' },
'Magnus': {broken: true, id: 'magnataur' },
'Medusa': { broken: true, id: 'medusa' },
'Meepo': { broken: true, id: 'meepo' },
'Mirana': { broken: true, id: 'mirana' },
'Monkey King': { broken: true, id: 'monkey_king' },
'Morphling': { broken: true, id: 'morphling' },
'Naga Siren': { broken: true, id: 'naga_siren' },
"Nature's Prophet": { broken: true, id: 'furion' },
'Necrophos': { id: 'necrolyte' },
'Night Stalker': { broken: true, id: 'night_stalker' },
'Nyx Assassin': { broken: true, id: 'nyx_assassin' },
'Ogre Magi': { broken: true, id: 'ogre_magi' },
'Omniknight': { id: 'omniknight' },
'Oracle': { id: 'oracle' },
'Outworld Devourer': { broken: true, id: 'obsidian_destroyer' },
'Pangolier': { broken: true, id: 'pangolier' },
'Phantom Assassin': { id: 'phantom_assassin' },
'Phantom Lancer': { broken: true, id: 'phantom_lancer' },
'Phoenix': { broken: true, id: 'phoenix' },
'Puck': { broken: true, id: 'puck' },
'Pudge': { id: 'pudge' },
'Pugna': { broken: true, id: 'pugna' },
'Queen of Pain': { broken: true, id: 'queenofpain' },
'Razor': { id: 'razor' },
'Riki': { id: 'riki' },
'Rubick': { broken: true, id: 'rubick' },
'Sand King': { id: 'sand_king' },
'Shadow Demon': { broken: true, id: 'shadow_demon' },
'Shadow Fiend': { id: 'nevermore' },
'Shadow Shaman': { broken: true, id: 'shadow_shaman' },
'Silencer': { broken: true, id: 'silencer' },
'Skywrath Mage': { id: 'skywrath_mage' },
'Slardar': { broken: true, id: 'slardar' },
'Slark': { broken: true, id: 'slark' },
'Sniper': { id: 'sniper' },
'Spectre': { broken: true, id: 'spectre' },
'Spirit Breaker': { broken: true, id: 'spirit_breaker' },
'Storm Spirit': { broken: true, id: 'storm_spirit' },
'Sven': { id: 'sven' },
'Techies': { broken: true, id: 'techies' },
'Templar Assassin': { broken: true, id: 'templar_assassin' },
'Terrorblade': { broken: true, id: 'terrorblade' },
'Tidehunter': { id: 'tidehunter' },
'Timbersaw': { broken: true, id: 'shredder' },
'Tinker': { broken: true, id: 'tinker' },
'Tiny': { id: 'tiny' },
'Treant Protector': { broken: true, id: 'treant' },
'Troll Warlord': { broken: true, id: 'troll_warlord' },
'Tusk': { broken: true, id: 'tusk' },
'Underlord': { broken: true, id: 'abyssal_underlord' },
'Undying': { broken: true, id: 'undying' },
'Ursa': { broken: true, id: 'ursa' },
'Vengeful Spirit': { id: 'vengefulspirit' },
'Venomancer': { broken: true, id: 'venomancer' },
'Viper': { id: 'viper' },
'Visage': { broken: true, id: 'visage' },
'Warlock': { id: 'warlock' },
'Weaver': { broken: true, id: 'weaver' },
'Windranger': { id: 'windrunner' },
'Winter Wyvern': { broken: true, id: 'winter_wyvern' },
'Witch Doctor': { id: 'witch_doctor' },
'Wraith King': { id: 'skeleton_king' },
'Zeus': { id: 'zuus' }
};
var imagePrefix = 'http://cdn.dota2.com/apps/dota2/images/heroes/';
var imageSuffix = '_hphover.png';
var npcPrefix = 'npc_dota_hero_';
jQuery.fn.outerHTML = function (s) {
return s
? this.before(s).remove()
: jQuery("<p>").append(this.eq(0).clone()).html();
};
$(document).ready(function () {
$(document)
.on('click', '#heros .hero', onHeroClick)
.on('click', '.slot', onSlotClick);
var html = '';
$.each(heroes, function (key, value) {
var item = '<img class="hero" data-hero="' + value.id + '" src="' + imagePrefix + value.id + imageSuffix + '">';
if (value.broken)
item += '<i class="fa fa-2x fa-bug overlay"></i>';
html += item;
});
$('#heros').html(html);
var $command = $('#command');
var $slots = $('.slot');
function onHeroClick() {
var $this = $(this);
var img = $this.outerHTML();
var $slot = $('.slot.selected');
if ($slot.length == 0)
return;
if ($this.hasClass('taken'))
return;
$this.addClass('taken');
if ($slot.find('img').length === 1) {
var existingHero = $slot.find('img').data('hero');
$('#heros').find('.hero[data-hero="' + existingHero + '"]').removeClass('taken');
}
$slot.html(img).removeClass('selected');
var slotIndex = $slots.index($slot);
if (slotIndex < $slots.length) {
var $nextSlot = $slots.slice(slotIndex + 1, slotIndex + 2);
$nextSlot.addClass('selected');
}
updateCommand();
}
function onSlotClick() {
var $this = $(this);
$('.slot.selected').removeClass('selected');
var hero = $this.find('img').data('hero');
$('.taken[data-hero=' + hero + ']').removeClass('taken');
$this.html('').addClass('selected');
updateCommand();
}
function updateCommand() {
$command.text('');
var heros = new Array();
var $selectedHeros = $('.slot img');
$.each($selectedHeros, function (index, element) {
var hero = $(this).data('hero');
if (hero != null)
heros.push(npcPrefix + hero);
});
$command.text('dota_bot_force_pick ' + heros.join());
}
});
</script>
</head>
<body>
<div class="container">
<h1>Dota 2 - Captains Mode for Bots</h1>
<ol>
<li>Choose your teams by clicking on heros and slots.</li>
<li>Copy the console command</li>
<li>Open the Dota 2 console (There is an option in-game to enable the console and a hotkey to setup)</li>
<li>Paste in the console command and press enter</li>
<li>Start a bot game in All Pick mode and the bots will choose the heros you chose</li>
</ol>
<div class="col-md-12">
<h1>Console Command</h1>
<span id="command"></span>
</div>
<div id="radiant" class="col-md-6">
<h1>Radiant</h1>
<div class="col-md-12 members">
<div class="slot"></div>
<div class="slot selected"></div>
<div class="slot"></div>
<div class="slot"></div>
<div class="slot"></div>
</div>
</div>
<div id="dire" class="col-md-6">
<h1>Dire</h1>
<div class="col-md-12 members">
<div class="slot"></div>
<div class="slot"></div>
<div class="slot"></div>
<div class="slot"></div>
<div class="slot"></div>
</div>
</div>
<div class="col-md-12" id="heros"></div>
</div>
</body>
</html>