mIRC Homepage
Posted By: Gargantuan (Help Request) Logging certain sentences. - 18/04/14 05:23 PM
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

Posted By: Nillen Re: (Help Request) Logging certain sentences. - 18/04/14 05:28 PM
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-
}
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"
Posted By: Nillen Re: (Help Request) Logging certain sentences. - 18/04/14 06:44 PM
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"
Thank you for the response, any chance you're available on your twitch channel for a bit?
Posted By: Nillen Re: (Help Request) Logging certain sentences. - 18/04/14 07:01 PM
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.
Okay, sending forum PM because you had to get an invite to be able to join that status.
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.
© mIRC Discussion Forums