PittKamikaze Posted September 19, 2014 Share Posted September 19, 2014 Я пока плохо разбираюсь в api BW, ну и в самом питоне не до конца. И решил написать простенький модик который пишет в чат сообщение после начала боя. ProstoNoob, подсказал мне BigWorld.player().arena.onAvatarReady += функция Я сделал так, from PlayerEvents import g_playerEvents g_playerEvents.onAvatarReady += моя_функция Все хорошо загружается после начала но с чатом я не могу работать. *** [ERROR] (scripts/client/ClientChat.py, 412): Can`t execute chat channel command for channelId: 0 @ Quote Link to comment Short link Share on other sites More sharing options...
ProstoNoob Posted September 20, 2014 Share Posted September 20, 2014 People, я не ковырялся с вызовом сразу после входа. Can`t execute chat channel command for channelId: 0 Там по умолчанию 0 выставляется, тебе нужно получить chanelID. @ Quote Link to comment Short link Share on other sites More sharing options...
PittKamikaze Posted September 21, 2014 Author Share Posted September 21, 2014 (edited) Помогите сделать мод который будет отправлять сообщение при старте боя. Исходный код который не работает: import BigWorld import constants from ChatManager import chatManager from gui.WindowsManager import g_windowsManager def mess(): if BigWorld.player().arena.guiType == constants.ARENA_GUI_TYPE.RANDOM: BigWorld.player().broadcast(chatManager.battleCommonChannelID, 'Hello, World!') g_windowsManager.onInitBattleGUI += mess Edited November 1, 2014 by PittKamikaze @ Quote Link to comment Short link Share on other sites More sharing options...
PittKamikaze Posted September 22, 2014 Author Share Posted September 22, 2014 Разобрался. Закрыто. @ 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.