local function convertDotNetTickTimeToLuaTimestamp(theDotNetStamp) return (tonumber(theDotNetStamp) - 621355968000000000) / 10000000 end local function convertLuaTimestampToDotNetTickTime(theUnixStamp) return 621355968000000000 + (tonumber(theUnixStamp) * 10000000) end --finds existing specified trigger, removes it from event removes it. --recreates it with original name and specified time and reassociates it back --to original event. Upon not finding the original it will create new one. local function DeleteAndReCreateTimeTrigger(theEvent,theTrigger,theTime) local e,p = pcall(ScenEdit_GetEvent,theEvent); if((theTime~=nil) and type(theTime) == 'number') then --convert unix time to .net tick time. theTime = convertLuaTimestampToDotNetTickTime(theTime); end if(e == true and p ~=nil) then local triggerID; for k,v in pairs(p.triggers) do --find matching if multiple. if ((v.Time ~= nil) and v.Time.Description==theTrigger) then if(theTime == nil) then theTime = tonumber(v.Time.Time); end triggerID = v.Time.ID; break; end end if triggerID ~=nil then --if found remove.else just create. ScenEdit_SetEventTrigger(theEvent,{Mode='remove',Description=triggerID}); ScenEdit_SetTrigger({Description=triggerID, Mode='remove'}); end ScenEdit_SetTrigger({name=theTrigger, mode='add',Type="Time",Time=theTime}); ScenEdit_SetEventTrigger(theEvent,{mode='add',Description=theTrigger}); else print('DeleteAndReCreateTimeTrigger(): Error event not obtainable. details: ' .. tostring(p)); end e,p = nil,nil; end --[[ Sample usage. local dtFormat = '!%m/%d/%Y %H:%M:%S'; DeleteAndReCreateTimeTrigger('TwitterNews','TweetReceivedTime'); --just recreate it so it gets no fired flag use existing time. DeleteAndReCreateTimeTrigger('TwitterNews','TweetReceivedTime',os.date(dtFormat,1748248200)); --normal method.feed it string time. DeleteAndReCreateTimeTrigger('TwitterNews','TweetReceivedTime',1748248200); --feed it std unix time and will convert to .net for you. --Get the existing time but add 5 minutes too it when re-creating. local e = ScenEdit_GetEvent('TwitterNews') DeleteAndReCreateTimeTrigger('TwitterNews','TweetReceivedTime',convertDotNetTickTimeToLuaTimestamp(tonumber(e.triggers[1].Time.Time) + 300)) Can be helpful with you have a dozen times you need to reset to known times for whatever reason or just need to reset the fired flags. Write a reset helper function that just makes a call for each one and evertime you need to reset you just run that one function. This assumes you're not tracking specific trigger-id guids (since they change on recreation) though Imagine those cases are few and far between particularly for time-triggers. --]]