Hi Ihab
Here you go. I moved the sentence about running the macro to be below the instructions to create it as it confused me when I read it.
Just as an aside, I wouldn't bother with writing a macro to perform an Edit_Replace. Just use the built-in Edit - Replace capability of the word processor - it's much quicker and less prone to error (much less typing).
Regards
�0cureuil secret
Hi all
I would like someone help me translate this message into English.
1R9S10R2S3R9S10R2S65389R
What!?
This is the 1st part of the solution for Level Special-I_0491 "Pathological LPB Example" by Mr Eric Schmidt (the end of the solution does not require a lot of time).
How do you convert this code within an LPB?
1. Create a partial LPB for Special-I_0491 (shoot once in the level and exit, LTank will offer to save your LPB, choose Yes)
2. Run the utility "AS-LPB_Tools.exe" and open the folder containing the Special-I_0491.LPB
3. Using a word processor you can replace the code in 1R9S10R2S3R9S10R2S65389R "R" with "right", "L" with "left" ...
4. Paste the result 1RIGHT9SHOT10RIGHT2SHOT3RIGHT9SHOT10RIGHT2SHOT65389RIGHT by right-clicking on "Special-I_0491.LPB" open in "AS-LPB_Tools.exe"
To do this, open Word, choose Tools / Macro � / � Macros ... dialog box opens, enter a name for the macro and choose Create. Edit what your VBA editor proposes to the following macro, Save and Close the VBA Editor.
Sub MacroLPB1 ()
With Selection.Find
. Text = "R"
. Replacement.Text = "Right"
. Execute Replace: = wdReplaceAll
. Text = "L"
. Replacement.Text = "Left"
. Execute Replace: = wdReplaceAll
. Text = "U"
. Replacement.Text = "Up"
. Execute Replace: = wdReplaceAll
. Text = "D"
. Replacement.Text = "Down"
. Execute Replace: = wdReplaceAll
. Text = "S"
. Replacement.Text = "Shot"
. Execute Replace: = wdReplaceAll
End With
End Sub
To replace the code 1R9S10R2S3R9S10R2S65389R, highlight it with your mouse in Word, choose the menu Tools / Macro � / � ... Macros in the dialog box, select the macro name and choose Run.
The following macro is the reverse.
Sub MacroLPB2 ()
With Selection.Find
. Text = "right"
. Replacement.Text = "R"
. Execute Replace: = wdReplaceAll
. Text = "left"
. Replacement.Text = "L"
. Execute Replace: = wdReplaceAll
. Text = "up"
. Replacement.Text = "U"
. Execute Replace: = wdReplaceAll
. Text = "down"
. Replacement.Text = "D"
. Execute Replace: = wdReplaceAll
. Text = "shot"
. Replacement.Text = "S"
. Execute Replace: = wdReplaceAll
. Text = "^ p"
. Replacement.Text = ""
. Execute Replace: = wdReplaceAll
End With
End Sub
The interest of this second macro is that it convert LPBs into a form that is simple, portable and concise.
Two LPBs for the same level "Challenge-IV_1067 / California Dreamin'" are each used to kill one of the Anti-Tanks (the table contains 2 Anti-Tanks that need to be destroyed).
6U1L1S10U7L1D1S2R1D1S2R1D1S4L1D4S2R1D6S5L5D1R6S9D1R15S9U1R4S2U1R1S10D1R23S
5U1L1S11U6L1D1S6L5D1R26S5U11R12D1L2S12U2L1D9S2R15D2L1U2S2R3U1L16S
I have a problem when using the "AS-LPB_Tools.exe", it does not copy the movements (Copy the moves) if the Windows clipboard already contains something. I must manually empty it every time.
I hope this long message is useful for you.
My friends, may the fleas of 1000 camels infest your armpits
Ihab