# Batch Dump .FLOW/.MSG

TGE's [Atlus-Script-Tools](https://github.com/TGEnigma/Atlus-Script-Tools) repository comes with other [**commandline**](https://docs.shrinefox.com/flowscript/atlusscriptcompiler/run-via-commandline) programs aside from just [**AtlusScriptCompiler**](https://docs.shrinefox.com/flowscript/atlusscriptcompiler). **AtlusFlowScriptExtractor** and **AtlusMessageScriptExtractor**, as their names imply, batch [**decompile**](https://docs.shrinefox.com/flowscript/atlusscriptcompiler/run-via-commandline/decompile) all `.FLOW` and `.MSG` data from `.BF` and `.BMD` in a directory (and subdirectories), even ones contained in archives like `.PAC`.

You'll end up with `.TXT` files containing all of the dumped data. While the [**ShrineFox.com Text Search**](https://docs.shrinefox.com/intro-to-scripting/resources#shrinefox-com-textsearch) provides these advantages, it's also nice to have a local dump on your computer to search and use as a reference.

## Using AtlusFlowScriptExtractor

Enter the path to AtlusFlowScriptExtractor.exe in the Windows Command Prompt.

```
Microsoft Windows [Version 10.0.22000.120]
(c) Microsoft Corporation. All rights reserved.

C:\Users\Username>"C:\Path\To\AtlusFlowScriptExtractor.exe"
```

Then, enter the path to the directory you want to scan. Ideally, this should be a folder containing the extracted contents of your `data.cpk` and `ps3.cpk`. You can use [CriPakGUI](https://shrinefox.com/browse?post=cripakgui) to extract these if you haven't already.

```
C:\Users\Username>"C:\Path\To\AtlusFlowScriptExtractor.exe" "D:\Games\Persona\Backups\Persona 5"
```

From here, there's optional arguments we can add for different results.

|       Argument | Info                                                                                                                                                      |
| -------------: | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
|     **`-enc`** | <p>Determines which text encoding is used. <br>If no enc directive is provided, non-ASCII <br>code points will be output as hex values</p>                |
|    **`-func`** | <p>Enables the output of function codes.<br>Disabled by default</p>                                                                                       |
|    **`-scan`** | <p>Enables bruteforce scanning for message <br>script data if file type is not detected <br>(CAN BE VERY SLOW)</p>                                        |
| **`-noalign`** | <p>Disables 4 byte alignment for scanning. <br>Not recommend unless you're sure the file <br>contains text that doesn't get detected <br>(ULTRA SLOW)</p> |
| **`-exclude`** | <p>Excludes specified file extensions from<br>brute force scanning.</p>                                                                                   |
| **`-include`** | <p>Includes specified file extensions in<br>brute force scanning.</p>                                                                                     |
|     **`-dec`** | <p>Uses decompiler output instead</p><p>of the regular output.</p>                                                                                        |

Here's the options I went with, since I wanted to output with decompiler formatting, since I'm working with flowscripts and it'd make a handy 1:1 reference. I also skip large files that for sure don't contain script data (`.GMD, .GAP, .GFS, .GSC, .USM, .EPL, .ENV`...)

```
C:\Users\Username>"C:\Path\To\AtlusFlowScriptExtractor.exe" "D:\Games\Persona\Backups\Persona 5" -dec -scan -exclude usm gmd gap gfs epl env spr spd plg adx gsc acb awb dds bed bcd evt bfl 000 001 dat cmr bmd
```

This process can take quite some time, so sit back and relax until you have a complete `AtlusFlowScriptExtractorOutput.txt` file.

## Using AtlusMessageScriptExtractor

Pretty much the same as above.

```
C:\Users\Username>"C:\Path\To\AtlusMessageScriptExtractor.exe" "D:\Games\Persona\Backups\Persona 5" -dec -enc p5 -scan -exclude usm gmd gap gfs epl env spr spd plg adx acb awb dds bed bcd evt bfl 000 001 dat cmr
```

This process can take quite some time, so sit back and relax until you have a complete `MessageScriptDump.txt` file.
