Hello, I'm looking how to make a code when a user runs !log "nick" the bot log read archive.log and the result is placed in a room.
this can be done?
best regards
How do the file contents look?
If the file is like:
<nick> <text>
<nick2> <text2>
Then this will work:
on *:text:!log ?*:#:{ msg # $$read(archive.log,nw,$2 *) }
my log look like .
[00:26] (+Chat-Colombia) Ha entrado - German47_1 - Nicks anteriores: German48_2, German48, German48_3, German47_1. | Total: 4
[00:27] (+Chat-Colombia) Ha entrado - lescolombia - Nicks anteriores: lesmedellin, lescolombia. | Total: 2
best regards
In which case you probably want:
on *:text:!log ?*:#:{ msg # $$read(archive.log,nw,* $+ $2*) }
agree, then you run
!log nick o !log nick text
nice works fine
thanks you
hi
I do want to show me all the possible results? not just one, but all you find
best regards
on *:text:!log ?*:#:{
set -u %log.chan $chan
filter -fk archive.log _msglogoutput $+(*,$remove($2,*,?,&),*)
}
alias _msglogoutput { msg %log.chan $1- }
You might want to build in some kind of flood control because there is nothing at present which would stop someone from typing "!log a" and it would read out any lines in the entire log that contain 'a'.
One thing you could do is check the length of the search term and make sure it is at least X characters long for example.