def send_get_info(self): b = IPCMessageBuilder() p = b.player(0) p.MoveToLocation([0, 0]) p.act[0] = 31 m = b.build() return self.send_action(m)
def use_ability(ds, rs, state): b = IPCMessageBuilder() p = b.player(3) s = get_player(0, ds, rs) p.UseAbilityOnEntity(SpellSlot.Q, s['handle']) return b.build()
def send_action(ds, rs, state): b = IPCMessageBuilder() p = b.player(pid) getattr(p, function)(pos) s = get_player(pid, ds, rs) state['d'] = get_distance(s, pos) return b.build()
def go_secret(ds, rs, state): b = IPCMessageBuilder() p = b.player(pid) p.CourierSecret() pos = get_courier(pid, ds, rs)['location'] state['pos'] = (pos['x'], pos['y']) return b.build()
def send_action(ds, rs, state): unit, pos = get_friendly(pid, ds, rs) b = IPCMessageBuilder() p = b.player(pid) getattr(p, function)(unit) s = get_player(pid, ds, rs) state['d'] = get_distance(s, pos) state['p'] = pos return b.build()
def main(self, faction=None, action=None, hero=None, lane=0): if faction and action and hero: b = IPCMessageBuilder() draft = b.hero_selection(faction) if action == 'select': draft.select(hero, lane) else: draft.ban(hero) self.send_action(b.build()) page = self.env.get_template('draft.html') return page.render(code='Drafting', state=self.state)
def send_vloc_action(player, x, y, all=False, **kwargs): b = IPCMessageBuilder() players = [player] if all: if player < 4: players = self.TEAM_RAD else: players = self.TEAM_DIRE for player in players: p = b.player(player) getattr(p, name)([x, y]) m = b.build() return self.send_action(m)
def drop_item(ds, rs, state): b = IPCMessageBuilder() p = b.player(pid) p.DropItem(0, (-6700.0, -6700.0)) s = get_player(pid, ds, rs) items = s.get('items') tango = None for item in items: if item['slot'] == 0: tango = item break state['item'] = tango['handle'] return b.build()
def swap_item(ds, rs, state): b = IPCMessageBuilder() p = b.player(pid) p.SwapItems(0, 6) return b.build()
def sell_item(ds, rs, state): b = IPCMessageBuilder() p = b.player(pid) p.SellItem(0) return b.build()
def use_item(ds, rs, state): b = IPCMessageBuilder() p = b.player(pid) p.UseAbilityOnTree(0, 10) return b.build()
def ability_on_tree(self, player, slot=0, slot2=0, **kwargs): b = IPCMessageBuilder() p = b.player(player) p.UseAbilityOnTree(slot, slot2) m = b.build() return self.send_action(m)
def learn_ability(ds, rs, state): b = IPCMessageBuilder() # 3 is bloodseeker p = b.player(3) p.LevelAbility(SpellSlot.Q) return b.build()
def use_ability(ds, rs, state): b = IPCMessageBuilder() p = b.player(pid) p.UseAbilityOnLocation(SpellSlot.W, pos) return b.build()
def sell_item(self, player, slot=0, **kwargs): b = IPCMessageBuilder() p = b.player(player) p.SellItem(slot) m = b.build() return self.send_action(m)
def purchase_item(self, player, item, **kwargs): b = IPCMessageBuilder() p = b.player(player) p.PurchaseItem(item) m = b.build() return self.send_action(m)
def swap_item(self, player, slot=0, slot2=0, **kwargs): b = IPCMessageBuilder() p = b.player(player) p.SwapItems(slot, slot2) m = b.build() return self.send_action(m)
def location_ability(self, player, slot=0, x=0, y=0, **kwargs): b = IPCMessageBuilder() p = b.player(player) p.UseAbilityOnLocation(hAbility=slot, vLoc=[x, y]) m = b.build() return self.send_action(m)
def send_noarg_action(player, **kwargs): b = IPCMessageBuilder() p = b.player(player) getattr(p, name)() m = b.build() return self.send_action(m)
def drop_item(self, player, slot=0, x=0, y=0, **kwargs): b = IPCMessageBuilder() p = b.player(player) p.DropItem(slot, [x, y]) m = b.build() return self.send_action(m)
def drop_item(ds, rs, state): b = IPCMessageBuilder() p = b.player(pid) p.DropItem(0, (-6700.0, -6700.0)) return b.build()
def learn_ability(ds, rs, state): b = IPCMessageBuilder() p = b.player(pid) p.LevelAbility(SpellSlot.W) return b.build()
def purchase_item(ds, rs, state): b = IPCMessageBuilder() p = b.player(pid) p.PurchaseItem('item_tango') return b.build()
def send_item_action(player, slot=0, **kwargs): b = IPCMessageBuilder() p = b.player(player) getattr(p, name)(slot) m = b.build() return self.send_action(m)
def pick_item(ds, rs, state): b = IPCMessageBuilder() p = b.player(pid) p.PickUpItem(state['item']) return b.build()
def use_ability(ds, rs, state): b = IPCMessageBuilder() p = b.player(pid) p.UseAbility(SpellSlot.E) return b.build()
def fun(*args, **kwargs): b = IPCMessageBuilder() d = b.hero_selection(fac) d.select(hero, 0) return b.build()
def stop(ds, rs, state): b = IPCMessageBuilder() p = b.player(pid) p.Stop() return b.build()