-
May 15th, 2016, 06:51 #1
- Join Date
- Aug 2009
- Posts
- 261
Easy Do It Yourself – All free 5E Monsters for PAR5E (from WoTC website)
To get all monsters from the free DM's Rules posted on the Wizards of the Coast website, you can use the powershell commands below to get an "npcs.txt" file for PAR5E for creating a module. (That will also give you a bunch of examples that work for creating your own monsters.)
Note: since this will access the WoTC website, when running this you may get one or two popups asking about cookies. You can select yes or no.
1) Open a command prompt (In Windows 10, right click the start button and select "Command Prompt")
2) In the command prompt, type or copy/paste the following:
Code:powershell $HTML = Invoke-WebRequest -Uri "https://dnd.wizards.com/products/tabletop/dm-basic-rules" $monsters = ($HTML.ParsedHtml.body.getElementsByTagName('dl') | Where {$_.getAttributeNode('class').Value -eq 'monster-list'}).innerHTML $monsters = $monsters -replace "(</TH>|</TD>|</THEAD>)`r`n", " " # For abilities (STR, DEX, etc.) $monsters = $monsters -replace "<H5>Actions</H5>", "ACTIONS" $monsters = $monsters -replace "<H5>Reactions</H5>", "REACTIONS" $monsters = $monsters -replace "<H5>Legendary Actions</H5>", "LEGENDARY ACTIONS" $monsters = $monsters -replace "<H5>|<H6>", "<h>" # For headers in lore $monsters = $monsters -replace "</H5>|</H6>", "</h>" # For headers in lore $monsters = $monsters -replace "<BR>", " " $monsters = $monsters -replace "<LI>(Cantrip.|1st|2nd|3rd|.th)", '\r$1' # For spell lists $monsters = $monsters -replace "<LI>", "" # In lore or actions (e.g., spectator & adult red dragon) $monsters = $monsters -replace "<P class=lore>", "##;`r`n" $monsters = $monsters -replace "</*(UL|LI|DD|OL|HR|THEAD|TR|TBODY|P|STRONG|EM|TH|TD|DIV|DD|TABLE|(P|DT|DIV|UL)([^>]*))>", "" $monsters = $monsters -replace "`r`n(`r`n)+", "`r`n" # remove blank lines $monsters = $monsters -replace " CHA `r`n", " CHA " # remove line between ability description & values $monsters = $monsters -replace "<SPAN>([^>]+)</SPAN>", "`r`n`$1" # Make sure blank line before monster name $monsters | Out-File -encoding UTF8 "npcs.txt"
-
May 15th, 2016, 09:12 #2
- Join Date
- Jan 2016
- Posts
- 473
This is some cool use of power shell!
-
May 15th, 2016, 09:30 #3
-
May 16th, 2016, 01:20 #4
Are these monsters that are not included in the SRD or MM? Or are they duplicated if I already have those? Cuz I though FG already included everything from the basic rules... (but, I'm fairly ignorant as to the details)
Problems? See; How to Report Issues, Bugs & Problems
On Licensing & Distributing Community Content
Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
Note, I am not a SmiteWorks employee or representative, I'm just a user like you.
-
May 16th, 2016, 02:12 #5
I believe it is a bit of POC for Valeros. But it also creates raw input files useful as a reference for those people who are wanting to add their own content.
These are the same as what Valeros excellent Basic Rules Parser created - just made with such a beautifully tight script.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks