function test(){ local text = fe.game_info(Info.Year); return text.topper();}fe.add_text("[!test]", 0, 0)
Magic tokens can also be used to run a function defined in your layout or plugin's squirrel script to obtain the desired text. These tokens are in the form [!<function_name>]. When used, Attract-Mode will run the corresponding function (defined in the squirrel "root table"). This function should then return the string value that you wish to have replace the magic token. The function defined in squirrel can optionally have up to two parameters passed to it. If it is defined with a first parameter, Attract-Mode will supply the appropriate index_offset in that parameter when it calls the function. If a second parameter is present as well, the appropriate filter_offset is supplied.