mIRC Home    About    Download    Register    News    Help

Print Thread
(Help Request) Logging certain sentences. #245370 18/04/14 05:23 PM
Joined: Apr 2014
Posts: 31
G
Gargantuan Offline OP
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Apr 2014
Posts: 31
Hello, fellow mIRC users. I've been trying to find a way so when I type certain sentences
into channel chat, it logs it to a text file. For example if I type ".timeout name 604800 Spamming"
then it would copy this to a text file with something like this:
(Channel Name) <2014-04-14 @ 23:43:12> .timeout Gargantuan 604800 Spamming
or possibly log it to a different text file for each channel. As I have understood it, mIRC has quite a
big range of possibilities because of the scripting but I have no experience in scripting or coding.

Any help will be greatly appreciated, thanks for reading and have a nice day.

Regards,
Gargantuan


Last edited by Gargantuan; 18/04/14 05:24 PM.
Re: (Help Request) Logging certain sentences. [Re: Gargantuan] #245371 18/04/14 05:28 PM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
This should be in Scripts & Popups, but whatever.
Is this something that you want to only log your own actions? Or every user's actions?

Edit: Since you went offline I'll just post the simple script and see if you want something else later when you get back.
Code:
on 1:INPUT:#: { 
  if ($1 != .timeout) return 
  write log.txt ( $+ # $+ ) < $+ $time(yyyy-mm-dd) @ $time $+ > $1-
}


If you want to log different channels to different text files you'd do it like this:
Code:
on 1:INPUT:#: { 
  if ($1 != .timeout) return 
  write # $+ log.txt ( $+ # $+ ) < $+ $time(yyyy-mm-dd) @ $time $+ > $1-
}

Last edited by Nillen; 18/04/14 05:56 PM.

Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Re: (Help Request) Logging certain sentences. [Re: Nillen] #245373 18/04/14 06:14 PM
Joined: Apr 2014
Posts: 31
G
Gargantuan Offline OP
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Apr 2014
Posts: 31
Ahh, my mistake but I don't think I'm able to move it.

I'd like it to only log it when I say it, but only for the commands .ban .unban .timeout I don't know how time consuming, hard, difficult this is or if it's even possible but I'd gladly come to an agreement to get this made, I highly doubt I have the skills required to script/code this. I have zero knowledge or experience in this kind of hobby/work.

In a perfect world I'd like to have it so it logs those three variants of commands like this.


.timeout Gargantuan 604800 Spamming porn
.timeout name seconds reason
(Riotgames) (Timeout) <2014-04-14 @ 23:43:12> Gargantuan was suspended for 604800 seconds for spamming porn.
(Current channel name) (Command used) <Date and time> "user" was suspended for "seconds" seconds for "reason"

.ban Gargantuan Spamming porn
.ban name reason
(Riotgames) (Ban) <2014-04-14 @ 23:43:12> Gargantuan was permanently banned for spamming porn.
(Current channel name) (Command used) <Date and time> "user" was permanently banned for "reason"

.unban Gargantuan Pardon
.unban name reason
(Riotgames) (Unban) <2014-04-14 @ 23:43:12> Gargantuan was pardoned and unbanned from the channel for apologizing and promising not to do it again.
(Current channel name) (Command used) <Date and time> "user" was was pardoned and unbanned from the channel for "reason"

Re: (Help Request) Logging certain sentences. [Re: Gargantuan] #245375 18/04/14 06:44 PM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Code:
on 1:INPUT:#: { 
  if ($1 != .timeout) && ($1 != .ban) && ($1 != .unban) return 
  if ($1 == .ban) { var %Command = Ban, %Text = was permanently banned for }
  elseif ($1 == .timeout) { var %Command = Timeout, %Text = was timed out for, %Text2 = seconds for }
  elseif ($1 == .unban) { var %Command = Unban, %Text = was pardoned and unbanned from $regsubex(#,^#*,) for }
  if (%Text2) { write # $+ log.txt ( $+ $regsubex(#,^#*,) $+ ) ( $+ %command $+ )  < $+ $time(yyyy-mm-dd) @ $time $+ > $2 %Text $3 %Text2 $4- | return }
  write # $+ log.txt ( $+ $regsubex(#,^#*,) $+ ) ( $+ %command $+ )  < $+ $time(yyyy-mm-dd) @ $time $+ > $2 %Text $3-
}
Tested with the exact results you asked for. (apart from that the Channel will not start with an uppercased letter, I'm not sure how to do that easily.)
This will save individual files for each channel. If you want to save them all to the same file, remove the "# $+" from both "# $+ log.txt"


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Re: (Help Request) Logging certain sentences. [Re: Nillen] #245378 18/04/14 07:00 PM
Joined: Apr 2014
Posts: 31
G
Gargantuan Offline OP
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Apr 2014
Posts: 31
Thank you for the response, any chance you're available on your twitch channel for a bit?

Re: (Help Request) Logging certain sentences. [Re: Gargantuan] #245379 18/04/14 07:01 PM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Unfortunately no. I got locked out of twitch for 8 hours due to a malfunctioning code spamming my chat earlier today. - If you wish to talk, you can either start a new status and join irc.rizon.net - channel #nillen - or send me a personal message on the forums. I'm quite active at the moment.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Re: (Help Request) Logging certain sentences. [Re: Nillen] #245383 18/04/14 07:25 PM
Joined: Apr 2014
Posts: 31
G
Gargantuan Offline OP
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Apr 2014
Posts: 31
Okay, sending forum PM because you had to get an invite to be able to join that status.

Re: (Help Request) Logging certain sentences. [Re: Gargantuan] #245384 18/04/14 09:35 PM
Joined: Apr 2014
Posts: 31
G
Gargantuan Offline OP
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Apr 2014
Posts: 31
Okay, Nillen helped me out in PM and made it completely perfect. Really kind and helpful, topic can be closed/locked if needed smile Thanks once again mIRC community.