Battle Reports: Difference between revisions
J.Reumerman (talk | contribs) No edit summary |
J.Reumerman (talk | contribs) |
||
Line 16: | Line 16: | ||
#First, you must view a battle report via your scribe report.<br> | #First, you must view a battle report via your scribe report.<br> | ||
#Click on "View Source".<br> | #Click on "View Source".<br> | ||
#Copy the source by either right clicking and pressing "Copy" or using "Ctrl | #Copy the source by either right clicking and pressing "Copy" or using "Ctrl C".<br> | ||
#Open up a Word Document.<br> | #Open up a Word Document.<br> | ||
#Right click and select "Paste text only" '''--DON'T JUST NORMALLY PASTE IT, HAVEN'T FIXED THAT PART YET--''' | #Right click and select "Paste text only" '''--DON'T JUST NORMALLY PASTE IT, HAVEN'T FIXED THAT PART YET--''' |
Revision as of 19:29, 7 March 2018
Addendum by Gabanus
The below pieces have formed the inspiration of what I will share here, but were already outdated again. Nonetheless respect and thanks to Peter Kolak in particular for posting the original piece.
If you want to take a battle report and post it on a website (or the wiki), here's what you have to do:
A. Open a Microsoft Word File
B. Make sure you have developer mode enabled and preferably added to your ribbon
- First, Open Visual Basics
- Then, Create a new Module
- Lastly, Copy the following code inside the module and save the document
C. To make the battle report
- First, you must view a battle report via your scribe report.
- Click on "View Source".
- Copy the source by either right clicking and pressing "Copy" or using "Ctrl C".
- Open up a Word Document.
- Right click and select "Paste text only" --DON'T JUST NORMALLY PASTE IT, HAVEN'T FIXED THAT PART YET--
Code to paste in module:
Sub BattleConverter() ' Remove first section of the text Dim s s = ActiveDocument.Content ' Selects everything (ctrl 'a' basically) Dim SearchWord1 As String ' Sets/Defines variables needed for the indexOfThey formula. Easier to change when needed SearchWord1 = "</center>" Dim IndexOfSW As Integer ' Returns the location (as number) where the SearchWord1 is first seen IndexOfSW = InStr(1, s, SearchWord1) ' Deletes everything from start untill first letter of search word + length of word (which includes a potential space after the word)_ ' _ + 3 because the 4 characters after the words must be removed as well ActiveDocument.Range(Start:=0, End:=IndexOfSW + Len(SearchWord1) + 3).Delete ' Remove the last section of text that's not needed s = ActiveDocument.Content ' Resets s to include only the content that remained Dim SearchWord2 SearchWord2 = "<script" IndexOfSW = InStr(1, s, SearchWord2) ' Returns the location (as number) where the SearchWord2 is first seen ' Deletes everything from first letter of search word (- the first letter and <br/> before it) untill the end of the document ActiveDocument.Range(Start:=IndexOfSW - 6, End:=Len(ActiveDocument.Content)).Delete ' Create a 2 dimensional Array which holds all values which needs_ ' _ to be replaced + their replacement values Dim ReplaceArray(0 To 11, 0 To 1) ReplaceArray(0, 0) = "<Char" ReplaceArray(0, 1) = "<" ReplaceArray(1, 0) = "</Char" ReplaceArray(1, 1) = "<" ReplaceArray(2, 0) = "< " ReplaceArray(2, 1) = "<" ReplaceArray(3, 0) = "<p>" ReplaceArray(3, 1) = "<br>" ReplaceArray(4, 0) = "#000032" ' Background First table with general overview from dark blue to light gray ReplaceArray(4, 1) = "#DEDEEA" ReplaceArray(5, 0) = "#FFFFFF" ' White text to black (note to self: If you highlight own char as white, it's also changed making it harder to read) ReplaceArray(5, 1) = "#000000" '#9696FF blue ReplaceArray(6, 0) = "color: white" ' Some text color wasn't assigned by Hex colors, but through this code (mixed within the code) ReplaceArray(6, 1) = "color: black" ReplaceArray(7, 0) = "<P>" ReplaceArray(7, 1) = "<br>" ReplaceArray(8, 0) = "<>" ReplaceArray(8, 1) = "" ReplaceArray(9, 0) = "</FONT<" ReplaceArray(9, 1) = "</FONT><" ReplaceArray(10, 0) = "> " ' Some sentences started with a space because there was a space after certain parts of the code. Looked weird ReplaceArray(10, 1) = ">" ReplaceArray(11, 0) = "#004000" ' Background color of the combat tables (the green, making it lighter) ReplaceArray(11, 1) = "#116811" ' For each Value loop through it and replace it with it's replacement text Dim i As Long, j As Long For i = LBound(ReplaceArray) To UBound(ReplaceArray) Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = ReplaceArray(i, 0) .Replacement.Text = ReplaceArray(i, 1) .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll Next i End Sub
By: Peter Kolak
If you want to take a battle report and post it on a website, here's what you have to do:
A. Taking the scribe report and putting it in Word.
- First, you must view a battle report via your scribe report.
- Click on "View Source".
- Copy the source by either right clicking and pressing "Copy" or using "Ctrl P".
- Open up a Word Document.
- Right click and select "Paste" or simply type "Ctrl V".
B. Editing the text for the web page. Use "Find and Replace" and follow the next 13 steps.
- Replace "<Char" with "<".
- Replace "</Char" with "<".
- Replace "<_" with "<". (Where as "_" is equal to ONE blank space.)
- Replace "<^#^#^#^#^#>" with "". (Meaning, don't replace it with anything, just leave the replace section blank.
- Replace "<^#^#^#^#>" with "".
- Replace "<^#^#^#>" with "".
- Replace "<^#^#>" with "".
- Replace "< p >" with "< br >" (There are no spaces between the "<" and the "p".
- Replace "#DDDDDD" with "#00FFFF".
- Replace "#FFFFFF" with "#FFDD11".
- Replace "#E0E0FF" with "#FF00DD".
- Delete top several rows that contains header information.
- Delete very last info: "</Body></HTML>".
C. Preview and make sure it looks good.
Addendum by RubyDragon
Having used these steps quite often in the Falasan Inquirer, I found them to be incredibly useful, but here are some modifications which will help fix some of the bugs I found.
A. -no change
B. Editing the text for the web page. Use "Find and Replace" and follow the next 13 steps.
- Replace "<Char" with "<".
- Replace "</Char" with "<".
- Replace "<_" with "<". (Where as "_" is equal to ONE blank space.)
Replace "<^#^#^#^#^#>" with "". (Meaning, don't replace it with anything, just leave the replace section blank.- Replace "<^#^#^#^#>" with "".
- Replace "<^#^#^#>" with "".
Replace "<^#^#>" with "".(never found any of these myself)- Replace "< p >" with "< br >" (There are no spaces between the "<" and the "p".
- Replace "#DDDDDD" with "#00FFFF".
- Replace "#FFFFFF" with "#FFDD11".
- Replace "#E0E0FF" with "#FF00DD".
Delete top several rows that contains header information.Delete everything above and including the following phrase found near the beginning "Scribe Note, X turns old:"- Delete very last info:
"</Body></HTML>".
- "
- </BODY>
- </HTML><script language='javascript'>postamble();</script>"
RubyDragon's Additions
After doing B (with modifications, carry out the following:
- Replace "<>" with "".This removes all those odd "<>" speckling the report
- Replace "</FONT<" with "<" I noticed that if this weren't done, after a certain point all writing became yellow)
- Preview the battle report. You should notice a near the top. It is located after the "Scribe Note: Battle in XXXYYY", immediately behind "FormationCS"
C. Preview, make sure it looks good, and edit out anything that looks weird.
Addendum by Ceorl
- Replace "</FONT<" with "<".
- Replace "< p >" with "< br >". (There are no spaces between the "<" and the "p".
- Replace "< /p >" with "". (There are no spaces between the "<" and the "/p".
- Replace "<Char" with "<".
- Replace "</Char" with "<".
- Replace "<_" with "<". (Where as "_" is equal to ONE blank space.)
- Replace "<>" with "".
- Replace "white" with "black".
- Replace "#DDDDDD" with "#DC143C"
- Replace "#FFFFFF" with "#00008B"
- Replace "#E0E0FF" with "#A52A2A"
- Replace "#C0FFC0" with "#00008B" (This is for Defender Victory)
- Replace "#FFC0C0" with "#DC143C" (This is for Attacker Victory)
- Replace "#E0FFFF" with "#00008B"