Guest User

Untitled

a guest
Jun 25th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. from battle import commander
  2. unit_client = commander.Client()
  3. my_info = unit_client.ask_my_info()
  4.  
  5.  
  6. def search_target(data=None, **kwargs):
  7. towers = unit_client.ask_towers()
  8. print("List of towers:{}".format(towers))
  9. if towers:
  10. tower_id = towers[0]["id"]
  11. unit_client.do_attack(tower_id)
  12. print("Unit {}".format(my_info['id']))
  13. print("attak ID:{}".format(tower_id))
  14. unit_client.when_item_destroyed(tower_id, search_target)
  15. else:
  16. attack_center()
  17.  
  18. def attack_center(*args, **kawargs):
  19. center = unit_client.ask_center()
  20. unit_client.do_attack(center['id'])
  21. attack_center()
  22.  
  23.  
  24. search_target()
Add Comment
Please, Sign In to add comment