berkof 0 Posted April 28, 2016 Добрый день. Подскажите каким образом можно получить список участников в текущем бое? Quote Share this post Link to post Short link Share on other sites
Ekspoint 2,122 #325313 Posted April 28, 2016 Ники чтоль? Quote Share this post Link to post Short link Share on other sites
berkof 0 #325318 Posted April 28, 2016 (edited) Верно, просто ники, без id. Это ведь можно собрать без подключения к серверам? Edited April 28, 2016 by berkof Quote Share this post Link to post Short link Share on other sites
VasyaPRO_2014 163 #325323 Posted April 28, 2016 (edited) как-то так import BigWorld for pl in BigWorld.player().arena.vehicles.values(): print pl['name'] Возможно есть способ получше:) p.s. так вроде только те, кто в засвете. А нет, здесь все. Edited April 28, 2016 by VasyaPRO_2014 1 Quote Share this post Link to post Short link Share on other sites
berkof 0 #325349 Posted April 28, 2016 Спасибо за помощь! Quote Share this post Link to post Short link Share on other sites
berkof 0 #325711 Posted May 1, 2016 (edited) Нужен еще совет) В орионе ввожу скрипт: import BigWorld f = open('c:\list_gamers.txt', 'a') for pl in BigWorld.player().arena.vehicles.values(): print pl['name'] f.write(pl['name']) f.write(',') f.close() Результат выводится в консоль и в файл успешно. Компилирую скрипт в mod_list_gamers.pyc, сохраняю в папку с игрой "\World_of_Tanks\res_mods\0.9.14.1\scripts\client\gui\mods" При запуске игры пишет ошибку: EXCEPTION(scripts/client/game.py, 184):*** Traceback (most recent call last):*** File "scripts/client/game.py", line 155, in init*** File "scripts/client/gui/shared/personality.py", line 329, in init*** File "scripts/client/gui/mods/__init__.py", line 17, in init*** File "scripts/client/gui/mods/__init__.py", line 64, in _findValidMODs*** File "scripts/common/Lib/importlib/__init__.py", line 37, in import_module*** File "list_gamers", line 4, in <module>*** AttributeError: 'NoneType' object has no attribute 'arena' Может надо куда то в другое место сохранять? Edited May 1, 2016 by berkof Quote Share this post Link to post Short link Share on other sites
Ekspoint 2,122 #325712 Posted May 1, 2016 ты вот прям вот так просто сделал и все? import BigWorld from gui.Scaleform.Battle import Battle def BF_new_afterCreate(self): BF_orig_afterCreate(self) f = open('c:\list_gamers.txt', 'a') for pl in BigWorld.player().arena.vehicles.values(): print pl['name'] f.write(pl['name']) f.write(',') f.close() BF_orig_afterCreate = Battle.afterCreate Battle.afterCreate = BF_new_afterCreate 1 Quote Share this post Link to post Short link Share on other sites
berkof 0 #325723 Posted May 1, 2016 ты вот прям вот так просто сделал и все? import BigWorld from gui.Scaleform.Battle import Battle def BF_new_afterCreate(self): BF_orig_afterCreate(self) f = open('c:\list_gamers.txt', 'a') for pl in BigWorld.player().arena.vehicles.values(): print pl['name'] f.write(pl['name']) f.write(',') f.close() BF_orig_afterCreate = Battle.afterCreate Battle.afterCreate = BF_new_afterCreate Только вникаю в это) Спасибо огромное, вариант рабочий. Quote Share this post Link to post Short link Share on other sites
tormozniak 27 #327971 Posted May 20, 2016 (edited) [удалил] Edited May 22, 2016 by tormozniak Quote Share this post Link to post Short link Share on other sites