1717
1818--- Logs a function call to the JSONL file
1919--- @param function_name string The name of the function being called
20- --- @param params table The parameters passed to the function
21- function LOG .write (function_name , params )
20+ --- @param arguments table The parameters passed to the function
21+ function LOG .write (function_name , arguments )
2222 --- @type LogEntry
2323 local log_entry = {
2424 timestamp_ms = math.floor (socket .gettime () * 1000 ),
2525 [" function" ] = {
2626 name = function_name ,
27- params = params ,
27+ arguments = arguments ,
2828 },
2929 -- game_state before the function call
3030 game_state = utils .get_game_state (),
5757function LOG .hook_go_to_menu ()
5858 local original_function = G .FUNCS .go_to_menu
5959 G .FUNCS .go_to_menu = function (args )
60- local params = {}
60+ local arguments = {}
6161 local name = " go_to_menu"
62- LOG .write (name , params )
62+ LOG .write (name , arguments )
6363 return original_function (args )
6464 end
6565 sendDebugMessage (" Hooked into G.FUNCS.go_to_menu for logging" , " LOG" )
@@ -77,14 +77,14 @@ function LOG.hook_start_run()
7777 local timestamp = LOG .generate_iso8601_timestamp ()
7878 LOG .current_run_file = LOG .mod_path .. " runs/" .. timestamp .. " .jsonl"
7979 sendInfoMessage (" Starting new run log: " .. timestamp .. " .jsonl" , " LOG" )
80- local params = {
80+ local arguments = {
8181 deck = G .GAME .selected_back .name ,
8282 stake = args .stake ,
8383 seed = args .seed ,
8484 challenge = args .challenge and args .challenge .name ,
8585 }
8686 local name = " start_run"
87- LOG .write (name , params )
87+ LOG .write (name , arguments )
8888 return original_function (game_state , args )
8989 end
9090 sendDebugMessage (" Hooked into G.FUNCS.start_run for logging" , " LOG" )
9898function LOG .hook_select_blind ()
9999 local original_function = G .FUNCS .select_blind
100100 G .FUNCS .select_blind = function (args )
101- local params = { action = " select" }
101+ local arguments = { action = " select" }
102102 local name = " skip_or_select_blind"
103- LOG .write (name , params )
103+ LOG .write (name , arguments )
104104 return original_function (args )
105105 end
106106 sendDebugMessage (" Hooked into G.FUNCS.select_blind for logging" , " LOG" )
110110function LOG .hook_skip_blind ()
111111 local original_function = G .FUNCS .skip_blind
112112 G .FUNCS .skip_blind = function (args )
113- local params = { action = " skip" }
113+ local arguments = { action = " skip" }
114114 local name = " skip_or_select_blind"
115- LOG .write (name , params )
115+ LOG .write (name , arguments )
116116 return original_function (args )
117117 end
118118 sendDebugMessage (" Hooked into G.FUNCS.skip_blind for logging" , " LOG" )
@@ -132,9 +132,9 @@ function LOG.hook_play_cards_from_highlighted()
132132 table.insert (cards , i - 1 ) -- Adjust for 0-based indexing
133133 end
134134 end
135- local params = { action = " play_hand" , cards = cards }
135+ local arguments = { action = " play_hand" , cards = cards }
136136 local name = " play_hand_or_discard"
137- LOG .write (name , params )
137+ LOG .write (name , arguments )
138138 return original_function (args )
139139 end
140140 sendDebugMessage (" Hooked into G.FUNCS.play_cards_from_highlighted for logging" , " LOG" )
@@ -150,9 +150,9 @@ function LOG.hook_discard_cards_from_highlighted()
150150 table.insert (cards , i - 1 ) -- Adjust for 0-based indexing
151151 end
152152 end
153- local params = { action = " discard" , cards = cards }
153+ local arguments = { action = " discard" , cards = cards }
154154 local name = " play_hand_or_discard"
155- LOG .write (name , params )
155+ LOG .write (name , arguments )
156156 return original_function (args )
157157 end
158158 sendDebugMessage (" Hooked into G.FUNCS.discard_cards_from_highlighted for logging" , " LOG" )
166166function LOG .hook_cash_out ()
167167 local original_function = G .FUNCS .cash_out
168168 G .FUNCS .cash_out = function (args )
169- local params = {}
169+ local arguments = {}
170170 local name = " cash_out"
171- LOG .write (name , params )
171+ LOG .write (name , arguments )
172172 return original_function (args )
173173 end
174174 sendDebugMessage (" Hooked into G.FUNCS.cash_out for logging" , " LOG" )
182182function LOG .hook_toggle_shop ()
183183 local original_function = G .FUNCS .toggle_shop
184184 G .FUNCS .toggle_shop = function (args )
185- local params = { action = " next_round" }
185+ local arguments = { action = " next_round" }
186186 local name = " shop"
187- LOG .write (name , params )
187+ LOG .write (name , arguments )
188188 return original_function (args )
189189 end
190190 sendDebugMessage (" Hooked into G.FUNCS.toggle_shop for logging" , " LOG" )
0 commit comments