Ads displayed for guests and not donating members only. Get ad-free by donating. If you have already donated, please read here.
Results 1 to 12 of 12

Thread: Upload Script for Mac

  1. #1

    Upload Script for Mac

    Proper version of a shell script for Macintosh to auto-upload statistics, works on 9.9. Tested ok on 9.10.

    3-Step Installation

    Open Applications->Terminal

    First step (thanks doosh!)

    You will need the (Apple) Command Line Tools installed on your system to run git (distributed revision control system), which homebrew depends on. Apple does not ship these by default anymore as they used to in earlier OSX version.

    Install them (including git) by running

    xcode-select --install

    and selecting "Install" if don't have them already installed.

    Second step

    If you do not have homebrew (http://brew.sh/) installed, install it by entering

    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

    Finally, install macdup using homebrew by running

    brew tap wolframteetz/tap; brew reinstall macdup; brew test macdup;

    A text editor will open, please edit your user name and your token (http://www.vbaddict.net/token.php) accordingly and save before you close.

    Usage
    -------
    Open Applications->Terminal

    Run the following command:

    macdup

    Leave the Terminal open and just play WOT as normal. Close the Terminal one minute after you're done playing WOT.

    The current code can be found on my GitHub repo

    https://github.com/wolframteetz/macdup

    Hope it helps
    Last edited by lotusthemotus.eu; 2015-09-07 at 13:39. Reason: Updated installation process to homebrew

  2. #2
    Retired Commander Phalynx.eu's Avatar
    Join Date
    Jan 2013
    Location
    Erlangen, Germany
    Posts
    2,127
    Nice, thanks for sharing. I've moved it out from the other post and pinned it.

  3. #3
    Nie ma za co.. if you have problems on OSX just PM me.. in English, Polish or German^^

  4. #4
    Retired Commander Phalynx.eu's Avatar
    Join Date
    Jan 2013
    Location
    Erlangen, Germany
    Posts
    2,127
    Great.
    Pozdrowienia z Erlangen nach München

  5. #5
    Thanks so much! Big help!

    I'd like to add one extra note:

    As homebrew installer finished, a message came up to install Command Line Tools for Xcode. I tried installing macdup without doing this, as listed above, and install errored out as shown in pic #1 below. I then installed the command line tools as instructed (grabbed the latest version for my OS, 10.8 Mountain Lion, instead of most current version, and I would recommend anyone else do the same for whatever OS they are on). Macdup install worked perfectly after that. Anyone who doesn't use Xcode, dev tools etc probably doesn't have Git installed without this and will get same result.

    Thanks again!

    Click image for larger version. 

Name:	Screen Shot 2015-08-20 at 11.12.51 AM.jpg 
Views:	156 
Size:	18.6 KB 
ID:	293

  6. #6
    You're welcome, glad it helps. Thanks for the hint, makes perfect sense. I've added it to the installation instructions.

  7. #7
    I did everything as instructed (running latest osx); how do I edit user name and token? I did not receive a prompt for textedit...

  8. #8
    Quote Originally Posted by alp_jager.eu View Post
    I did everything as instructed (running latest osx); how do I edit user name and token? I did not receive a prompt for textedit...
    in terminal run this command to see where macdup is

    which maccdup

    likely that's /usr/local/bin/macdup then

    open -e /usr/local/bin/macdup

    should open it in TextEdit

  9. #9
    Same here text edit doesn't open no matter what i do

    Edit.text editor works butt macdup give error like this
    parse error: Invalid numeric literal at line 1, column 10
    Number of new battle result files
    1
    parse error: Invalid numeric literal at line 1, column 10
    Uploading replays
    1
    parse error: Invalid numeric literal at line 1, column 10


    any help for this?
    Last edited by pommis.eu; 2016-05-28 at 12:04.

  10. #10

    how do i edit user name and token

    i cannot find a way to edit my name or token, i run brew tap, this is what i get. where do i go from here?

    Andys-Mac-mini:~ Andy$ brew tap wolframteetz/tap; brew reinstall macdup; brew test macdup;
    ==> Reinstalling wolframteetz/tap/macdup
    ==> Downloading https://github.com/wolframteetz/macd...e/1.0.3.tar.gz
    Already downloaded: /Users/Andy/Library/Caches/Homebrew/macdup-1.0.3.tar.gz
    Warning: Calling ENV.no_optimization is deprecated!
    There is no replacement.
    /usr/local/Homebrew/Library/Taps/wolframteetz/homebrew-tap/macdup.rb:12:in `install'
    Please report this to the wolframteetz/tap tap!

    🍺 /usr/local/Cellar/macdup/1.0.3: 5 files, 21.7K, built in 17 seconds
    Testing wolframteetz/tap/macdup
    ==> Using the sandbox
    ==> chmod u+w /usr/local/bin/macdup
    Last 15 lines from /Users/Andy/Library/Logs/Homebrew/macdup/test.01.macdup:
    2017-01-09 18:17:47 -0500

    chmod u+w /usr/local/bin/macdup

    chmod: Unable to change file mode on /usr/local/bin/macdup: Operation not permitted
    Error: wolframteetz/tap/macdup: failed
    Failed executing: chmod u+w /usr/local/bin/macdup
    /usr/local/Homebrew/Library/Homebrew/formula.rb:1821:in `block in system'
    /usr/local/Homebrew/Library/Homebrew/formula.rb:1759:in `open'
    /usr/local/Homebrew/Library/Homebrew/formula.rb:1759:in `system'
    /usr/local/Homebrew/Library/Taps/wolframteetz/homebrew-tap/macdup.rb:24:in `block in <class:Macdup>'
    /usr/local/Homebrew/Library/Homebrew/formula.rb:1658:in `block (2 levels) in run_test'
    /usr/local/Homebrew/Library/Homebrew/formula.rb:879:in `with_logging'
    /usr/local/Homebrew/Library/Homebrew/formula.rb:1657:in `block in run_test'
    /usr/local/Homebrew/Library/Homebrew/extend/fileutils.rb:14:in `block in mktemp'
    /usr/local/Homebrew/Library/Homebrew/extend/fileutils.rb:74:in `block in run'
    /usr/local/Homebrew/Library/Homebrew/extend/fileutils.rb:74:in `chdir'
    /usr/local/Homebrew/Library/Homebrew/extend/fileutils.rb:74:in `run'
    /usr/local/Homebrew/Library/Homebrew/extend/fileutils.rb:13:in `mktemp'
    /usr/local/Homebrew/Library/Homebrew/formula.rb:1651:in `run_test'
    /usr/local/Homebrew/Library/Homebrew/test.rb:28:in `block in <main>'
    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/timeout.rb:66:in `timeout'
    /usr/local/Homebrew/Library/Homebrew/test.rb:27:in `<main>'
    Andys-Mac-mini:~ Andy$

  11. #11
    edit the file /usr/local/Cellar/macdup/1.0.3/bin/macdup. They changed the install path, didn't notice that.
    I need to update the uploader i guess, didn't use it for quite a while.
    Last edited by lotusthemotus.eu; 2017-02-06 at 14:42.

  12. #12

    Mac OS ~ working macup script

    If anyone is interested and they want a working script, after they've done the steps above, then I've got the one below working.


    #!/bin/bash

    #
    # macdup
    #
    # VBaddict Dossier Uploader for OSX
    #
    # Please edit the three variables below to match your account
    # You can find/generate your token here : http://www.vbaddict.net/token.php
    #

    VB_USER=MyUserName
    VB_TOKEN=My123TokenGoesHere456
    VB_SERVER=eu

    clear
    echo "Dossier Uploader for vBAddict"
    echo "https://github.com/wolframteetz/worldoftanks/blob/master/README.md"
    echo

    while true
    do
    cd ~/Library/Application\ Support/World\ of\ Tanks/Bottles/worldoftanks/drive_c/users/crossover/Application\ Data/Wargaming.net/WorldOfTanks/dossier_cache
    if [ -n "$(find . -name "*.dat" -mmin -1)" ]; then
    echo "Number of new dossier files"
    find . -name "*.dat" -mmin -1 | wc -l
    find . -name "*.dat" -mmin -1 -exec sh -c "curl -s --upload-file {} http://carius.vbaddict.net:82/upload_file/dossier/$VB_SERVER/$VB_USER/$VB_TOKEN/json | jq ".message" " \;
    fi
    cd ~/Library/Application\ Support/World\ of\ Tanks/Bottles/worldoftanks/drive_c/users/crossover/Application\ Data/Wargaming.net/WorldOfTanks/battle_results
    if [ -n "$(find . -name "*.dat" -mmin -1)" ]; then
    echo "Number of new battle result files"
    find . -name "*.dat" -mmin -1 | wc -l
    find . -name "*.dat" -mmin -1 -exec sh -c "curl -s --upload-file {} http://carius.vbaddict.net:82/upload_file/battleresult/$VB_SERVER/$VB_USER/$VB_TOKEN/json | jq ".message" " \;
    fi
    cd ~/Library/Application\ Support/World\ of\ Tanks/Bottles/worldoftanks/drive_c/games/world_of_tanks/replays/
    if [ -n "$(find . -name "replay*.wotreplay" -mmin -1)" ]; then
    echo "Uploading replays"
    find . -name "replay*.wotreplay" -mmin -1 | wc -l
    find . -name "replay*.wotreplay" -mmin -1 -exec sh -c "curl -s --upload-file {} http://carius.vbaddict.net:82/upload_file/replay/$VB_SERVER/$VB_USER/$VB_TOKEN/json | jq ".message" " \;
    fi
    echo -n "Next check for new dossier files at "
    date -v +1M
    sleep 60
    done

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •