so i decided to make another. dolphin archiver.

Discussion in 'Computer Programming, Emulation, and Game Modding' started by MarioMasta64, Jul 30, 2017.

  1. MarioMasta64
    OP

    MarioMasta64 hi. i make batch stuff and portable shiz

    Member
    1,914
    411
    Dec 21, 2016
    United States
    Code:
    @echo off
    cls
    Color 0A
    
    :: set /a cycle1=0
    :: set /a cycle2=0
    :: set /a cycle3=-1
    
    set /a cycle1=2
    set /a cycle2=5
    set /a cycle3=0
    
    if not exist .\extra\ mkdir .\extra\
    for /f "delims=" %%i in ('dir /b /s /a-d ^| findstr /i "dolphin_*.exe"') do del "%%~i"
    
    goto skipcheck
    
    if exist index.html del index.html
    .\bin\wget.exe -q --show-progress https://dolphin-emu.org/download/
    pause
    
    if not exist index.html goto Start-Dolphin
    for /f tokens^=2delims^=^" %%A in (
      'findstr /i /c:"https://dl-mirror.dolphin-emu.org/" /c:"https://dl-mirror.dolphin-emu.org/" index.html'
    ) Do > dolphin_link.txt Echo:%%A
    set /p dolphin_link=<dolphin_link.txt
    if %dolphin_link:~37,1%==/ set dolphin_ver=%dolphin_link:~34,3%
    if %dolphin_link:~37,1%==. set dolphin_ver=%dolphin_link:~34,5%
    echo %dolphin_ver%
    :: if %dolphin_link:~37,1%==/ echo %dolphin_link:~38,99%
    :: if %dolphin_link:~37,1%==. echo %dolphin_link:~40,99%
    pause
    if exist dolphin_link.txt del dolphin_link.txt
    if exist index.html del index.html
    pause
    
    :skipcheck
    
    :loop
    if %cycle1% LSS 4 (
      set /a cycle3+=0
      set /a cycle2+=5
    )
    if %cycle1% GEQ 4 (
      set /a cycle3+=1
    )
    if %cycle3%==10 set /a cycle3=0 & set /a cycle2+=1
    if %cycle2%==10 set /a cycle2=0 & set /a cycle1+=1
    if %cycle1%==10 set /a cycle1=0 & echo done archiving & pause & exit
    if %cycle3% EQU 0 set dolphin-ver=%cycle1%.%cycle2%
    if %cycle3% NEQ 0 set dolphin-ver=%cycle1%.%cycle2%.%cycle3%
    if %cycle1% GEQ 4 set dolphin-domain=dl-mirror.dolphin-emu.org/%dolphin-ver%
    if %cycle1% LSS 4 set dolphin-domain=dl.dolphin-emu.org/releases
    if %cycle1%%cycle2%%cycle3% LEQ 400 set file=dolphin-%dolphin-ver%-x64.exe
    if %cycle1%%cycle2%%cycle3% GTR 400 set file=dolphin-x64-%dolphin-ver%.exe
    call :download
    goto loop
    
    :download
    title Downloading https://%dolphin-domain%/%file% - Dolphin Archiver - By MarioMasta64
    if exist %file% del /s /q %file% >nul
    if exist .\extra\%file% echo https://%dolphin-domain%/%file% is already archived & (goto) 2>nul
    if not exist %file% .\bin\wget.exe -q --show-progress https://%dolphin-domain%/%file%
    if exist %file% move %file% .\extra\%file% >nul
    if "https://%dolphin-domain%/%file%"=="%dolphin_link%" echo done archiving & pause >nul & exit
    (goto) 2>nul
    
    also requires wget.exe next to it. get it from here: https://eternallybored.org/misc/wget/
     
    Last edited by MarioMasta64, Jul 30, 2017
  2. MarioMasta64
    OP

    MarioMasta64 hi. i make batch stuff and portable shiz

    Member
    1,914
    411
    Dec 21, 2016
    United States
    i decided to skip the latest check because it kept trying to say 4.0 mac build. you can exit the batch file to your own judgement after a released build.
     
  3. MarioMasta64
    OP

    MarioMasta64 hi. i make batch stuff and portable shiz

    Member
    1,914
    411
    Dec 21, 2016
    United States
    sadly because of it changing between
    dolphin-x64-%dolphin-ver%.exe and dolphin-%dolphin-ver%-x64.exe
    in some builds. itll take twice as long as the cemu one (the only slow moment is when it checks the site for a non-existant build)
    i suppose i could add a thing in that says only check once. but then internet connectivity problem'd people might have an issue and it might skip good builds.
    then again. if you have internet problems why would you want to download alot of stuff .3.

    — Posts automatically merged - Please don't double post! —

    welp it fails on pre-4.0 builds. time for edits. turns out this is cause they use a different server.
     
    Last edited by MarioMasta64, Jul 30, 2017
  4. MarioMasta64
    OP

    MarioMasta64 hi. i make batch stuff and portable shiz

    Member
    1,914
    411
    Dec 21, 2016
    United States
    update: made better coding in relation to how the dolphin servers are (sorta)