berkof Posted April 28, 2016 Share Posted April 28, 2016 Добрый день. Подскажите каким образом можно получить список участников в текущем бое? @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted April 28, 2016 Share Posted April 28, 2016 Ники чтоль? @ Quote Link to comment Short link Share on other sites More sharing options...
berkof Posted April 28, 2016 Author Share Posted April 28, 2016 (edited) Верно, просто ники, без id. Это ведь можно собрать без подключения к серверам? Edited April 28, 2016 by berkof @ Quote Link to comment Short link Share on other sites More sharing options...
VasyaPRO_2014 Posted April 28, 2016 Share 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 Link to comment Short link Share on other sites More sharing options...
berkof Posted April 28, 2016 Author Share Posted April 28, 2016 Спасибо за помощь! @ Quote Link to comment Short link Share on other sites More sharing options...
berkof Posted May 1, 2016 Author Share 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 Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted May 1, 2016 Share 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 Link to comment Short link Share on other sites More sharing options...
berkof Posted May 1, 2016 Author Share 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 Link to comment Short link Share on other sites More sharing options...
tormozniak Posted May 20, 2016 Share Posted May 20, 2016 (edited) [удалил] Edited May 22, 2016 by tormozniak @ Quote Link to comment Short link Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.