I need help with a script. (Backlog)

Hi, guys. I'm developing a visual novel in vx ace, and I'm struggling with the backlog script. Basically, I've got nothing.
I need something that could show past messages at will.
Do you guys know any script or are able to help me? Thank you.

#=======================================================
# Backlog con Scroll para RGSS3
# Autor: ChatGPT
# Compatibilidad: RPG Maker VX Ace
#=======================================================

module BacklogConfig
# Número de líneas a mostrar en el log.
Line_Num = 17

# Tecla para abrir el backlog
Key_Open = :L

# Espacio para el nombre del personaje en el log.
Name_Space = 120
end

#==============================================================================
# ** Window_Message
#------------------------------------------------------------------------------
# Esta ventana de mensaje se usa para mostrar textos.
#==============================================================================
class Window_Message < Window_Base
alias backlog_initialize initialize
alias backlog_process_character process_character
alias backlog_new_page new_page

def initialize
backlog_initialize
init_backlog_variables
end

def init_backlog_variables
$game_map.backlog_text = Array.new(BacklogConfig::Line_Num) { "" }
$game_map.backlog_names = Array.new(BacklogConfig::Line_Num) { "" }
$game_map.backlog_index = 0
end

def process_character(c, text, pos)
backlog_process_character(c, text, pos)
add_to_backlog(c, :text)
end

def new_page(text, pos)
backlog_new_page(text, pos)
add_to_backlog($game_message.face_name, :name)
end

def add_to_backlog(content, type)
if type == :text
$game_map.backlog_text[$game_map.backlog_index] += content
elsif type == :name
if $game_map.backlog_index < BacklogConfig::Line_Num - 1
$game_map.backlog_index += 1
else
$game_map.backlog_text.shift
$game_map.backlog_names.shift
$game_map.backlog_text.push("")
end
$game_map.backlog_names[$game_map.backlog_index] = content
end
end
end

#==============================================================================
# ** Window_Backlog
#------------------------------------------------------------------------------
# Esta ventana muestra los textos guardados en el backlog.
#==============================================================================
class Window_Backlog < Window_Base
def initialize
super(0, 0, Graphics.width, Graphics.height)
self.opacity = 0
@scroll_index = 0
refresh
end

def refresh
contents.clear
max_lines = $game_map.backlog_text.size
displayed_lines = [max_lines, BacklogConfig::Line_Num].min

for i in 0...displayed_lines
draw_text(BacklogConfig::Name_Space, i * line_height, Graphics.width - BacklogConfig::Name_Space, line_height, $game_map.backlog_text[@scroll_index + i], 0)
draw_text(0, i * line_height, BacklogConfig::Name_Space, line_height, $game_map.backlog_names[@scroll_index + i] + " :", 0)
end
end

def scroll_up
if @scroll_index > 0
@scroll_index -= 1
refresh
end
end

def scroll_down
if @scroll_index < [$game_map.backlog_text.size - BacklogConfig::Line_Num, 0].max
@scroll_index += 1
refresh
end
end
end

#==============================================================================
# ** Scene_Backlog
#------------------------------------------------------------------------------
# Esta escena ejecuta el backlog de mensajes.
#==============================================================================
class Scene_Backlog < Scene_MenuBase
def start
super
@backlog_window = Window_Backlog.new
end

def update
super
if Input.trigger?🙂😎
Sound.play_ok
return_scene
elsif Input.trigger?🙂UP)
@backlog_window.scroll_up
elsif Input.trigger?🙂DOWN)
@backlog_window.scroll_down
end
end
end

#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
# Esta clase gestiona el mapa.
#==============================================================================
class Game_Map
attr_accessor :backlog_text
attr_accessor :backlog_names
attr_accessor :backlog_index
end

#==============================================================================
# ** Game_Interpreter
#------------------------------------------------------------------------------
# Esta clase ejecuta comandos de eventos.
#==============================================================================
class Game_Interpreter
def open_backlog
SceneManager.call(Scene_Backlog)
end
end

# Añade un comando de script para abrir el backlog.
class Window_Command < Window_Selectable
alias backlog_make_command_list make_command_list

def make_command_list
backlog_make_command_list
add_command("Backlog", :backlog) if SceneManager.scene_is?(Scene_Map)
end
end

class Scene_Map < Scene_Base
alias backlog_create_all_windows create_all_windows

def create_all_windows
backlog_create_all_windows
@command_window.set_handler🙂backlog, method🙂command_backlog))
end

def command_backlog
SceneManager.call(Scene_Backlog)
end
end

This is a script chatGPT4 generated for me. But it isn't working.

Original thread: https://forums.rpgmakerweb.com/threads/i-need-help-with-a-script-backlog.170050/