mIRC Home    About    Download    Register    News    Help

Print Thread
#256906 01/03/16 03:40 PM
Joined: Nov 2015
Posts: 14
L
Lopin Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Nov 2015
Posts: 14
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

Lopin #256907 01/03/16 04:34 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
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 *) }

hixxy #256911 01/03/16 04:54 PM
Joined: Nov 2015
Posts: 14
L
Lopin Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Nov 2015
Posts: 14
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

Lopin #256917 01/03/16 05:14 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
In which case you probably want:

Code:
on *:text:!log ?*:#:{ msg # $$read(archive.log,nw,* $+ $2*) }

hixxy #256918 01/03/16 05:24 PM
Joined: Nov 2015
Posts: 14
L
Lopin Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Nov 2015
Posts: 14
agree, then you run
!log nick o !log nick text




nice works fine laugh
thanks you

Last edited by Lopin; 01/03/16 05:28 PM.
Lopin #256919 01/03/16 06:13 PM
Joined: Nov 2015
Posts: 14
L
Lopin Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Nov 2015
Posts: 14
hi smile

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

best regards

Lopin #256924 01/03/16 08:44 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
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.

hixxy #256925 01/03/16 08:59 PM
Joined: Nov 2015
Posts: 14
L
Lopin Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Nov 2015
Posts: 14
thanks you smile


Link Copied to Clipboard