Latzy 0 Posted April 19, 2020 Hey guys, I'm relatively new to modding WoT and currently I'm trying to make a mod which blacklists player. Therefore a function is obviously necessary. I think I've found it here: \scripts\client\messenger\proto\xmpp\contacts\__init__.py in the class ContactsManager. My attempt to use this function is here: def teambl_key(): CM = ContactsManager() databID = getAvatarDatabaseID() names_ = avatar_getter.getPlayerName() CM.addIgnored(databID, names_) The function addIgnored has 3 arguments: self, dbID and name. I used all arguments, didn't I? If I try to execute this, it doesn't work and I can find this in the logfile: 2020-04-19 22:38:52.718: ERROR: File "mod_test", line 23, in teambl_key 2020-04-19 22:38:52.718: ERROR: File "scripts/client/messenger/proto/xmpp/decorators.py", line 80, in wrapper 2020-04-19 22:38:52.718: ERROR: TypeError: addIgnored() takes exactly 4 arguments (3 given) This function also has a decorator, but I can't discover any 4th argument. Am I missing something or is this probably the wrong function? I'd appreciate any help and thanks in advance. Regards unfortunately_lazy Quote Share this post Link to post Short link Share on other sites
Ekspoint 2,122 #480950 Posted April 19, 2020 @proto_getter(PROTO_TYPE.MIGRATION) def proto(): return None proto.contacts.addIgnored(databaseID, userName) Quote Share this post Link to post Short link Share on other sites
Latzy 0 #480952 Posted April 19, 2020 Wow, thanks for the quick answer! Unfortunately this doesn't work for me Do I have to replace something? Now the logfile says: 2020-04-19 23:43:39.058: ERROR: AttributeError: 'NoneType' object has no attribute 'addIgnored' These are the modules I imported: from messenger.m_constants import PROTO_TYPE from messenger.proto.__init__ import proto_getter Is this correct? Quote Share this post Link to post Short link Share on other sites
Ekspoint 2,122 #480953 Posted April 19, 2020 3 минуты назад, unfortunately_lazy сказал: Wow, thanks for the quick answer! Unfortunately this doesn't work for me Do I have to replace something? Now the logfile says: 2020-04-19 23:43:39.058: ERROR: AttributeError: 'NoneType' object has no attribute 'addIgnored' These are the modules I imported: from messenger.m_constants import PROTO_TYPE from messenger.proto.__init__ import proto_getter Is this correct? from messenger.proto import proto_getter Quote Share this post Link to post Short link Share on other sites
Latzy 0 #480954 Posted April 19, 2020 (edited) Big thanks! The funtion itself is working as intended. Furthermore I want to get all the data of the players in each battle. I've used these functions: from gui.battle_control.avatar_getter import getPlayerName from avatar_helpers import getAvatarDatabaseID Unfortunately I don't know the data type of these. Most likely they're lists, aren't they? Edit: Hmmm, getAvatarDatabaseID() returns only a number, not a list, maybe the dbID from the actual player I'm trying to get the solution on my own, if I fail, I'll ask again Edited April 22, 2020 by unfortunately_lazy Quote Share this post Link to post Short link Share on other sites
Latzy 0 #481010 Posted April 20, 2020 (edited) Hey, I got all the data I need from the team Regards unfortunately_lazy Edited April 30, 2020 by unfortunately_lazy Quote Share this post Link to post Short link Share on other sites