我想利用CMO的lua脚本实现每2秒打印一次“Hello,CMO”的功能,可是似乎没有任何输出

下面是我的脚本:

– 新建触发器
ScenEdit_SetTrigger({mode=‘add’,type=‘RegularTime’,name=‘2 Seconds Trigger’,interval=2}) – 设置2秒触发一次

– 新建动作
local ScriptText = “print(‘Hello, World!’)” – 设置脚本内容
ScenEdit_SetAction({mode=‘add’, type=‘LuaScript’, name=‘Save Action’,ScriptText=ScriptText})

– 新建事件
ScenEdit_SetEvent(‘Save Event’, {mode=‘add’, isActive=true, isRepeatable=true})

– 设置事件触发器
ScenEdit_SetEventTrigger(‘Save Event’,{mode = ‘add’, description = ‘2 Seconds Trigger’})

– 设置事件动作
ScenEdit_SetEventAction(‘Save Event’,{mode = ‘add’, description = ‘Save Action’})

请问有大佬曾有相关实现的经验吗,如果您能提供帮助,我将十分感激!!

我记得cmo官方论坛有玩家把自己写的lua脚本汇集到一起放到了GitHub上

这是我收藏的一个库。

非常感谢,我会阅读作为参考!!

创建动作改为Message

ScenEdit_SetAction({Description = '动作名称',Mode = 'add',SideID = '1', Type = 'Message',  text = 'Hello, World!', })

谢谢您的帮助,我通过官方api中的场景Message接口,实现了预想功能!