API Examples
Below are a few simple and common examples of using the API.
Note
For more detailed information about the API, see API Reference
Fixing .Ini Files
Below are different ways of fixing either:
A single .ini file
ORThe content contained in a single .ini file
Only Fix a .ini File Given the File Path
Note
This example only fixes the .ini file without removing any previous changes the fix may have made. If you want to first undo previous changes the fix may have done, see Remove a Fix from a .ini File Given the File Path
To fix the .ini file by first removing any previous changes the fix may have made, see Fix a .ini File Given the File Path
Input
1[Constants]
2global persist $swapvar = 0
3global persist $swapvarn = 0
4global persist $swapmain = 0
5global persist $swapoffice = 0
6global persist $swapglasses = 0
7
8[KeyVar]
9condition = $active == 1
10key = VK_DOWN
11type = cycle
12$swapvar = 0,1,2
13
14[KeyIntoTheHole]
15condition = $active == 1
16key = VK_RIGHT
17type = cycle
18$swapvarn = 0,1
19
20; The top part is not really important, so I not going to finish
21; typing all the key swaps... 😋
22;
23; The bottom part is what the fix actually cares about
24
25[TextureOverrideRaidenShogunBlend]
26run = CommandListRaidenShogunBlend
27handling = skip
28draw = 21916,0
29
30[CommandListRaidenShogunBlend]
31if $swapmain == 0
32 if $swapvar == 0 && $swapvarn == 0
33 vb1 = ResourceRaidenShogunBlend.0
34 else
35 vb1 = ResourceEiBlendsHerBlenderInsteadOfHerSmoothie
36 endif
37else if $swapmain == 1
38 run = SubSubTextureOverride
39endif
40
41[SubSubTextureOverride]
42if $swapoffice == 0 && $swapglasses == 0
43 vb1 = GIMINeedsResourcesToAllStartWithResource
44endif
45
46[ResourceRaidenShogunBlend.0]
47type = Buffer
48stride = 32
49filename = ..\..\..\../../../../../../2-BunnyRaidenShogun\RaidenShogunBlend.buf
50
51[ResourceEiBlendsHerBlenderInsteadOfHerSmoothie]
52type = Buffer
53stride = 32
54if $swapmain == 1
55 filename = M:\AnotherDrive\CuteLittleEi.buf
56else
57 run = RaidenPuppetCommandResource
58endif
59
60[GIMINeedsResourcesToAllStartWithResource]
61type = Buffer
62stride = 32
63filename = ./../AAA/BBBB\CCCCCC\DDDDDRemapBlend.buf
64
65[RaidenPuppetCommandResource]
66type = Buffer
67stride = 32
68filename = ./Dont/Use\If/Statements\Or/SubCommands\In/Resource\Sections.buf
Code
1import FixRaidenBoss2 as FRB
2
3iniFile = FRB.IniFile("CuteLittleRaiden.ini")
4iniFile.parse()
5iniFile.fix()
Result
1[Constants]
2global persist $swapvar = 0
3global persist $swapvarn = 0
4global persist $swapmain = 0
5global persist $swapoffice = 0
6global persist $swapglasses = 0
7
8[KeyVar]
9condition = $active == 1
10key = VK_DOWN
11type = cycle
12$swapvar = 0,1,2
13
14[KeyIntoTheHole]
15condition = $active == 1
16key = VK_RIGHT
17type = cycle
18$swapvarn = 0,1
19
20; The top part is not really important, so I not going to finish
21; typing all the key swaps... 😋
22;
23; The bottom part is what the fix actually cares about
24
25[TextureOverrideRaidenShogunBlend]
26run = CommandListRaidenShogunBlend
27handling = skip
28draw = 21916,0
29
30[CommandListRaidenShogunBlend]
31if $swapmain == 0
32 if $swapvar == 0 && $swapvarn == 0
33 vb1 = ResourceRaidenShogunBlend.0
34 else
35 vb1 = ResourceEiBlendsHerBlenderInsteadOfHerSmoothie
36 endif
37else if $swapmain == 1
38 run = SubSubTextureOverride
39endif
40
41[SubSubTextureOverride]
42if $swapoffice == 0 && $swapglasses == 0
43 vb1 = GIMINeedsResourcesToAllStartWithResource
44endif
45
46[ResourceRaidenShogunBlend.0]
47type = Buffer
48stride = 32
49filename = ..\..\..\../../../../../../2-BunnyRaidenShogun\RaidenShogunBlend.buf
50
51[ResourceEiBlendsHerBlenderInsteadOfHerSmoothie]
52type = Buffer
53stride = 32
54if $swapmain == 1
55 filename = M:\AnotherDrive\CuteLittleEi.buf
56else
57 run = RaidenPuppetCommandResource
58endif
59
60[GIMINeedsResourcesToAllStartWithResource]
61type = Buffer
62stride = 32
63filename = ./../AAA/BBBB\CCCCCC\DDDDDRemapBlend.buf
64
65[RaidenPuppetCommandResource]
66type = Buffer
67stride = 32
68filename = ./Dont/Use\If/Statements\Or/SubCommands\In/Resource\Sections.buf
69
70
71; --------------- Raiden Boss Fix -----------------
72; Raiden boss fixed by NK#1321 if you used it for fix your raiden pls give credit for "Nhok0169"
73; Thank nguen#2011 SilentNightSound#7430 HazrateGolabi#1364 and Albert Gold#2696 for support
74
75[TextureOverrideRaidenShogunRemapBlend]
76run = CommandListRaidenShogunRemapBlend
77handling = skip
78draw = 21916,0
79
80[CommandListRaidenShogunRemapBlend]
81if $swapmain == 0
82 if $swapvar == 0 && $swapvarn == 0
83 vb1 = ResourceRaidenShogunRemapBlend.0
84 else
85 vb1 = ResourceEiBlendsHerRemapBlenderInsteadOfHerSmoothie
86 endif
87else if $swapmain == 1
88 run = SubSubTextureOverrideRemapBlend
89endif
90
91[SubSubTextureOverrideRemapBlend]
92if $swapoffice == 0 && $swapglasses == 0
93 vb1 = ResourceGIMINeedsResourcesToAllStartWithResourceRemapBlend
94endif
95
96
97[GIMINeedsResourcesToAllStartWithResourceRemapBlend]
98type = Buffer
99stride = 32
100filename = ..\AAA\BBBB\CCCCCC\DDDDDRemapRemapBlend.buf
101
102[ResourceEiBlendsHerRemapBlenderInsteadOfHerSmoothie]
103type = Buffer
104stride = 32
105if $swapmain == 1
106 filename = M:\AnotherDrive\CuteLittleEiRemapBlend.buf
107else
108 run = RaidenPuppetCommandResourceRemapBlend
109endif
110
111[ResourceRaidenShogunRemapBlend.0]
112type = Buffer
113stride = 32
114filename = ..\..\..\..\..\..\..\..\..\2-BunnyRaidenShogun\RaidenShogunRemapBlend.buf
115
116[RaidenPuppetCommandResourceRemapBlend]
117type = Buffer
118stride = 32
119filename = Dont\Use\If\Statements\Or\SubCommands\In\Resource\SectionsRemapBlend.buf
120
121
122; -------------------------------------------------
Only Fix .Ini file Given Only a String Containing the Content of the File
The code below will add the lines that make up the fix to the end of the original content of the .ini file
Note
This example only fixes the .ini file without removing any previous changes the fix may have made. If you want to first undo previous changes the fix may have done, see Remove a Fix from a .ini File Given Only a String Containing the Content of the File
To fix the .ini file by first removing any previous changes the fix may have made, see Fix a .ini File Given Only A String Containing the Content of the File
Note
To only get the lines that make up the fix without adding back to the original .ini file, see Get Only the Fix to the .Ini file Given Only a String Containing the Content of the File
Input
1shortWackyRaidenIniTxt = r"""
2[Constants]
3global persist $swapvar = 0
4global persist $swapvarn = 0
5global persist $swapmain = 0
6global persist $swapoffice = 0
7global persist $swapglasses = 0
8
9[KeyVar]
10condition = $active == 1
11key = VK_DOWN
12type = cycle
13$swapvar = 0,1,2
14
15[KeyIntoTheHole]
16condition = $active == 1
17key = VK_RIGHT
18type = cycle
19$swapvarn = 0,1
20
21; The top part is not really important, so I not going to finish
22; typing all the key swaps... 😋
23;
24; The bottom part is what the fix actually cares about
25
26[TextureOverrideRaidenShogunBlend]
27run = CommandListRaidenShogunBlend
28handling = skip
29draw = 21916,0
30
31[CommandListRaidenShogunBlend]
32if $swapmain == 0
33 if $swapvar == 0 && $swapvarn == 0
34 vb1 = ResourceRaidenShogunBlend.0
35 else
36 vb1 = ResourceEiBlendsHerBlenderInsteadOfHerSmoothie
37 endif
38else if $swapmain == 1
39 run = SubSubTextureOverride
40endif
41
42[SubSubTextureOverride]
43if $swapoffice == 0 && $swapglasses == 0
44 vb1 = GIMINeedsResourcesToAllStartWithResource
45endif
46
47[ResourceRaidenShogunBlend.0]
48type = Buffer
49stride = 32
50filename = ..\..\..\../../../../../../2-BunnyRaidenShogun\RaidenShogunBlend.buf
51
52[ResourceEiBlendsHerBlenderInsteadOfHerSmoothie]
53type = Buffer
54stride = 32
55if $swapmain == 1
56 filename = M:\AnotherDrive\CuteLittleEi.buf
57else
58 run = RaidenPuppetCommandResource
59endif
60
61[GIMINeedsResourcesToAllStartWithResource]
62type = Buffer
63stride = 32
64filename = ./../AAA/BBBB\CCCCCC\DDDDDRemapBlend.buf
65
66[RaidenPuppetCommandResource]
67type = Buffer
68stride = 32
69filename = ./Dont/Use\If/Statements\Or/SubCommands\In/Resource\Sections.buf
70"""
Code
71import FixRaidenBoss2 as FRB
72
73iniFile = FRB.IniFile(txt = shortWackyRaidenIniTxt)
74iniFile.parse()
75fixedResult = iniFile.fix()
76
77print(fixedResult)
Result
1[Constants]
2global persist $swapvar = 0
3global persist $swapvarn = 0
4global persist $swapmain = 0
5global persist $swapoffice = 0
6global persist $swapglasses = 0
7
8[KeyVar]
9condition = $active == 1
10key = VK_DOWN
11type = cycle
12$swapvar = 0,1,2
13
14[KeyIntoTheHole]
15condition = $active == 1
16key = VK_RIGHT
17type = cycle
18$swapvarn = 0,1
19
20; The top part is not really important, so I not going to finish
21; typing all the key swaps... 😋
22;
23; The bottom part is what the fix actually cares about
24
25[TextureOverrideRaidenShogunBlend]
26run = CommandListRaidenShogunBlend
27handling = skip
28draw = 21916,0
29
30[CommandListRaidenShogunBlend]
31if $swapmain == 0
32 if $swapvar == 0 && $swapvarn == 0
33 vb1 = ResourceRaidenShogunBlend.0
34 else
35 vb1 = ResourceEiBlendsHerBlenderInsteadOfHerSmoothie
36 endif
37else if $swapmain == 1
38 run = SubSubTextureOverride
39endif
40
41[SubSubTextureOverride]
42if $swapoffice == 0 && $swapglasses == 0
43 vb1 = GIMINeedsResourcesToAllStartWithResource
44endif
45
46[ResourceRaidenShogunBlend.0]
47type = Buffer
48stride = 32
49filename = ..\..\..\../../../../../../2-BunnyRaidenShogun\RaidenShogunBlend.buf
50
51[ResourceEiBlendsHerBlenderInsteadOfHerSmoothie]
52type = Buffer
53stride = 32
54if $swapmain == 1
55 filename = M:\AnotherDrive\CuteLittleEi.buf
56else
57 run = RaidenPuppetCommandResource
58endif
59
60[GIMINeedsResourcesToAllStartWithResource]
61type = Buffer
62stride = 32
63filename = ./../AAA/BBBB\CCCCCC\DDDDDRemapBlend.buf
64
65[RaidenPuppetCommandResource]
66type = Buffer
67stride = 32
68filename = ./Dont/Use\If/Statements\Or/SubCommands\In/Resource\Sections.buf
69
70
71
72; --------------- Raiden Boss Fix -----------------
73; Raiden boss fixed by NK#1321 if you used it for fix your raiden pls give credit for "Nhok0169"
74; Thank nguen#2011 SilentNightSound#7430 HazrateGolabi#1364 and Albert Gold#2696 for support
75
76[TextureOverrideRaidenShogunRemapBlend]
77run = CommandListRaidenShogunRemapBlend
78handling = skip
79draw = 21916,0
80
81[CommandListRaidenShogunRemapBlend]
82if $swapmain == 0
83 if $swapvar == 0 && $swapvarn == 0
84 vb1 = ResourceRaidenShogunRemapBlend.0
85 else
86 vb1 = ResourceEiBlendsHerRemapBlenderInsteadOfHerSmoothie
87 endif
88else if $swapmain == 1
89 run = SubSubTextureOverrideRemapBlend
90endif
91
92[SubSubTextureOverrideRemapBlend]
93if $swapoffice == 0 && $swapglasses == 0
94 vb1 = ResourceGIMINeedsResourcesToAllStartWithResourceRemapBlend
95endif
96
97
98[GIMINeedsResourcesToAllStartWithResourceRemapBlend]
99type = Buffer
100stride = 32
101filename = ..\AAA\BBBB\CCCCCC\DDDDDRemapRemapBlend.buf
102
103[ResourceEiBlendsHerRemapBlenderInsteadOfHerSmoothie]
104type = Buffer
105stride = 32
106if $swapmain == 1
107 filename = M:\AnotherDrive\CuteLittleEiRemapBlend.buf
108else
109 run = RaidenPuppetCommandResourceRemapBlend
110endif
111
112[ResourceRaidenShogunRemapBlend.0]
113type = Buffer
114stride = 32
115filename = ..\..\..\..\..\..\..\..\..\2-BunnyRaidenShogun\RaidenShogunRemapBlend.buf
116
117[RaidenPuppetCommandResourceRemapBlend]
118type = Buffer
119stride = 32
120filename = Dont\Use\If\Statements\Or\SubCommands\In\Resource\SectionsRemapBlend.buf
121
122
123; -------------------------------------------------
Get Only the Fix to the .Ini file Given Only a String Containing the Content of the File
The code below will only generate the necessary lines needed to fix the .ini file
Note
To have the fixed lines added back to the original content of the file, see Only Fix .Ini file Given Only a String Containing the Content of the File
Input
1shortWackyRaidenIniTxt = r"""
2[Constants]
3global persist $swapvar = 0
4global persist $swapvarn = 0
5global persist $swapmain = 0
6global persist $swapoffice = 0
7global persist $swapglasses = 0
8
9[KeyVar]
10condition = $active == 1
11key = VK_DOWN
12type = cycle
13$swapvar = 0,1,2
14
15[KeyIntoTheHole]
16condition = $active == 1
17key = VK_RIGHT
18type = cycle
19$swapvarn = 0,1
20
21; The top part is not really important, so I not going to finish
22; typing all the key swaps... 😋
23;
24; The bottom part is what the fix actually cares about
25
26[TextureOverrideRaidenShogunBlend]
27run = CommandListRaidenShogunBlend
28handling = skip
29draw = 21916,0
30
31[CommandListRaidenShogunBlend]
32if $swapmain == 0
33 if $swapvar == 0 && $swapvarn == 0
34 vb1 = ResourceRaidenShogunBlend.0
35 else
36 vb1 = ResourceEiBlendsHerBlenderInsteadOfHerSmoothie
37 endif
38else if $swapmain == 1
39 run = SubSubTextureOverride
40endif
41
42[SubSubTextureOverride]
43if $swapoffice == 0 && $swapglasses == 0
44 vb1 = GIMINeedsResourcesToAllStartWithResource
45endif
46
47[ResourceRaidenShogunBlend.0]
48type = Buffer
49stride = 32
50filename = ..\..\..\../../../../../../2-BunnyRaidenShogun\RaidenShogunBlend.buf
51
52[ResourceEiBlendsHerBlenderInsteadOfHerSmoothie]
53type = Buffer
54stride = 32
55if $swapmain == 1
56 filename = M:\AnotherDrive\CuteLittleEi.buf
57else
58 run = RaidenPuppetCommandResource
59endif
60
61[GIMINeedsResourcesToAllStartWithResource]
62type = Buffer
63stride = 32
64filename = ./../AAA/BBBB\CCCCCC\DDDDDRemapBlend.buf
65
66[RaidenPuppetCommandResource]
67type = Buffer
68stride = 32
69filename = ./Dont/Use\If/Statements\Or/SubCommands\In/Resource\Sections.buf
70"""
Code
71import FixRaidenBoss2 as FRB
72
73iniFile = FRB.IniFile(txt = shortWackyRaidenIniTxt)
74iniFile.parse()
75fixCode = iniFile.getFixStr()
76
77print(fixCode)
Result
1; --------------- Raiden Boss Fix -----------------
2; Raiden boss fixed by NK#1321 if you used it for fix your raiden pls give credit for "Nhok0169"
3; Thank nguen#2011 SilentNightSound#7430 HazrateGolabi#1364 and Albert Gold#2696 for support
4
5[TextureOverrideRaidenShogunRemapBlend]
6run = CommandListRaidenShogunRemapBlend
7handling = skip
8draw = 21916,0
9
10[CommandListRaidenShogunRemapBlend]
11if $swapmain == 0
12 if $swapvar == 0 && $swapvarn == 0
13 vb1 = ResourceRaidenShogunRemapBlend.0
14 else
15 vb1 = ResourceEiBlendsHerRemapBlenderInsteadOfHerSmoothie
16 endif
17else if $swapmain == 1
18 run = SubSubTextureOverrideRemapBlend
19endif
20
21[SubSubTextureOverrideRemapBlend]
22if $swapoffice == 0 && $swapglasses == 0
23 vb1 = ResourceGIMINeedsResourcesToAllStartWithResourceRemapBlend
24endif
25
26
27[GIMINeedsResourcesToAllStartWithResourceRemapBlend]
28type = Buffer
29stride = 32
30filename = ..\AAA\BBBB\CCCCCC\DDDDDRemapRemapBlend.buf
31
32[ResourceEiBlendsHerRemapBlenderInsteadOfHerSmoothie]
33type = Buffer
34stride = 32
35if $swapmain == 1
36 filename = M:\AnotherDrive\CuteLittleEiRemapBlend.buf
37else
38 run = RaidenPuppetCommandResourceRemapBlend
39endif
40
41[ResourceRaidenShogunRemapBlend.0]
42type = Buffer
43stride = 32
44filename = ..\..\..\..\..\..\..\..\..\2-BunnyRaidenShogun\RaidenShogunRemapBlend.buf
45
46[RaidenPuppetCommandResourceRemapBlend]
47type = Buffer
48stride = 32
49filename = Dont\Use\If\Statements\Or\SubCommands\In\Resource\SectionsRemapBlend.buf
50
51
52; -------------------------------------------------
Remove a Fix from a .ini File Given the File Path
Input
1[Constants]
2global persist $swapvar = 0
3global persist $swapvarn = 0
4global persist $swapmain = 0
5global persist $swapoffice = 0
6global persist $swapglasses = 0
7
8[KeyVar]
9condition = $active == 1
10key = VK_DOWN
11type = cycle
12$swapvar = 0,1,2
13
14[KeyIntoTheHole]
15condition = $active == 1
16key = VK_RIGHT
17type = cycle
18$swapvarn = 0,1
19
20; The top part is not really important, so I not going to finish
21; typing all the key swaps... 😋
22;
23; The bottom part is what the fix actually cares about
24
25[TextureOverrideRaidenShogunBlend]
26run = CommandListRaidenShogunBlend
27handling = skip
28draw = 21916,0
29
30[CommandListRaidenShogunBlend]
31if $swapmain == 0
32 if $swapvar == 0 && $swapvarn == 0
33 vb1 = ResourceRaidenShogunBlend.0
34 else
35 vb1 = ResourceEiBlendsHerBlenderInsteadOfHerSmoothie
36 endif
37else if $swapmain == 1
38 run = SubSubTextureOverride
39endif
40
41[SubSubTextureOverride]
42if $swapoffice == 0 && $swapglasses == 0
43 vb1 = GIMINeedsResourcesToAllStartWithResource
44endif
45
46[ResourceRaidenShogunBlend.0]
47type = Buffer
48stride = 32
49filename = ..\..\..\../../../../../../2-BunnyRaidenShogun\RaidenShogunBlend.buf
50
51[ResourceEiBlendsHerBlenderInsteadOfHerSmoothie]
52type = Buffer
53stride = 32
54if $swapmain == 1
55 filename = M:\AnotherDrive\CuteLittleEi.buf
56else
57 run = RaidenPuppetCommandResource
58endif
59
60[GIMINeedsResourcesToAllStartWithResource]
61type = Buffer
62stride = 32
63filename = ./../AAA/BBBB\CCCCCC\DDDDDRemapBlend.buf
64
65[RaidenPuppetCommandResource]
66type = Buffer
67stride = 32
68filename = ./Dont/Use\If/Statements\Or/SubCommands\In/Resource\Sections.buf
69
70; ------ some lines originally generated from the fix ---------
71
72[ResourceEiBlendsHerRemapBlenderInsteadOfHerSmoothie]
73type = Buffer
74stride = 32
75if $swapmain == 1
76 filename = M:\AnotherDrive\CuteLittleEiRemapBlend.buf
77else
78 run = RaidenPuppetCommandResourceRemapBlend
79endif
80
81[ResourceRaidenShogunRemapBlend.0]
82type = Buffer
83stride = 32
84filename = ..\..\..\..\..\..\..\..\..\2-BunnyRaidenShogun\RaidenShogunRemapBlend.buf
85
86[RaidenPuppetCommandResourceRemapBlend]
87type = Buffer
88stride = 32
89filename = Dont\Use\If\Statements\Or\SubCommands\In\Resource\SectionsRemapBlend.buf
90
91; --------------------------------------------------------------
92
93
94; --------------- Raiden Boss Fix -----------------
95; Raiden boss fixed by NK#1321 if you used it for fix your raiden pls give credit for "Nhok0169"
96; Thank nguen#2011 SilentNightSound#7430 HazrateGolabi#1364 and Albert Gold#2696 for support
97
98[TextureOverrideRaidenShogunRemapBlend]
99run = CommandListRaidenShogunRemapBlend
100handling = skip
101draw = 21916,0
102
103[CommandListRaidenShogunRemapBlend]
104if $swapmain == 0
105 if $swapvar == 0 && $swapvarn == 0
106 vb1 = ResourceRaidenShogunRemapBlend.0
107 else
108 vb1 = ResourceEiBlendsHerRemapBlenderInsteadOfHerSmoothie
109 endif
110else if $swapmain == 1
111 run = SubSubTextureOverrideRemapBlend
112endif
113
114[SubSubTextureOverrideRemapBlend]
115if $swapoffice == 0 && $swapglasses == 0
116 vb1 = ResourceGIMINeedsResourcesToAllStartWithResourceRemapBlend
117endif
118
119
120[GIMINeedsResourcesToAllStartWithResourceRemapBlend]
121type = Buffer
122stride = 32
123filename = ..\AAA\BBBB\CCCCCC\DDDDDRemapRemapBlend.buf
124
125[ResourceEiBlendsHerRemapBlenderInsteadOfHerSmoothie]
126type = Buffer
127stride = 32
128if $swapmain == 1
129 filename = M:\AnotherDrive\CuteLittleEiRemapBlend.buf
130else
131 run = RaidenPuppetCommandResourceRemapBlend
132endif
133
134[ResourceRaidenShogunRemapBlend.0]
135type = Buffer
136stride = 32
137filename = ..\..\..\..\..\..\..\..\..\2-BunnyRaidenShogun\RaidenShogunRemapBlend.buf
138
139[RaidenPuppetCommandResourceRemapBlend]
140type = Buffer
141stride = 32
142filename = Dont\Use\If\Statements\Or\SubCommands\In\Resource\SectionsRemapBlend.buf
143
144
145; -------------------------------------------------
Code
1import FixRaidenBoss2 as FRB
2
3iniFile = FRB.IniFile("PartiallyFixedRaiden.ini")
4iniFile.removeFix()
Result
1[Constants]
2global persist $swapvar = 0
3global persist $swapvarn = 0
4global persist $swapmain = 0
5global persist $swapoffice = 0
6global persist $swapglasses = 0
7
8[KeyVar]
9condition = $active == 1
10key = VK_DOWN
11type = cycle
12$swapvar = 0,1,2
13
14[KeyIntoTheHole]
15condition = $active == 1
16key = VK_RIGHT
17type = cycle
18$swapvarn = 0,1
19
20; The top part is not really important, so I not going to finish
21; typing all the key swaps... 😋
22;
23; The bottom part is what the fix actually cares about
24
25[TextureOverrideRaidenShogunBlend]
26run = CommandListRaidenShogunBlend
27handling = skip
28draw = 21916,0
29
30[CommandListRaidenShogunBlend]
31if $swapmain == 0
32 if $swapvar == 0 && $swapvarn == 0
33 vb1 = ResourceRaidenShogunBlend.0
34 else
35 vb1 = ResourceEiBlendsHerBlenderInsteadOfHerSmoothie
36 endif
37else if $swapmain == 1
38 run = SubSubTextureOverride
39endif
40
41[SubSubTextureOverride]
42if $swapoffice == 0 && $swapglasses == 0
43 vb1 = GIMINeedsResourcesToAllStartWithResource
44endif
45
46[ResourceRaidenShogunBlend.0]
47type = Buffer
48stride = 32
49filename = ..\..\..\../../../../../../2-BunnyRaidenShogun\RaidenShogunBlend.buf
50
51[ResourceEiBlendsHerBlenderInsteadOfHerSmoothie]
52type = Buffer
53stride = 32
54if $swapmain == 1
55 filename = M:\AnotherDrive\CuteLittleEi.buf
56else
57 run = RaidenPuppetCommandResource
58endif
59
60[GIMINeedsResourcesToAllStartWithResource]
61type = Buffer
62stride = 32
63filename = ./../AAA/BBBB\CCCCCC\DDDDDRemapBlend.buf
64
65[RaidenPuppetCommandResource]
66type = Buffer
67stride = 32
68filename = ./Dont/Use\If/Statements\Or/SubCommands\In/Resource\Sections.buf
69
70; ------ some lines originally generated from the fix ---------
71
72; --------------------------------------------------------------
Remove a Fix from a .ini File Given Only a String Containing the Content of the File
Input
1showWackyRaidenIniTxtWithFix = r"""
2[Constants]
3global persist $swapvar = 0
4global persist $swapvarn = 0
5global persist $swapmain = 0
6global persist $swapoffice = 0
7global persist $swapglasses = 0
8
9[KeyVar]
10condition = $active == 1
11key = VK_DOWN
12type = cycle
13$swapvar = 0,1,2
14
15[KeyIntoTheHole]
16condition = $active == 1
17key = VK_RIGHT
18type = cycle
19$swapvarn = 0,1
20
21; The top part is not really important, so I not going to finish
22; typing all the key swaps... 😋
23;
24; The bottom part is what the fix actually cares about
25
26[TextureOverrideRaidenShogunBlend]
27run = CommandListRaidenShogunBlend
28handling = skip
29draw = 21916,0
30
31[CommandListRaidenShogunBlend]
32if $swapmain == 0
33 if $swapvar == 0 && $swapvarn == 0
34 vb1 = ResourceRaidenShogunBlend.0
35 else
36 vb1 = ResourceEiBlendsHerBlenderInsteadOfHerSmoothie
37 endif
38else if $swapmain == 1
39 run = SubSubTextureOverride
40endif
41
42[SubSubTextureOverride]
43if $swapoffice == 0 && $swapglasses == 0
44 vb1 = GIMINeedsResourcesToAllStartWithResource
45endif
46
47[ResourceRaidenShogunBlend.0]
48type = Buffer
49stride = 32
50filename = ..\..\..\../../../../../../2-BunnyRaidenShogun\RaidenShogunBlend.buf
51
52[ResourceEiBlendsHerBlenderInsteadOfHerSmoothie]
53type = Buffer
54stride = 32
55if $swapmain == 1
56 filename = M:\AnotherDrive\CuteLittleEi.buf
57else
58 run = RaidenPuppetCommandResource
59endif
60
61[GIMINeedsResourcesToAllStartWithResource]
62type = Buffer
63stride = 32
64filename = ./../AAA/BBBB\CCCCCC\DDDDDRemapBlend.buf
65
66[RaidenPuppetCommandResource]
67type = Buffer
68stride = 32
69filename = ./Dont/Use\If/Statements\Or/SubCommands\In/Resource\Sections.buf
70
71; ------ some lines originally generated from the fix ---------
72
73[ResourceEiBlendsHerRemapBlenderInsteadOfHerSmoothie]
74type = Buffer
75stride = 32
76if $swapmain == 1
77 filename = M:\AnotherDrive\CuteLittleEiRemapBlend.buf
78else
79 run = RaidenPuppetCommandResourceRemapBlend
80endif
81
82[ResourceRaidenShogunRemapBlend.0]
83type = Buffer
84stride = 32
85filename = ..\..\..\..\..\..\..\..\..\2-BunnyRaidenShogun\RaidenShogunRemapBlend.buf
86
87[RaidenPuppetCommandResourceRemapBlend]
88type = Buffer
89stride = 32
90filename = Dont\Use\If\Statements\Or\SubCommands\In\Resource\SectionsRemapBlend.buf
91
92; --------------------------------------------------------------
93
94
95; --------------- Raiden Boss Fix -----------------
96; Raiden boss fixed by NK#1321 if you used it for fix your raiden pls give credit for "Nhok0169"
97; Thank nguen#2011 SilentNightSound#7430 HazrateGolabi#1364 and Albert Gold#2696 for support
98
99[TextureOverrideRaidenShogunRemapBlend]
100run = CommandListRaidenShogunRemapBlend
101handling = skip
102draw = 21916,0
103
104[CommandListRaidenShogunRemapBlend]
105if $swapmain == 0
106 if $swapvar == 0 && $swapvarn == 0
107 vb1 = ResourceRaidenShogunRemapBlend.0
108 else
109 vb1 = ResourceEiBlendsHerRemapBlenderInsteadOfHerSmoothie
110 endif
111else if $swapmain == 1
112 run = SubSubTextureOverrideRemapBlend
113endif
114
115[SubSubTextureOverrideRemapBlend]
116if $swapoffice == 0 && $swapglasses == 0
117 vb1 = ResourceGIMINeedsResourcesToAllStartWithResourceRemapBlend
118endif
119
120
121[GIMINeedsResourcesToAllStartWithResourceRemapBlend]
122type = Buffer
123stride = 32
124filename = ..\AAA\BBBB\CCCCCC\DDDDDRemapRemapBlend.buf
125
126[ResourceEiBlendsHerRemapBlenderInsteadOfHerSmoothie]
127type = Buffer
128stride = 32
129if $swapmain == 1
130 filename = M:\AnotherDrive\CuteLittleEiRemapBlend.buf
131else
132 run = RaidenPuppetCommandResourceRemapBlend
133endif
134
135[ResourceRaidenShogunRemapBlend.0]
136type = Buffer
137stride = 32
138filename = ..\..\..\..\..\..\..\..\..\2-BunnyRaidenShogun\RaidenShogunRemapBlend.buf
139
140[RaidenPuppetCommandResourceRemapBlend]
141type = Buffer
142stride = 32
143filename = Dont\Use\If\Statements\Or\SubCommands\In\Resource\SectionsRemapBlend.buf
144
145
146; -------------------------------------------------
147"""
Code
148import FixRaidenBoss2 as FRB
149
150iniFile = FRB.IniFile(txt = showWackyRaidenIniTxtWithFix)
151fixCode = iniFile.removeFix()
152
153print(fixCode)
Result
1[Constants]
2global persist $swapvar = 0
3global persist $swapvarn = 0
4global persist $swapmain = 0
5global persist $swapoffice = 0
6global persist $swapglasses = 0
7
8[KeyVar]
9condition = $active == 1
10key = VK_DOWN
11type = cycle
12$swapvar = 0,1,2
13
14[KeyIntoTheHole]
15condition = $active == 1
16key = VK_RIGHT
17type = cycle
18$swapvarn = 0,1
19
20; The top part is not really important, so I not going to finish
21; typing all the key swaps... 😋
22;
23; The bottom part is what the fix actually cares about
24
25[TextureOverrideRaidenShogunBlend]
26run = CommandListRaidenShogunBlend
27handling = skip
28draw = 21916,0
29
30[CommandListRaidenShogunBlend]
31if $swapmain == 0
32 if $swapvar == 0 && $swapvarn == 0
33 vb1 = ResourceRaidenShogunBlend.0
34 else
35 vb1 = ResourceEiBlendsHerBlenderInsteadOfHerSmoothie
36 endif
37else if $swapmain == 1
38 run = SubSubTextureOverride
39endif
40
41[SubSubTextureOverride]
42if $swapoffice == 0 && $swapglasses == 0
43 vb1 = GIMINeedsResourcesToAllStartWithResource
44endif
45
46[ResourceRaidenShogunBlend.0]
47type = Buffer
48stride = 32
49filename = ..\..\..\../../../../../../2-BunnyRaidenShogun\RaidenShogunBlend.buf
50
51[ResourceEiBlendsHerBlenderInsteadOfHerSmoothie]
52type = Buffer
53stride = 32
54if $swapmain == 1
55 filename = M:\AnotherDrive\CuteLittleEi.buf
56else
57 run = RaidenPuppetCommandResource
58endif
59
60[GIMINeedsResourcesToAllStartWithResource]
61type = Buffer
62stride = 32
63filename = ./../AAA/BBBB\CCCCCC\DDDDDRemapBlend.buf
64
65[RaidenPuppetCommandResource]
66type = Buffer
67stride = 32
68filename = ./Dont/Use\If/Statements\Or/SubCommands\In/Resource\Sections.buf
69
70; ------ some lines originally generated from the fix ---------
71
72; --------------------------------------------------------------
Fix a .ini File Given the File Path
This example is the combined result of these 2 examples:
Input
1[Constants]
2global persist $swapvar = 0
3global persist $swapvarn = 0
4global persist $swapmain = 0
5global persist $swapoffice = 0
6global persist $swapglasses = 0
7
8[KeyVar]
9condition = $active == 1
10key = VK_DOWN
11type = cycle
12$swapvar = 0,1,2
13
14[KeyIntoTheHole]
15condition = $active == 1
16key = VK_RIGHT
17type = cycle
18$swapvarn = 0,1
19
20; The top part is not really important, so I not going to finish
21; typing all the key swaps... 😋
22;
23; The bottom part is what the fix actually cares about
24
25[TextureOverrideRaidenShogunBlend]
26run = CommandListRaidenShogunBlend
27handling = skip
28draw = 21916,0
29
30[CommandListRaidenShogunBlend]
31if $swapmain == 0
32 if $swapvar == 0 && $swapvarn == 0
33 vb1 = ResourceRaidenShogunBlend.0
34 else
35 vb1 = ResourceEiBlendsHerBlenderInsteadOfHerSmoothie
36 endif
37else if $swapmain == 1
38 run = SubSubTextureOverride
39endif
40
41[SubSubTextureOverride]
42if $swapoffice == 0 && $swapglasses == 0
43 vb1 = GIMINeedsResourcesToAllStartWithResource
44endif
45
46[ResourceRaidenShogunBlend.0]
47type = Buffer
48stride = 32
49filename = ..\..\..\../../../../../../2-BunnyRaidenShogun\RaidenShogunBlend.buf
50
51[ResourceEiBlendsHerBlenderInsteadOfHerSmoothie]
52type = Buffer
53stride = 32
54if $swapmain == 1
55 filename = M:\AnotherDrive\CuteLittleEi.buf
56else
57 run = RaidenPuppetCommandResource
58endif
59
60[GIMINeedsResourcesToAllStartWithResource]
61type = Buffer
62stride = 32
63filename = ./../AAA/BBBB\CCCCCC\DDDDDRemapBlend.buf
64
65[RaidenPuppetCommandResource]
66type = Buffer
67stride = 32
68filename = ./Dont/Use\If/Statements\Or/SubCommands\In/Resource\Sections.buf
69
70; ------ some lines originally generated from the fix ---------
71
72[ResourceEiBlendsHerRemapBlenderInsteadOfHerSmoothie]
73type = Buffer
74stride = 32
75if $swapmain == 1
76 filename = M:\AnotherDrive\CuteLittleEiRemapBlend.buf
77else
78 run = RaidenPuppetCommandResourceRemapBlend
79endif
80
81[ResourceRaidenShogunRemapBlend.0]
82type = Buffer
83stride = 32
84filename = ..\..\..\..\..\..\..\..\..\2-BunnyRaidenShogun\RaidenShogunRemapBlend.buf
85
86[RaidenPuppetCommandResourceRemapBlend]
87type = Buffer
88stride = 32
89filename = Dont\Use\If\Statements\Or\SubCommands\In\Resource\SectionsRemapBlend.buf
90
91; --------------------------------------------------------------
92
93
94; --------------- Raiden Boss Fix -----------------
95; Raiden boss fixed by NK#1321 if you used it for fix your raiden pls give credit for "Nhok0169"
96; Thank nguen#2011 SilentNightSound#7430 HazrateGolabi#1364 and Albert Gold#2696 for support
97
98[TextureOverrideRaidenShogunRemapBlend]
99run = CommandListRaidenShogunRemapBlend
100handling = skip
101draw = 21916,0
102
103[CommandListRaidenShogunRemapBlend]
104if $swapmain == 0
105 if $swapvar == 0 && $swapvarn == 0
106 vb1 = ResourceRaidenShogunRemapBlend.0
107 else
108 vb1 = ResourceEiBlendsHerRemapBlenderInsteadOfHerSmoothie
109 endif
110else if $swapmain == 1
111 run = SubSubTextureOverrideRemapBlend
112endif
113
114[SubSubTextureOverrideRemapBlend]
115if $swapoffice == 0 && $swapglasses == 0
116 vb1 = ResourceGIMINeedsResourcesToAllStartWithResourceRemapBlend
117endif
118
119
120[GIMINeedsResourcesToAllStartWithResourceRemapBlend]
121type = Buffer
122stride = 32
123filename = ..\AAA\BBBB\CCCCCC\DDDDDRemapRemapBlend.buf
124
125[ResourceEiBlendsHerRemapBlenderInsteadOfHerSmoothie]
126type = Buffer
127stride = 32
128if $swapmain == 1
129 filename = M:\AnotherDrive\CuteLittleEiRemapBlend.buf
130else
131 run = RaidenPuppetCommandResourceRemapBlend
132endif
133
134[ResourceRaidenShogunRemapBlend.0]
135type = Buffer
136stride = 32
137filename = ..\..\..\..\..\..\..\..\..\2-BunnyRaidenShogun\RaidenShogunRemapBlend.buf
138
139[RaidenPuppetCommandResourceRemapBlend]
140type = Buffer
141stride = 32
142filename = Dont\Use\If\Statements\Or\SubCommands\In\Resource\SectionsRemapBlend.buf
143
144
145; -------------------------------------------------
Code
1import FixRaidenBoss2 as FRB
2
3iniFile = FRB.IniFile("PartiallyFixedRaiden.ini")
4iniFile.removeFix()
5iniFile.parse()
6iniFile.fix()
Result
1[Constants]
2global persist $swapvar = 0
3global persist $swapvarn = 0
4global persist $swapmain = 0
5global persist $swapoffice = 0
6global persist $swapglasses = 0
7
8[KeyVar]
9condition = $active == 1
10key = VK_DOWN
11type = cycle
12$swapvar = 0,1,2
13
14[KeyIntoTheHole]
15condition = $active == 1
16key = VK_RIGHT
17type = cycle
18$swapvarn = 0,1
19
20; The top part is not really important, so I not going to finish
21; typing all the key swaps... 😋
22;
23; The bottom part is what the fix actually cares about
24
25[TextureOverrideRaidenShogunBlend]
26run = CommandListRaidenShogunBlend
27handling = skip
28draw = 21916,0
29
30[CommandListRaidenShogunBlend]
31if $swapmain == 0
32 if $swapvar == 0 && $swapvarn == 0
33 vb1 = ResourceRaidenShogunBlend.0
34 else
35 vb1 = ResourceEiBlendsHerBlenderInsteadOfHerSmoothie
36 endif
37else if $swapmain == 1
38 run = SubSubTextureOverride
39endif
40
41[SubSubTextureOverride]
42if $swapoffice == 0 && $swapglasses == 0
43 vb1 = GIMINeedsResourcesToAllStartWithResource
44endif
45
46[ResourceRaidenShogunBlend.0]
47type = Buffer
48stride = 32
49filename = ..\..\..\../../../../../../2-BunnyRaidenShogun\RaidenShogunBlend.buf
50
51[ResourceEiBlendsHerBlenderInsteadOfHerSmoothie]
52type = Buffer
53stride = 32
54if $swapmain == 1
55 filename = M:\AnotherDrive\CuteLittleEi.buf
56else
57 run = RaidenPuppetCommandResource
58endif
59
60[GIMINeedsResourcesToAllStartWithResource]
61type = Buffer
62stride = 32
63filename = ./../AAA/BBBB\CCCCCC\DDDDDRemapBlend.buf
64
65[RaidenPuppetCommandResource]
66type = Buffer
67stride = 32
68filename = ./Dont/Use\If/Statements\Or/SubCommands\In/Resource\Sections.buf
69
70; ------ some lines originally generated from the fix ---------
71
72; --------------------------------------------------------------
73
74
75; --------------- Raiden Boss Fix -----------------
76; Raiden boss fixed by NK#1321 if you used it for fix your raiden pls give credit for "Nhok0169"
77; Thank nguen#2011 SilentNightSound#7430 HazrateGolabi#1364 and Albert Gold#2696 for support
78
79[TextureOverrideRaidenShogunRemapBlend]
80run = CommandListRaidenShogunRemapBlend
81handling = skip
82draw = 21916,0
83
84[CommandListRaidenShogunRemapBlend]
85if $swapmain == 0
86 if $swapvar == 0 && $swapvarn == 0
87 vb1 = ResourceRaidenShogunRemapBlend.0
88 else
89 vb1 = ResourceEiBlendsHerRemapBlenderInsteadOfHerSmoothie
90 endif
91else if $swapmain == 1
92 run = SubSubTextureOverrideRemapBlend
93endif
94
95[SubSubTextureOverrideRemapBlend]
96if $swapoffice == 0 && $swapglasses == 0
97 vb1 = ResourceGIMINeedsResourcesToAllStartWithResourceRemapBlend
98endif
99
100
101[ResourceEiBlendsHerRemapBlenderInsteadOfHerSmoothie]
102type = Buffer
103stride = 32
104if $swapmain == 1
105 filename = M:\AnotherDrive\CuteLittleEiRemapBlend.buf
106else
107 run = RaidenPuppetCommandResourceRemapBlend
108endif
109
110[GIMINeedsResourcesToAllStartWithResourceRemapBlend]
111type = Buffer
112stride = 32
113filename = ..\AAA\BBBB\CCCCCC\DDDDDRemapRemapBlend.buf
114
115[ResourceRaidenShogunRemapBlend.0]
116type = Buffer
117stride = 32
118filename = ..\..\..\..\..\..\..\..\..\2-BunnyRaidenShogun\RaidenShogunRemapBlend.buf
119
120[RaidenPuppetCommandResourceRemapBlend]
121type = Buffer
122stride = 32
123filename = Dont\Use\If\Statements\Or\SubCommands\In\Resource\SectionsRemapBlend.buf
124
125
126; -------------------------------------------------
Fix a .ini File Given Only A String Containing the Content of the File
This example is the combined result of these 2 examples:
Only Fix .Ini file Given Only a String Containing the Content of the File
Remove a Fix from a .ini File Given Only a String Containing the Content of the File
Input
1showWackyRaidenIniTxtWithFix = r"""
2[Constants]
3global persist $swapvar = 0
4global persist $swapvarn = 0
5global persist $swapmain = 0
6global persist $swapoffice = 0
7global persist $swapglasses = 0
8
9[KeyVar]
10condition = $active == 1
11key = VK_DOWN
12type = cycle
13$swapvar = 0,1,2
14
15[KeyIntoTheHole]
16condition = $active == 1
17key = VK_RIGHT
18type = cycle
19$swapvarn = 0,1
20
21; The top part is not really important, so I not going to finish
22; typing all the key swaps... 😋
23;
24; The bottom part is what the fix actually cares about
25
26[TextureOverrideRaidenShogunBlend]
27run = CommandListRaidenShogunBlend
28handling = skip
29draw = 21916,0
30
31[CommandListRaidenShogunBlend]
32if $swapmain == 0
33 if $swapvar == 0 && $swapvarn == 0
34 vb1 = ResourceRaidenShogunBlend.0
35 else
36 vb1 = ResourceEiBlendsHerBlenderInsteadOfHerSmoothie
37 endif
38else if $swapmain == 1
39 run = SubSubTextureOverride
40endif
41
42[SubSubTextureOverride]
43if $swapoffice == 0 && $swapglasses == 0
44 vb1 = GIMINeedsResourcesToAllStartWithResource
45endif
46
47[ResourceRaidenShogunBlend.0]
48type = Buffer
49stride = 32
50filename = ..\..\..\../../../../../../2-BunnyRaidenShogun\RaidenShogunBlend.buf
51
52[ResourceEiBlendsHerBlenderInsteadOfHerSmoothie]
53type = Buffer
54stride = 32
55if $swapmain == 1
56 filename = M:\AnotherDrive\CuteLittleEi.buf
57else
58 run = RaidenPuppetCommandResource
59endif
60
61[GIMINeedsResourcesToAllStartWithResource]
62type = Buffer
63stride = 32
64filename = ./../AAA/BBBB\CCCCCC\DDDDDRemapBlend.buf
65
66[RaidenPuppetCommandResource]
67type = Buffer
68stride = 32
69filename = ./Dont/Use\If/Statements\Or/SubCommands\In/Resource\Sections.buf
70
71; ------ some lines originally generated from the fix ---------
72
73[ResourceEiBlendsHerRemapBlenderInsteadOfHerSmoothie]
74type = Buffer
75stride = 32
76if $swapmain == 1
77 filename = M:\AnotherDrive\CuteLittleEiRemapBlend.buf
78else
79 run = RaidenPuppetCommandResourceRemapBlend
80endif
81
82[ResourceRaidenShogunRemapBlend.0]
83type = Buffer
84stride = 32
85filename = ..\..\..\..\..\..\..\..\..\2-BunnyRaidenShogun\RaidenShogunRemapBlend.buf
86
87[RaidenPuppetCommandResourceRemapBlend]
88type = Buffer
89stride = 32
90filename = Dont\Use\If\Statements\Or\SubCommands\In\Resource\SectionsRemapBlend.buf
91
92; --------------------------------------------------------------
93
94
95; --------------- Raiden Boss Fix -----------------
96; Raiden boss fixed by NK#1321 if you used it for fix your raiden pls give credit for "Nhok0169"
97; Thank nguen#2011 SilentNightSound#7430 HazrateGolabi#1364 and Albert Gold#2696 for support
98
99[TextureOverrideRaidenShogunRemapBlend]
100run = CommandListRaidenShogunRemapBlend
101handling = skip
102draw = 21916,0
103
104[CommandListRaidenShogunRemapBlend]
105if $swapmain == 0
106 if $swapvar == 0 && $swapvarn == 0
107 vb1 = ResourceRaidenShogunRemapBlend.0
108 else
109 vb1 = ResourceEiBlendsHerRemapBlenderInsteadOfHerSmoothie
110 endif
111else if $swapmain == 1
112 run = SubSubTextureOverrideRemapBlend
113endif
114
115[SubSubTextureOverrideRemapBlend]
116if $swapoffice == 0 && $swapglasses == 0
117 vb1 = ResourceGIMINeedsResourcesToAllStartWithResourceRemapBlend
118endif
119
120
121[GIMINeedsResourcesToAllStartWithResourceRemapBlend]
122type = Buffer
123stride = 32
124filename = ..\AAA\BBBB\CCCCCC\DDDDDRemapRemapBlend.buf
125
126[ResourceEiBlendsHerRemapBlenderInsteadOfHerSmoothie]
127type = Buffer
128stride = 32
129if $swapmain == 1
130 filename = M:\AnotherDrive\CuteLittleEiRemapBlend.buf
131else
132 run = RaidenPuppetCommandResourceRemapBlend
133endif
134
135[ResourceRaidenShogunRemapBlend.0]
136type = Buffer
137stride = 32
138filename = ..\..\..\..\..\..\..\..\..\2-BunnyRaidenShogun\RaidenShogunRemapBlend.buf
139
140[RaidenPuppetCommandResourceRemapBlend]
141type = Buffer
142stride = 32
143filename = Dont\Use\If\Statements\Or\SubCommands\In\Resource\SectionsRemapBlend.buf
144
145
146; -------------------------------------------------
147"""
Code
148import FixRaidenBoss2 as FRB
149
150iniFile = FRB.IniFile(txt = showWackyRaidenIniTxtWithFix)
151iniFile.removeFix()
152iniFile.parse()
153fixResult = iniFile.fix()
154
155print(fixResult)
Result
1[Constants]
2global persist $swapvar = 0
3global persist $swapvarn = 0
4global persist $swapmain = 0
5global persist $swapoffice = 0
6global persist $swapglasses = 0
7
8[KeyVar]
9condition = $active == 1
10key = VK_DOWN
11type = cycle
12$swapvar = 0,1,2
13
14[KeyIntoTheHole]
15condition = $active == 1
16key = VK_RIGHT
17type = cycle
18$swapvarn = 0,1
19
20; The top part is not really important, so I not going to finish
21; typing all the key swaps... 😋
22;
23; The bottom part is what the fix actually cares about
24
25[TextureOverrideRaidenShogunBlend]
26run = CommandListRaidenShogunBlend
27handling = skip
28draw = 21916,0
29
30[CommandListRaidenShogunBlend]
31if $swapmain == 0
32 if $swapvar == 0 && $swapvarn == 0
33 vb1 = ResourceRaidenShogunBlend.0
34 else
35 vb1 = ResourceEiBlendsHerBlenderInsteadOfHerSmoothie
36 endif
37else if $swapmain == 1
38 run = SubSubTextureOverride
39endif
40
41[SubSubTextureOverride]
42if $swapoffice == 0 && $swapglasses == 0
43 vb1 = GIMINeedsResourcesToAllStartWithResource
44endif
45
46[ResourceRaidenShogunBlend.0]
47type = Buffer
48stride = 32
49filename = ..\..\..\../../../../../../2-BunnyRaidenShogun\RaidenShogunBlend.buf
50
51[ResourceEiBlendsHerBlenderInsteadOfHerSmoothie]
52type = Buffer
53stride = 32
54if $swapmain == 1
55 filename = M:\AnotherDrive\CuteLittleEi.buf
56else
57 run = RaidenPuppetCommandResource
58endif
59
60[GIMINeedsResourcesToAllStartWithResource]
61type = Buffer
62stride = 32
63filename = ./../AAA/BBBB\CCCCCC\DDDDDRemapBlend.buf
64
65[RaidenPuppetCommandResource]
66type = Buffer
67stride = 32
68filename = ./Dont/Use\If/Statements\Or/SubCommands\In/Resource\Sections.buf
69
70; ------ some lines originally generated from the fix ---------
71
72; --------------------------------------------------------------
73
74
75; --------------- Raiden Boss Fix -----------------
76; Raiden boss fixed by NK#1321 if you used it for fix your raiden pls give credit for "Nhok0169"
77; Thank nguen#2011 SilentNightSound#7430 HazrateGolabi#1364 and Albert Gold#2696 for support
78
79[TextureOverrideRaidenShogunRemapBlend]
80run = CommandListRaidenShogunRemapBlend
81handling = skip
82draw = 21916,0
83
84[CommandListRaidenShogunRemapBlend]
85if $swapmain == 0
86 if $swapvar == 0 && $swapvarn == 0
87 vb1 = ResourceRaidenShogunRemapBlend.0
88 else
89 vb1 = ResourceEiBlendsHerRemapBlenderInsteadOfHerSmoothie
90 endif
91else if $swapmain == 1
92 run = SubSubTextureOverrideRemapBlend
93endif
94
95[SubSubTextureOverrideRemapBlend]
96if $swapoffice == 0 && $swapglasses == 0
97 vb1 = ResourceGIMINeedsResourcesToAllStartWithResourceRemapBlend
98endif
99
100
101[ResourceEiBlendsHerRemapBlenderInsteadOfHerSmoothie]
102type = Buffer
103stride = 32
104if $swapmain == 1
105 filename = M:\AnotherDrive\CuteLittleEiRemapBlend.buf
106else
107 run = RaidenPuppetCommandResourceRemapBlend
108endif
109
110[GIMINeedsResourcesToAllStartWithResourceRemapBlend]
111type = Buffer
112stride = 32
113filename = ..\AAA\BBBB\CCCCCC\DDDDDRemapRemapBlend.buf
114
115[ResourceRaidenShogunRemapBlend.0]
116type = Buffer
117stride = 32
118filename = ..\..\..\..\..\..\..\..\..\2-BunnyRaidenShogun\RaidenShogunRemapBlend.buf
119
120[RaidenPuppetCommandResourceRemapBlend]
121type = Buffer
122stride = 32
123filename = Dont\Use\If\Statements\Or\SubCommands\In\Resource\SectionsRemapBlend.buf
124
125
126; -------------------------------------------------
Fixing Blend.buf Files
Below are different ways of fixing either:
A single .*Blend.buf file
ORThe content contained in a single .*Blend.buf file
Get a New and Fixed Blend.buf file Given the File path to an Existing Blend.buf File
This example will make the fixed Blend.buf and put it in the same folder where the program is ran
Input
assume we have this file structure and we are running from a file called example.py
RaidenShogun
|
+--> LittleEiBlend.buf
|
+--> Mod
|
+--> example.py
Code
1import FixRaidenBoss2 as FRB
2
3FRB.Mod.blendCorrection("../LittleEiBlend.buf", "PuppetEiGotRemapped.buf")
Result
A new .buf file called PuppetEiGotRemapped.buf is created that includes the fix to LittleEiBlend.buf
RaidenShogun
|
+--> LittleEiBlend.buf
|
+--> Mod
|
+--> example.py
|
+--> PuppetEiGotRemapped.buf
Create the Bytes to the Fixed Blend.buf File Given the Bytes of the Existing Blend.buf File
This example will make the fixed Blend.buf and put it in the same folder where the program is ran
Input
assume we have this file structure and we are running from a file called example.py
RaidenShogun
|
+--> LittleEiBlend.buf
|
+--> Mod
|
+--> example.py
assume example.py first reads in the bytes from LittleEiBlend.buf
1inputBytes = None
2with open("../LittleEiBlend.buf", "rb") as f:
3 inputBytes = f.read()
Code
4import FixRaidenBoss2 as FRB
5
6fixedBytes = FRB.Mod.blendCorrection(inputBytes)
7print(fixedBytes)
Result
The bytes that fixes LittleEiBlend.buf
Fixing Entire Mods
The below examples simulate executing the entire script, but through the API
Fixing Many Mods
In this example, by running the program called example.py, the fix will start from the RaidenShogun/Mod folder and will:
Undo previous changes created by the fix
Fix all the files related to mods
Note
We set the verbose parmeter to False to not print out the usual logging text when you run the script.
If you want to print out the logging text, set verbose to True
Input
Assume we have this file structure:
File Structure
RaidenShogun
|
+--> AnotherSubTree
| |
| +--> someFolder
| |
| +--> disconnectedSubTree.ini
|
+--> Mod
| |
| +--> folder
| | |
| | +--> folderInFolder
| | |
| | +--> BlendToDisconnectedSubTree.buf
| | |
| | +--> BlendToDisconnectedSubTree2.buf
| |
| +--> folder2
| | |
| | +--> folderInFolder2
| | |
| | +--> AnotherFolder
| | |
| | +--> disconnectedSubTree2.ini
| |
| +--> pythonScript
| | |
| | +--> Run
| | |
| | +--> example.py
| |
| +--> ei.ini
| |
| +--> ei2.ini
| |
| +--> RaidenShogunBlend.buf
|
+--> ParentNodeBlend.buf
Assume below are the content for each .ini file
ei.ini
1[Constants]
2global persist $swapvar = 0
3
4[KeySwap]
5condition = $active == 1
6key = VK_DOWN
7type = cycle
8$swapvar = 0,1
9$creditinfo = 0
10
11
12[TextureOverrideRaidenShogunBlend]
13if $swapvar == 0
14 vb1 = ResourceRaidenShogunBlend.0
15 handling = skip
16 draw = 21916,0
17else if $swapvar == 1
18 vb1 = ResourceRaidenShogunBlend.1
19 handling = skip
20 draw = 21916,0
21endif
22
23[ResourceRaidenShogunBlend.0]
24type = Buffer
25stride = 32
26filename = RaidenShogunBlend.buf
27
28[ResourceRaidenShogunBlend.1]
29type = Buffer
30stride = 32
31filename = ../ParentNodeBlend.buf
ei2.ini
1[TextureOverrideRaidenShogunBlend]
2vb1 = ResourceRaidenShogunBlend
3handling = skip
4draw = 21916,0
5
6[ResourceRaidenShogunBlend]
7type = Buffer
8stride = 32
9filename = RaidenShogunBlend.buf
disconnectedSubTree.ini
1[TextureOverrideRaidenShogunBlend]
2vb1 = ResourceRaidenShogunBlend
3handling = skip
4draw = 21916,0
5
6[ResourceRaidenShogunBlend]
7type = Buffer
8stride = 32
9filename = ../../Mod/folder/folderInFolder/BlendToDisconnectedSubTree.buf
disconnectedSubTree2.ini
1[TextureOverrideRaidenShogunBlend]
2vb1 = ResourceRaidenShogunBlend
3handling = skip
4draw = 21916,0
5
6[ResourceRaidenShogunBlend]
7type = Buffer
8stride = 32
9filename = ../../../folder/folderInFolder/BlendToDisconnectedSubTree2.buf
Code
1import FixRaidenBoss2 as FRB
2
3fixService = FRB.RaidenBossFixService(path = "../../", verbose = False, keepBackups = False)
4fixService.fix()
Result
Contains the fixed files for the mods.
New File Structure:
File Strucuture
RaidenShogun
|
+--> AnotherSubTree
| |
| +--> someFolder
| |
| +--> disconnectedSubTree.ini
|
+--> Mod
| |
| +--> folder
| | |
| | +--> folderInFolder
| | |
| | +--> BlendToDisconnectedSubTree.buf
| | |
| | +--> BlendToDisconnectedSubTree2.buf
| | |
| | +--> RemapBlendToDisconnectedSubTree.buf
| | |
| | +--> RemapBlendToDisconnectedSubTree2.buf
| |
| +--> folder2
| | |
| | +--> folderInFolder2
| | |
| | +--> AnotherFolder
| | |
| | +--> disconnectedSubTree2.ini
| |
| +--> pythonScript
| | |
| | +--> Run
| | |
| | +--> example.py
| |
| +--> ei.ini
| |
| +--> ei2.ini
| |
| +--> RaidenShogunBlend.buf
| |
| +--> RaidenShogunRemapBlend.buf
|
+--> ParentNodeBlend.buf
|
+--> ParentNodeRemapBlend.buf
Below contains the new content of the fixed.ini files:
ei.ini
1[Constants]
2global persist $swapvar = 0
3
4[KeySwap]
5condition = $active == 1
6key = VK_DOWN
7type = cycle
8$swapvar = 0,1
9$creditinfo = 0
10
11
12[TextureOverrideRaidenShogunBlend]
13if $swapvar == 0
14 vb1 = ResourceRaidenShogunBlend.0
15 handling = skip
16 draw = 21916,0
17else if $swapvar == 1
18 vb1 = ResourceRaidenShogunBlend.1
19 handling = skip
20 draw = 21916,0
21endif
22
23[ResourceRaidenShogunBlend.0]
24type = Buffer
25stride = 32
26filename = RaidenShogunBlend.buf
27
28[ResourceRaidenShogunBlend.1]
29type = Buffer
30stride = 32
31filename = ../ParentNodeBlend.buf
32
33
34; --------------- Raiden Boss Fix -----------------
35; Raiden boss fixed by NK#1321 if you used it for fix your raiden pls give credit for "Nhok0169"
36; Thank nguen#2011 SilentNightSound#7430 HazrateGolabi#1364 and Albert Gold#2696 for support
37
38[TextureOverrideRaidenShogunRemapBlend]
39if $swapvar == 0
40 vb1 = ResourceRaidenShogunRemapBlend.0
41 handling = skip
42 draw = 21916,0
43else if $swapvar == 1
44 vb1 = ResourceRaidenShogunRemapBlend.1
45 handling = skip
46 draw = 21916,0
47endif
48
49
50[ResourceRaidenShogunRemapBlend.0]
51type = Buffer
52stride = 32
53filename = RaidenShogunRemapBlend.buf
54
55[ResourceRaidenShogunRemapBlend.1]
56type = Buffer
57stride = 32
58filename = ..\ParentNodeRemapBlend.buf
59
60
61; -------------------------------------------------
ei2.ini
1[TextureOverrideRaidenShogunBlend]
2vb1 = ResourceRaidenShogunBlend
3handling = skip
4draw = 21916,0
5
6[ResourceRaidenShogunBlend]
7type = Buffer
8stride = 32
9filename = RaidenShogunBlend.buf
10
11
12; --------------- Raiden Boss Fix -----------------
13; Raiden boss fixed by NK#1321 if you used it for fix your raiden pls give credit for "Nhok0169"
14; Thank nguen#2011 SilentNightSound#7430 HazrateGolabi#1364 and Albert Gold#2696 for support
15
16[TextureOverrideRaidenShogunRemapBlend]
17vb1 = ResourceRaidenShogunRemapBlend
18handling = skip
19draw = 21916,0
20
21
22[ResourceRaidenShogunRemapBlend]
23type = Buffer
24stride = 32
25filename = RaidenShogunRemapBlend.buf
26
27
28; -------------------------------------------------
disconnectedSubTree.ini
1[TextureOverrideRaidenShogunBlend]
2vb1 = ResourceRaidenShogunBlend
3handling = skip
4draw = 21916,0
5
6[ResourceRaidenShogunBlend]
7type = Buffer
8stride = 32
9filename = ../../Mod/folder/folderInFolder/BlendToDisconnectedSubTree.buf
10
11
12; --------------- Raiden Boss Fix -----------------
13; Raiden boss fixed by NK#1321 if you used it for fix your raiden pls give credit for "Nhok0169"
14; Thank nguen#2011 SilentNightSound#7430 HazrateGolabi#1364 and Albert Gold#2696 for support
15
16[TextureOverrideRaidenShogunRemapBlend]
17vb1 = ResourceRaidenShogunRemapBlend
18handling = skip
19draw = 21916,0
20
21
22[ResourceRaidenShogunRemapBlend]
23type = Buffer
24stride = 32
25filename = ..\..\Mod\folder\folderInFolder\RemapBlendToDisconnectedSubTree.buf
26
27
28; -------------------------------------------------
disconnectedSubTree2.ini
1[TextureOverrideRaidenShogunBlend]
2vb1 = ResourceRaidenShogunBlend
3handling = skip
4draw = 21916,0
5
6[ResourceRaidenShogunBlend]
7type = Buffer
8stride = 32
9filename = ../../../folder/folderInFolder/BlendToDisconnectedSubTree2.buf
10
11
12; --------------- Raiden Boss Fix -----------------
13; Raiden boss fixed by NK#1321 if you used it for fix your raiden pls give credit for "Nhok0169"
14; Thank nguen#2011 SilentNightSound#7430 HazrateGolabi#1364 and Albert Gold#2696 for support
15
16[TextureOverrideRaidenShogunRemapBlend]
17vb1 = ResourceRaidenShogunRemapBlend
18handling = skip
19draw = 21916,0
20
21
22[ResourceRaidenShogunRemapBlend]
23type = Buffer
24stride = 32
25filename = ..\..\..\folder\folderInFolder\RemapBlendToDisconnectedSubTree2.buf
26
27
28; -------------------------------------------------
Undo the Fix from Many Mods
In this example, by running the program called example.py, the fix will start from the RaidenShogun/Mod folder and undo all previous changes done by the script
Note
We set the verbose parmeter to False to not print out the usual logging text when you run the script.
If you want to print out the logging text, set verbose to True
Input
Assume we have this file structure:
File Strucuture
RaidenShogun
|
+--> AnotherSubTree
| |
| +--> someFolder
| |
| +--> disconnectedSubTree.ini
|
+--> Mod
| |
| +--> folder
| | |
| | +--> folderInFolder
| | |
| | +--> BlendToDisconnectedSubTree.buf
| | |
| | +--> BlendToDisconnectedSubTree2.buf
| | |
| | +--> RemapBlendToDisconnectedSubTree.buf
| | |
| | +--> RemapBlendToDisconnectedSubTree2.buf
| |
| +--> folder2
| | |
| | +--> folderInFolder2
| | |
| | +--> AnotherFolder
| | |
| | +--> disconnectedSubTree2.ini
| |
| +--> pythonScript
| | |
| | +--> Run
| | |
| | +--> example.py
| |
| +--> ei.ini
| |
| +--> ei2.ini
| |
| +--> RaidenShogunBlend.buf
| |
| +--> RaidenShogunRemapBlend.buf
|
+--> ParentNodeBlend.buf
|
+--> ParentNodeRemapBlend.buf
Assume below are the content of each .ini file
ei.ini
1[Constants]
2global persist $swapvar = 0
3
4[KeySwap]
5condition = $active == 1
6key = VK_DOWN
7type = cycle
8$swapvar = 0,1
9$creditinfo = 0
10
11
12[TextureOverrideRaidenShogunBlend]
13if $swapvar == 0
14 vb1 = ResourceRaidenShogunBlend.0
15 handling = skip
16 draw = 21916,0
17else if $swapvar == 1
18 vb1 = ResourceRaidenShogunBlend.1
19 handling = skip
20 draw = 21916,0
21endif
22
23[ResourceRaidenShogunBlend.0]
24type = Buffer
25stride = 32
26filename = RaidenShogunBlend.buf
27
28[ResourceRaidenShogunBlend.1]
29type = Buffer
30stride = 32
31filename = ../ParentNodeBlend.buf
32
33
34; --------------- Raiden Boss Fix -----------------
35; Raiden boss fixed by NK#1321 if you used it for fix your raiden pls give credit for "Nhok0169"
36; Thank nguen#2011 SilentNightSound#7430 HazrateGolabi#1364 and Albert Gold#2696 for support
37
38[TextureOverrideRaidenShogunRemapBlend]
39if $swapvar == 0
40 vb1 = ResourceRaidenShogunRemapBlend.0
41 handling = skip
42 draw = 21916,0
43else if $swapvar == 1
44 vb1 = ResourceRaidenShogunRemapBlend.1
45 handling = skip
46 draw = 21916,0
47endif
48
49
50[ResourceRaidenShogunRemapBlend.0]
51type = Buffer
52stride = 32
53filename = RaidenShogunRemapBlend.buf
54
55[ResourceRaidenShogunRemapBlend.1]
56type = Buffer
57stride = 32
58filename = ..\ParentNodeRemapBlend.buf
59
60
61; -------------------------------------------------
ei2.ini
1[TextureOverrideRaidenShogunBlend]
2vb1 = ResourceRaidenShogunBlend
3handling = skip
4draw = 21916,0
5
6[ResourceRaidenShogunBlend]
7type = Buffer
8stride = 32
9filename = RaidenShogunBlend.buf
10
11
12; --------------- Raiden Boss Fix -----------------
13; Raiden boss fixed by NK#1321 if you used it for fix your raiden pls give credit for "Nhok0169"
14; Thank nguen#2011 SilentNightSound#7430 HazrateGolabi#1364 and Albert Gold#2696 for support
15
16[TextureOverrideRaidenShogunRemapBlend]
17vb1 = ResourceRaidenShogunRemapBlend
18handling = skip
19draw = 21916,0
20
21
22[ResourceRaidenShogunRemapBlend]
23type = Buffer
24stride = 32
25filename = RaidenShogunRemapBlend.buf
26
27
28; -------------------------------------------------
disconnectedSubTree.ini
1[TextureOverrideRaidenShogunBlend]
2vb1 = ResourceRaidenShogunBlend
3handling = skip
4draw = 21916,0
5
6[ResourceRaidenShogunBlend]
7type = Buffer
8stride = 32
9filename = ../../Mod/folder/folderInFolder/BlendToDisconnectedSubTree.buf
10
11
12; --------------- Raiden Boss Fix -----------------
13; Raiden boss fixed by NK#1321 if you used it for fix your raiden pls give credit for "Nhok0169"
14; Thank nguen#2011 SilentNightSound#7430 HazrateGolabi#1364 and Albert Gold#2696 for support
15
16[TextureOverrideRaidenShogunRemapBlend]
17vb1 = ResourceRaidenShogunRemapBlend
18handling = skip
19draw = 21916,0
20
21
22[ResourceRaidenShogunRemapBlend]
23type = Buffer
24stride = 32
25filename = ..\..\Mod\folder\folderInFolder\RemapBlendToDisconnectedSubTree.buf
26
27
28; -------------------------------------------------
disconnectedSubTree2.ini
1[TextureOverrideRaidenShogunBlend]
2vb1 = ResourceRaidenShogunBlend
3handling = skip
4draw = 21916,0
5
6[ResourceRaidenShogunBlend]
7type = Buffer
8stride = 32
9filename = ../../../folder/folderInFolder/BlendToDisconnectedSubTree2.buf
10
11
12; --------------- Raiden Boss Fix -----------------
13; Raiden boss fixed by NK#1321 if you used it for fix your raiden pls give credit for "Nhok0169"
14; Thank nguen#2011 SilentNightSound#7430 HazrateGolabi#1364 and Albert Gold#2696 for support
15
16[TextureOverrideRaidenShogunRemapBlend]
17vb1 = ResourceRaidenShogunRemapBlend
18handling = skip
19draw = 21916,0
20
21
22[ResourceRaidenShogunRemapBlend]
23type = Buffer
24stride = 32
25filename = ..\..\..\folder\folderInFolder\RemapBlendToDisconnectedSubTree2.buf
26
27
28; -------------------------------------------------
Code
1import FixRaidenBoss2 as FRB
2
3fixService =FRB.RaidenBossFixService(path = "../../", verbose = True, keepBackups = False, undoOnly = True)
4fixService.fix()
Result
Below contains the new content with the previous changes made by the script removed
File Structure
RaidenShogun
|
+--> AnotherSubTree
| |
| +--> someFolder
| |
| +--> disconnectedSubTree.ini
|
+--> Mod
| |
| +--> folder
| | |
| | +--> folderInFolder
| | |
| | +--> BlendToDisconnectedSubTree.buf
| | |
| | +--> BlendToDisconnectedSubTree2.buf
| |
| +--> folder2
| | |
| | +--> folderInFolder2
| | |
| | +--> AnotherFolder
| | |
| | +--> disconnectedSubTree2.ini
| |
| +--> pythonScript
| | |
| | +--> Run
| | |
| | +--> example.py
| |
| +--> ei.ini
| |
| +--> ei2.ini
| |
| +--> RaidenShogunBlend.buf
|
+--> ParentNodeBlend.buf
Below is the new content for each .ini file
ei.ini
1[Constants]
2global persist $swapvar = 0
3
4[KeySwap]
5condition = $active == 1
6key = VK_DOWN
7type = cycle
8$swapvar = 0,1
9$creditinfo = 0
10
11
12[TextureOverrideRaidenShogunBlend]
13if $swapvar == 0
14 vb1 = ResourceRaidenShogunBlend.0
15 handling = skip
16 draw = 21916,0
17else if $swapvar == 1
18 vb1 = ResourceRaidenShogunBlend.1
19 handling = skip
20 draw = 21916,0
21endif
22
23[ResourceRaidenShogunBlend.0]
24type = Buffer
25stride = 32
26filename = RaidenShogunBlend.buf
27
28[ResourceRaidenShogunBlend.1]
29type = Buffer
30stride = 32
31filename = ../ParentNodeBlend.buf
ei2.ini
1[TextureOverrideRaidenShogunBlend]
2vb1 = ResourceRaidenShogunBlend
3handling = skip
4draw = 21916,0
5
6[ResourceRaidenShogunBlend]
7type = Buffer
8stride = 32
9filename = RaidenShogunBlend.buf
disconnectedSubTree.ini
1[TextureOverrideRaidenShogunBlend]
2vb1 = ResourceRaidenShogunBlend
3handling = skip
4draw = 21916,0
5
6[ResourceRaidenShogunBlend]
7type = Buffer
8stride = 32
9filename = ../../Mod/folder/folderInFolder/BlendToDisconnectedSubTree.buf
disconnectedSubTree2.ini
1[TextureOverrideRaidenShogunBlend]
2vb1 = ResourceRaidenShogunBlend
3handling = skip
4draw = 21916,0
5
6[ResourceRaidenShogunBlend]
7type = Buffer
8stride = 32
9filename = ../../../folder/folderInFolder/BlendToDisconnectedSubTree2.buf