Jump to content
Korean Random
berkof

Список участников боя

Recommended Posts

Добрый день. Подскажите каким образом можно получить список участников в текущем бое?

Share this post


Link to post

Short link
Share on other sites

Верно, просто ники, без id. Это ведь можно собрать без подключения к серверам?

Edited by berkof

Share this post


Link to post

Short link
Share on other sites

как-то так

import BigWorld

for pl in BigWorld.player().arena.vehicles.values():
    print pl['name']

Возможно есть способ получше:)

 

p.s. так вроде только те, кто в засвете.

​А нет, здесь все.

Edited by VasyaPRO_2014
  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

Нужен еще совет)

 

В орионе ввожу скрипт:

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 by berkof

Share this post


Link to post

Short link
Share on other sites

ты вот прям вот так просто сделал и все?


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

  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

 

ты вот прям вот так просто сделал и все?

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

Только вникаю в это) Спасибо огромное, вариант рабочий.

Share this post


Link to post

Short link
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...