Jump to content
Korean Random

Seki

User
  • Content Count

    9
  • Joined

  • Last visited

Community Reputation

0 Noob

Recent Profile Visitors

754 profile views
  1. I wrote this code for testing some stuff: #! /usr/bin/env Python # -*- coding: utf-8 -*- ############################# # Addons for XVM carousel by Ikes ############################# ############################# # Imports # Imports - WoT import BigWorld from helpers import dependency from skeletons.gui.shared import IItemsCache from gui.Scaleform.daapi.view.lobby.hangar.Hangar import Hangar from gui.shared.utils.requesters import REQ_CRITERIA # Imports - XVM from xfw import * from xvm_main.python.logger import * # Imports - Other import simplejson import traceback ############################# # Private class VehiclesList: def __init__(self): self.playerName = self.__getPlayerName() log('[TEST] {}'.format(self.playerName) def __getPlayerName(self): return BigWorld.player().name ### def __player_vehicles_list(): itemsCache = dependency.instance(IItemsCache) vehiclesList = dict(itemsCache.items.getVehicles(REQ_CRITERIA.INVENTORY)) log('[ADDONS] Vehicles list: {}'.format(vehiclesList.values())) return ############################# # Events # @registerEvent(Hangar, '_Hangar__updateParams') def Hangar__updateParams(self): __player_vehicles_list() log('[ADDONS] Hangar updated' ) vehiclesList2 = VehiclesList() But i have an error in xvm log, and i don't understand why. When i wrote class VehiclesList under Python shell, i have no error and code work fine. Why? 2017-08-18 23:55:34: [ERROR] Traceback (most recent call last): File "./res_mods/mods/packages\xvm_main\python\python_macro.py", line 127, in load_macros_lib code = load(file_name) File "./res_mods/mods/packages\xvm_main\python\python_macro.py", line 101, in load return parse(source, file_name) File "./res_mods/mods/packages\xvm_main\python\python_macro.py", line 91, in parse node = ast.parse(source) File "scripts/common/Lib/ast.py", line 37, in parse File "<unknown>", line 35 def __getPlayerName(self): ^ SyntaxError: invalid syntax
  2. Good idea! Where can i find Python script for {{mystat. ...}}, those macros doesn't work for me.
  3. I found how to get name or ID for tanks in the carousel, with this code: import BigWorld from Avatar import PlayerAvatar from helpers import dependency from skeletons.gui.shared import IItemsCache from gui.Scaleform.daapi.view.lobby.hangar.Hangar import Hangar from xvm_main.python.logger import * from debug_utils import LOG_ERROR from gui.Scaleform.daapi.view.lobby.vehicle_carousel.carousel_data_provider import CarouselDataProvider from gui.shared.utils.requesters import REQ_CRITERIA @registerEvent(Hangar, '_Hangar__updateParams') def Hangar__updateParams(self): itemsCache = dependency.instance(IItemsCache) inventory_vehicles_dict = dict(itemsCache.items.getVehicles(REQ_CRITERIA.INVENTORY)) for vehicle in inventory_vehicles_dict.values(): LOG_ERROR('vehicle name: %s' % vehicle.name) LOG_ERROR('vehicle intCD: %s' % vehicle.intCD) Now, how can i get a list of properties for vehicle (like vehicle.name, vehicle.intCD,...)? I tried to use night_dragon_on method https://koreanrandom.com/forum/topic/31856-динамические-макросы-в-python/?p=398696 but this doesn't work. Edit: found this.
  4. Thanks, that's what i need! Now, will trying to get stats by tank name or Id.
  5. Yes, it helped me and i tested it this afertoon, but it's seem that's player stats, not tanks stats. Edit: I would like to retrieve this stats.
  6. Hi, I'm trying to develop some macros in Python, for hangar and carousel, and i have a question. I read all this topic, very interesting indeed, without finding a solution. I search also in game code source, available on this forum, but this doesn't helped me a lot. How is it possible to access tank stats and data (xp, frags, damages,..) in Python, like in personal tab? Thanks.
  7. Hi, Does macro {{v.vehId}} still working in carrousel? I'm using the latest XVM version, and this macro return nothing when i use it in carrousel. Thx.
×
×
  • Create New...