1 Attachment(s)
D&D Miniatures Resizing Script
This script was based off of work done by "valeros". The original can be found here.
The included script is designed to download images files from a website (in this case, WotC's D&D Mini Preview pages), convert the files to PNG and remove the originals.
BE AWARE: The VBScript file (ending in VBS) uses features that some antivirus programs may consider the file to be a virus. You may view the details of the file by editing the file as described in the "Before Running" section.
Before Running
================================================== ========
- ImageMagic needs to be installed on the system.
- You must configure the "START UPDATE" sections in the file.
- To edit, right click the file and choose "Open With..." and choose "Notepad" or another text editor.
- Version 1
- Line 17
- Change the location to where you would like to store the files.
- The location must be enclosed in quotation marks.
- The location must end in a \
- Example:
Code:
CurrLoc = "C:\Downloaded Files\Fantasy Grounds\tokens\"
- Line 19
- Change the location to where ImageMagick is located.
- The location must be enclosed in quotation marks.
- The location must end in \convert.exe
- Only change the location of the line (In the example below, c:\program files\ImageMagick-6.5.7-1)
- Example:
Code:
ConvertLoc = chr(34) & "c:\program files\ImageMagick-6.5.7-1\convert.exe" & chr(34) & " "
- Line 46 & 47
- If you would like to keep the original JPG files that were downloaded, put an apostraphe (') before the text on these lines.
- Example 1:
Code:
'AddToBatchFile("PING -n 20 127.0.0.1>nul")
'AddToBatchFile("DEL " & chr(34) & CurrLoc & arySets(i,0,SysNum) & "\*.jpg" & chr(34))
- Example 2:
Code:
' AddToBatchFile("PING -n 20 127.0.0.1>nul")
' AddToBatchFile("DEL " & chr(34) & CurrLoc & arySets(i,0,SysNum) & "\*.jpg" & chr(34))
To Run
================================================== ========
- Extract the files.
- Double Click on the "DownloadAndResize.vbs" file.
- When prompted, enter the size of the of the Medium sized pixel.
- After all files are downloaded, you will be notified and a DOS box will populate to modify the file.
- When the DOS box goes away, the files are complete.
- The images will be located in the folder on Line 17.
Version 1 Features:
================================================== ========
- Saves downloaded images to a folder created for each set of miniatures.
- Modifies background to remove white space.
- Resizes the images based on the size of the creature (ex, Small is 0.75x the size of Medium, Large is 2x the size of Medium)
- Currently configured for 3.x Edition
- Includes the following sets:
- Set Symbols
- Harbinger
- Dragoneye
- Archfiends
- Giants of Legend
- Aberrations
- Deathknell
- Angelfire
- Underdark
- War Drums
- War of the Dragon Queen
- Blood War
- Unhallowed
- Night Below
- Desert of Desolation
- Dungeons of Dread
- Against the Giants
- Demonweb
- Players Handbook Heroes Series 1
- Dangerous Delves
- Legendary Evils
- Players Handbook Heroes Series 2
- Savage Encounters
Any feedback is appreciated!
EDIT: Original file did not download the files due to testing bug. This has been fixed in the current attachment.
2 Attachment(s)
Version 3 - Creates MOD files
The script now creates a Module (MOD) file for each set. After the scripting is completed, copy the Module to your "modules" folder for Fantasy Grounds.
See the screen shot for an example of the finished product.
Previously noted lines have been changed to account for new code. Please review the "READ ME.TXT" file in the zip folder for details.
EDIT: Updated the ZIP file to resolve the War Drums and Night Below thumbnails show in the modules.
Code:
Line 306
aryNames(0,0,11,0) = "ddm_setsymbol_11.jpg,Blood War.jpg,M"
Line 308
aryNames(0,0,13,0) = "ddm_setsymbol_13.jpg,Night Below.jpg,M"