mIRC Homepage
Posted By: Lopin help please - 01/03/16 03:40 PM
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
Posted By: hixxy Re: help please - 01/03/16 04:34 PM
How do the file contents look?

If the file is like:

Quote:
<nick> <text>
<nick2> <text2>


Then this will work:

Code:
on *:text:!log ?*:#:{ msg # $$read(archive.log,nw,$2 *) }
Posted By: Lopin Re: help please - 01/03/16 04:54 PM
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
Posted By: hixxy Re: help please - 01/03/16 05:14 PM
In which case you probably want:

Code:
on *:text:!log ?*:#:{ msg # $$read(archive.log,nw,* $+ $2*) }
Posted By: Lopin Re: help please - 01/03/16 05:24 PM
agree, then you run
!log nick o !log nick text




nice works fine laugh
thanks you
Posted By: Lopin Re: help please - 01/03/16 06:13 PM
hi smile

I do want to show me all the possible results? not just one, but all you find

best regards
Posted By: hixxy Re: help please - 01/03/16 08:44 PM
Code:
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.
Posted By: Lopin Re: help please - 01/03/16 08:59 PM
thanks you smile
© mIRC Discussion Forums