Jump to content
Korean Random

Okxa

User
  • Content Count

    30
  • Joined

  • Last visited

Posts posted by Okxa


  1. Zoom multiplier can be disabled via config - camera->sniper->zoomIndicator->enabled

    Yeah that's correct and freecam toggless sights pretty well.

     

    However if I want do disable all sights in fixed cam I'll have to possibly mod the sight .swf or something...

     

    But I still have some things that need to be disabled;

     

    1. The messages when modeule or crew takes damage.

        vehicleErrorsPanel and vehicleMessagesPanel used to be the keys, but not anymore...

    2. Killfeed -used to be playerMessangersPanel

     

    thanks for night_dragon_on:

    https://koreanrandom.com/forum/topic/31856-динамические-макросы-в-python/?p=400626


  2. and you must to insert section with your custom macros in @xvm.xc

     

    How do I insert them there?

    I can't get it to work with the following:

     

    EDIT: NVM it works

     

    @xvm.xc:

        // The minimum required version of the XVM mod.
        "modMinVersion": "6.4.1.1"
      },
        "vnation": {
            "germany": "GER",
            "uk": "GBR",
            "usa": "USA",
            "ussr": "USSR",
            "japan": "JPN",
            "france": "FRA",
            "czech": "CSHH",
            "china": "CHN"
        },
      // Parameters for login screen.
      "login": ${"login.xc":"login"},
    

  3. So I cant get it to work... I even updated to the latest xvm (XVM-6.4.7.1)

    Code, alpha is always 100 for testing purposes:

    // XP to Elite
    { "x": 2, "y": 79, "layer": "top", "alpha": "{{v.elite?100|100}}", "width": "{{py:math.mul({{py:math.div({{py:math.sub({{v.xpToElite}}, {{v.xpToEliteLeft}})}}, {{v.xpToElite}})}}, 126)}}", "height": 2, "bgColor": "#FF6600" },
    

    Here's what it still looks like:
    z0Ar37K.png
     
    I still get the same errors to my XVM.log, whats wrong?

    2016-10-27 13:36:42: [ERROR] Traceback (most recent call last):
      File "xvm_main/python_macro.py", line 156, in process_python_macro
      File "xvm_main/python_macro.py", line 144, in get_function
      File "scripts/common/Lib/ast.py", line 49, in literal_eval
      File "scripts/common/Lib/ast.py", line 37, in parse
      File "<unknown>", line 1
        (, )
         ^
    SyntaxError: invalid syntax
    arg='math.sub(, )'
    2016-10-27 13:36:42: [ERROR] Traceback (most recent call last):
      File "xvm_main/python_macro.py", line 156, in process_python_macro
      File "xvm_main/python_macro.py", line 144, in get_function
      File "scripts/common/Lib/ast.py", line 49, in literal_eval
      File "scripts/common/Lib/ast.py", line 37, in parse
      File "<unknown>", line 1
        (, )
         ^
    SyntaxError: invalid syntax
    arg='math.div(, )'
    2016-10-27 13:36:42: [ERROR] Traceback (most recent call last):
      File "xvm_main/python_macro.py", line 156, in process_python_macro
      File "xvm_main/python_macro.py", line 144, in get_function
      File "scripts/common/Lib/ast.py", line 49, in literal_eval
      File "scripts/common/Lib/ast.py", line 37, in parse
      File "<unknown>", line 1
        (, 126)
         ^
    SyntaxError: invalid syntax
    arg='math.mul(, 126)'
    2016-10-27 13:36:43: [ERROR] Traceback (most recent call last):
      File "xvm_main/python_macro.py", line 157, in process_python_macro
      File "xvm_main/python_macro.py", line 150, in <lambda>
    TypeError: math_sub() takes exactly 2 arguments (1 given)
    arg='math.sub(440, )'
    2016-10-27 13:36:43: [ERROR] Traceback (most recent call last):
      File "xvm_main/python_macro.py", line 156, in pr
    

     

    There are also my full XVM.log and my carousel config file attached, if that would help you.

    Or could you test it with my carousel file?

    XVM.log

    carouselNormal.xc


  4. What's wrong? I get the following in XVM log:

    2016-10-14 13:58:51: [ERROR] Traceback (most recent call last):
      File "xvm_main/python_macro.py", line 154, in process_python_macro
      File "xvm_main/python_macro.py", line 142, in get_function
      File "scripts/common/Lib/ast.py", line 49, in literal_eval
      File "scripts/common/Lib/ast.py", line 37, in parse
      File "<unknown>", line 1
        (,)
         ^
    SyntaxError: invalid syntax
    arg='math.sub(,)'
    2016-10-14 13:58:51: [ERROR] Traceback (most recent call last):
      File "xvm_main/python_macro.py", line 154, in process_python_macro
      File "xvm_main/python_macro.py", line 142, in get_function
      File "scripts/common/Lib/ast.py", line 80, in literal_eval
      File "scripts/common/Lib/ast.py", line 58, in _convert
      File "scripts/common/Lib/ast.py", line 79, in _convert
    ValueError: malformed string
    arg='math.div(null,)'
    2016-10-14 13:58:51: [ERROR] Traceback (most recent call last):
      File "xvm_main/python_macro.py", line 154, in process_python_macro
      File "xvm_main/python_macro.py", line 142, in get_function
      File "scripts/common/Lib/ast.py", line 80, in literal_eval
      File "scripts/common/Lib/ast.py", line 58, in _convert
      File "scripts/common/Lib/ast.py", line 79, in _convert
    ValueError: malformed string
    arg='math.mul(null,160)'
    2016-10-14 13:58:52: [ERROR] Traceback (most recent call last):
      File "xvm_main/python_macro.py", line 155, in process_python_macro
      File "xvm_main/python_macro.py", line 148, in <lambda>
    TypeError: math_sub() takes exactly 2 arguments (1 given)
    arg='math.sub(440,)'
    2016-10-14 13:58:52: [ERROR] Traceback (most recent call last):
      File "xvm_main/python_macro.py", line 154, in process_python_macro
      File "xvm_main/python_macro.py", line 142, in get_function
      File "scripts/common/Lib/ast.p
    

    Is it because?:

    TypeError: math_sub() takes exactly 2 arguments (1 given)
    
    Even though it should have 2 arguments.

     

    Or do I have files required? Is the math.py required in somewhere specific place or is the one in "res_mods\configs\xvm\py_macro" enough?

     

    EDIT:

    Or is the reason that it requires other than 0 (as elited tanks have 0 xp required)? By doing this the bars show up (incorrectly so I get still errors).

    "width": "{{v.xpToEliteLeft}}?{{py:math.mul({{py:math.div({{py:math.sub({{v.xpToElite}},{{v.xpToEliteLeft}})}},{{v.xpToElite}})}},160)}|0}",
    
    But I still get this in XVM.log:

    2016-10-14 14:21:01: [ERROR] Traceback (most recent call last):
      File "xvm_main/python_macro.py", line 154, in process_python_macro
      File "xvm_main/python_macro.py", line 142, in get_function
      File "scripts/common/Lib/ast.py", line 49, in literal_eval
      File "scripts/common/Lib/ast.py", line 37, in parse
      File "<unknown>", line 1
        (,)
         ^
    SyntaxError: invalid syntax
    arg='math.sub(,)'
    2016-10-14 14:21:01: [ERROR] Traceback (most recent call last):
      File "xvm_main/python_macro.py", line 154, in process_python_macro
      File "xvm_main/python_macro.py", line 142, in get_function
      File "scripts/common/Lib/ast.py", line 80, in literal_eval
      File "scripts/common/Lib/ast.py", line 58, in _convert
      File "scripts/common/Lib/ast.py", line 79, in _convert
    ValueError: malformed string
    arg='math.div(null,)'
    2016-10-14 14:21:01: [ERROR] Traceback (most recent call last):
      File "xvm_main/python_macro.py", line 155, in process_python_macro
      File "xvm_main/python_macro.py", line 148, in <lambda>
    TypeError: math_sub() takes exactly 2 arguments (1 given)
    arg='math.sub(440,)'
    2016-10-14 14:21:01: [ERROR] Traceback (most recent call last):
      File "xvm_main/python_macro.py", line 154, in process_python_macro
      File "xvm_main/python_macro.py", line 142, in get_function
      File "scripts/common/Lib/ast.py", line 80, in literal_eval
      File "scripts/common/Lib/ast.py", line 58, in _convert
      File "scripts/common/Lib/ast.py", line 79, in _convert
    ValueError: malformed string
    arg='math.div(null,440)'
    

  5. I am trying to show how much it takes to elite a tank as a progress bar. However, because it's not a percentage the bar is almost (when xpleft<width of the cell) always too long:

    0V2EIhq.png

    Is there a way to convert it to a ratio?

     

    My code:

    // XP to Elite
    
    // Progress Bar
    { "x": 4, "y": 78, "layer": "top", "alpha": "{{v.xpToEliteLeft?100|0}}", "width": "{{v.xpToEliteLeft}}", "height": 2, "bgColor": "{{v.c_damageRating}}" },
    //Text
    { "x": 0, "y": 28, "layer": "top", "alpha": "{{v.xpToEliteLeft?100|0}}", "alpha": "{{v.xpToEliteLeft?100|0}}", "format": "<font size='10' color='#D4D4D4'>XP to Elite:" },
    { "x": 1, "y": 40, "layer": "top", "alpha": "{{v.xpToEliteLeft?100|0}}", "format": "<font size='10' color='{{v.c_battles}}'><font face='Arial'>{{v.xpToEliteLeft}}</font>" },
    

    Also is there a way to colorize it by the amount of xp left? I tried to make a custom color macro but I couldn't get it to work.


  6. I cannot add any more lines in tooltips.xc sections.

    "lightTank":    [
                        "battleTiers",
                       
                        "TEXT:<font color='#DACFAD'><b>{{l10n:firepower}}</b></font>",
                        "piercingPowerAvgSummary",
                        "damageAvgSummary",
                        "shellSpeedSummary",
                        "gravity",
                        "explosionRadius",
                        "shotDispersionAngle",
                        "aimingTime",
                        "reloadTimeSecs",
                        "rateOfFire",
                        "damageAvgPerMinute",
                        "shootingRadius",
                        "turretRotationSpeed",
                        "traverseLimits",
                        "pitchLimits",
                       
                        "TEXT:<font color='#DACFAD'><b>Spotting & Camo</b></font>",
                        "circularVisionRadius",
                        "invisibilityStillFactor",
                        "invisibilityMovingFactor",
                       
                        "TEXT:<font color='#DACFAD'><b>Survivability</b></font>",
                        "maxHealth",
                        "turretArmor",
                        "hullArmor",
                       
                        "TEXT:<font color='#DACFAD'><b>{{l10n:mobility}}</b></font>",
                        "enginePower",
                        "enginePowerPerTon",
                        "speedLimits",
                        "terrainResistance",
                        "chassisRotationSpeed",
                       
                        "crewRolesIcons"
                        ]
    

    If I add any more keys, the tooltip refuses to show up and disables other tooltips (which had worked before trying to view the LT tooltip) as well.

     


  7. The string i use is:

    "vehicleFormatLeft": "<textformat leading='9' tabstops='[70,95,130]'>{{vehicle}}<tab><font face='mono'><font color='{{c:kb}}'>{{kb%2d~k|--k}}</font><tab><font color='{{c:wn8}}'>{{wn8%4d|----}}</font><tab><font color='{{c:winrate}}'>{{winrate%d~%|--%}}</font></font></textformat>",
    "vehicleFormatRight": "<textformat leading='9' 'tabstops='[-70,-95,-130]'><font face='mono'><font color='{{c:winrate}}'>{{winrate%d~%|--%}}</font><tab><font color='{{c:wn8}}'>{{wn8%4d|----}}</font><tab><font color='{{c:kb}}'>{{kb%2d~k|--k}}</font></font><tab>{{vehicle}}</textformat>",
    

    Which results in:

    pKtqhwC.jpg

     

    How ever when I increase "vehicleWidth", following happens (with "vehicleWidth": 200):

    nYR547K.jpg

     

    As you can see, the tabs wont align and the background shifts, any idea how to fix?


  8. So ATM I'm at this point:

    hsKzRzy.jpg

     

    The players panel swither needed to be disabled from PlayersPanel.xc, for some reason.

    The Received damage hitlod next to that tank panel can be disabled from its own settings, as it's a separate mod.

    Hitlog probably needs to be disabled from Hitlog.xc

     

    However whats the key for the panel with tank and it's modules? Also for the text that says who damaged your track etc...

     

    EDIT: If I use freecam the panel disappears, so it doesn't really matter for now for me, as I needed to use this with freecam.

    BUT I still need to disable the pop-up text (who tracked etc...) and the received hit direction arrow.

     

    EDIT2:

    So I got what was wrong. When I added the new entries from this thread, They had capital letters at start after I google translated the thread....

     

    Anyhow I got them disabled except for the received hit direction arrow, still looking...

    Or do I need to find a way to disable my crosshair? Are the received hit arrows tied to that??


  9. Made a working update.sh!

    This Works atleas for me on git for windows, i had to download wget because git for win doesnt have it.

     

    And works on EU, but havent tested for other regions

    Also be wary that this is really crudely done but it works for now

     

     

     

    #!/bin/sh
    
    [ "$host" = "" ] && exit
    
    # main
    main()
    {
      id=$startclan
      mkdir -p ../icons/$dir/
      echo "Started at `date +%T_%F`"
      while [ $id -le $lastclan ]; do
        update $id
        id=$((id+1))
      done
      optimize
      echo "Finished at `date +%T_%F`"
    }
    
    # update
    # $1 - clanId
    update()
    {
      echo -n "$1 - "
    
      errors=0
      while [ 1 ]; do
        clanraw=$(wget -qO- "http://$host/clans/$id" |
    		gawk -v IGNORECASE=1 -v RS='</title' 'RT{gsub(/.*<title[^>]*>/,"");print;exit}')
    		
    		IFS='['
    		clan=( $clanraw )
    		IFS=']'
    		clan2=( ${clan[1]} )
    
    #Clan removed or does not exist
        if [ "$clanraw" = " | World of Tanks and World of Warplanes Clans  " ]; then
          echo "REMOVED"
          return
    #Error handling - server maintenance
        elif [ "$clan2" = "" ]; then
          errors=$((errors+1))
          if [ $errors -lt 2 ]; then
            echo -n "EMPTY `date +%T_%F` $errors.. "
            sleep 10m
            continue
          elif [ $errors -lt 6 ]; then
            echo -n "$errors.. "
            sleep 10m
            continue
          else
            echo "ERROR"
            return
          fi
        fi
        break
      done
    
      echo -n "[$clan2] => $clan2.png"
    	mkdir -p $dir
    	wget -q -O $dir/$clan2.png "http://$host/clans/media/clans/emblems/cl_${id:(-3)}/$id/emblem_64x64.png"
      echo " OK"
    }
    
    optimize()
    {
      echo "Optimizing PNGs..."
      (
        cd ../icons/$dir
        pngoptimizer -file:*.png
      )
    }
    

     

    EDIT: also as of 2.3.2016 last clan created is ID:500072742 to end at this, simply edit update-eu.sh => lastclan:500072742

    • Upvote 1

  10. I found out that clanicon location for eu is now:

    http://eu.wargaming.net/clans/media/clans/emblems/cl_001/500000001/emblem_64x64.png
    
    So Should this work if host=eu.wargaming.net ? (modified scripts-allclans\.update.sh)

    #!/bin/sh
    
    [ "$host" = "" ] && exit
    
    # main
    main()
    {
      id=$startclan
      mkdir -p ../icons/$dir/
      echo "Started at `date +%T_%F`"
      while [ $id -le $lastclan ]; do
        update $id
        id=$((id+1))
      done
      optimize
      echo "Finished at `date +%T_%F`"
    }
    
    # update
    # $1 - clanId
    update()
    {
      echo -n "$1 - "
    
      errors=0
      while [ 1 ]; do
        clan=`wget -qc -t 5 -T 10s "http://$host/clans/$1/" -O - 2>/dev/null | \
              grep "<title>" | \
              cut -d[ -f2 | \
              cut -d] -f1`
    
    #Clan removed or does not exist
        if [ "$clan" = "    <title>" ]; then
          echo "REMOVED"
          return
    #Error handling - server maintenance
        elif [ "$clan" = "" ]; then
          errors=$((errors+1))
          if [ $errors -lt 2 ]; then
            echo -n "EMPTY `date +%T_%F` $errors.. "
            sleep 10m
            continue
          elif [ $errors -lt 6 ]; then
            echo -n "$errors.. "
            sleep 10m
            continue
          else
            echo "ERROR"
            return
          fi
        fi
        break
      done
    
      echo -n "[$clan] => $clan.png"
      wget -qc -t 5 -T 10s http://$host/clans/media/clans/emblems/cl_${1:(-3)}/$1/emblem_64x64.png \
           -O ../icons/$dir/$clan.png 2>/dev/null
    
      echo " OK"
    }
    
    optimize()
    {
      echo "Optimizing PNGs..."
      (
        cd ../icons/$dir
        pngoptimizer -file:*.png
      )
    }
    

     

    EDIT: Doesnt work for me as it is. I think it hangs when getting from clanname from <title> for the $clan as the format of title has changed? Im not much of a coder myself so im not sure....

     

    clan=`wget -qc -t 5 -T 10s "http://$host/clans/$1/" -O - 2>/dev/null | \
              grep "<title>" | \
              cut -d[ -f2 | \
              cut -d] -f1`
    
×
×
  • Create New...