@SETLOCAL
@ECHO OFF
:: Localize TEMP for this .BTM
if exist r:\temp set temp=r:\temp
::
:: Otherwise, just use existing TEMP
if exist %temp\results.txt del /q %temp\results.txt
set plugins=e:\utils
iff exist %plugins\iso8601.dll then
if not plugin ISO8601 plugin /l %plugins\ISO8601.dll
endiff
::@dateconv is from the ISO8601 plugin
iff not isplugin @dateconv then
echo Could not find @dateconv of ISO8601 plugin.
quit
endiff
::Soure URL
::set url=http://prospero.unm.edu/dl/
set url=https://charlesdye.net/dl/
::File with all plugin details
set version=%temp\version.txt
if exist %version del /q %version
copy /q %url/version.txt %temp
iff exist %version then
do plugin in @%version
iff %@left[1,%plugin] eq [ then
Gosub Uploaded >> %temp\results.txt
endiff
enddo
else
echo %version does not exist.
quit
endiff
:: Change this to No if you would prefer GUI popup window
OPTION //ConsolePopupWindows=Yes
set results=%@select[%temp\results.txt,10,10,20,40,Select a Plugin to download from %url,-1]
OPTION //ConsolePopupWindows=No
iff defined results then
::
::Get the last word on the line
set theplugin=%@word[-0,%results].zip
::
::Convert to lower case
set theplugin=%@lower[%theplugin]
::
::Copy the remote file to a local file
copy /g %url%%theplugin %temp
else
echo Esc pressed, selection aborted.
endiff
::Cleanup
if exist %temp\version.txt del /q %temp\version.txt
if exist %temp\results.txt del /q %temp\results.txt
ENDLOCAL
quit
:Uploaded
set Uploaded=%@iniread[%version,%@strip[[],%plugin],Uploaded]
set Uploaded=%@left[8,%Uploaded]
::@dateconv is from the ISO8601 plugin
set Uploaded=%@dateconv[%Uploaded,,259]
echo %Uploaded %@strip[[],%plugin]
Return