I'm making a script to copy news posts in Achaea to a log file, and for some reason each line in my output log file is duplicated. Alias is like this:
And the trigger:
And hints as to what is causing the duplication would be appreciated.
<aliases>
<alias
match="^copyArchive (\d+)$"
enabled="y"
group="archive"
regexp="y"
send_to="12"
keep_evaluating="y"
sequence="100"
>
<send>numPosts=%1
archiveIndex=archiveIndex or 0
archiveIndex=archiveIndex+1
OpenLog("PublicArchives.txt",true)
EnableGroup("archiver",true)
world.Send("read ", archiveIndex)
</send>
</alias>
</aliases>
And the trigger:
<triggers>
<trigger
group="archiver"
keep_evaluating="y"
match="^(.*)$"
regexp="y"
send_to="12"
sequence="100"
>
<send>input_string="%1"
if string.find(input_string,"Type MORE if you wish to continue reading%.")~=nil then
world.Send("more")
elseif string.find(input_string,"PUBLIC SECTION (%d+)/(%d+)")==1 then
numPosts=numPosts-1
if numPosts==0 then
FlushLog()
CloseLog()
EnableGroup("archiver", false)
else
archiveIndex=archiveIndex+1
world.Send("read ", archiveIndex)
end
(%d+)/(%d+)"))
elseif string.match(input_string, "News > ")==1 then
--print("ignore")
else
WriteLog(input_string)
Note("wrote log: ", input_string)
end
</trigger>
</triggers>
And hints as to what is causing the duplication would be appreciated.