Regular_trigger doesn't work

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
wbllll
Posts: 2
Joined: Wed Dec 18, 2024 2:05 pm

Regular_trigger doesn't work

Post by wbllll »

ScenEdit_SetTrigger({mode='add',type='RegularTime',name='2 Seconds Trigger',interval=2})
local ScriptText = "print('Hello, CMO!')"
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'})

I want to print "Hello, CMO!" every 2 seconds,but It doesn't work and prints nothing.I will sincerely appreciate it if you could help me!!
User avatar
blu3s
Posts: 1240
Joined: Fri Jul 08, 2022 9:45 am

Re: Regular_trigger doesn't work

Post by blu3s »

That setting is for 15seconds, there's not 2seconds trigger, is 1second or 5 seconds

The interval value is not the seconds is the preset to use.
1second = 0
5seconds = 1
15seconds = 2
...
wbllll
Posts: 2
Joined: Wed Dec 18, 2024 2:05 pm

Re: Regular_trigger doesn't work

Post by wbllll »

Got it!Thanks a lot and wish you a good day!!
Post Reply

Return to “Lua Legion”