MZ Message script tag (MV and MZ)

Introduction:
This plugin allows <script>tag inside a message text. Currently it just evals a script between <script> and </script>,

Example:
HTML:
1111111
22222222222
333333335<script>$gamePlayer.jump(0,0);this._waitCount+=100;</script>8
6444444444444444444444
The player will jumps after 5 is displayed, and the message will wait for 100 frames before procceeding to display 8. The keyword 'this' refers to the message window.

Update 2024/12/25:
Add a function output that allows the user to, well, output something.
Example:
HTML:
Here is a random number:<script>output(Math.random());output('f');</script>
1735114193509.png


Tips:
1. How to get current event id?
$gameMap._interpreter._eventId
2. How to get current message text?
textState.text
3. How to get current text position?
textState.index
Note: the position is at the end of current script tag, right behind the closing tag </script>

Terms of use:
Can be used in any project, commercial or not. Credit is not required but much appreciated.

Download:
See the attachment.
that's very clever in a small package!
Update: Add an output function to output something from current text position. See the first post.
Nice! Please add terms of use to the opening post. 👋

Original thread: https://forums.rpgmakerweb.com/threads/message-script-tag-mv-and-mz.173124/