mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2013
Posts: 16
S
Pikka bird
OP Offline
Pikka bird
S
Joined: Oct 2013
Posts: 16
Hey there, I'd like to write a script saying "user" (Name in chat) has been writing "x" amount of lines in the chat when he/she subscribes, how do I do that? I have a file with logs from the chat and me thinking the "script" needs to count how many times "user" appears in the file.

How do I make this work? Any help would be appreciated.

Last edited by ShuriStr; 07/07/15 12:11 AM.
Joined: Sep 2014
Posts: 259
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
Read each line and use regex to search for their name. I guess you search for < $+ $nick $+ > and then increase a counter if there is a match

Joined: Jun 2014
Posts: 248
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Jun 2014
Posts: 248
It seems like you'd want to have the totals stored somewhere ready to use instead of trying to call them on the fly which would be quite slow.

Joined: Oct 2013
Posts: 16
S
Pikka bird
OP Offline
Pikka bird
S
Joined: Oct 2013
Posts: 16
I see, I don't know how to write that script though, so if you or anyone else could lend a hand it would be very helpful.

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Code:
Pseudo code LOG :

Someone writes
Check if user wrote before
If yes, increase value by 1, write value
Else write value 1

Pseudo code CHECK : 

Someone subs
Call log value
Message channel with log value?

Pseudo code CHECK v2 (Sakana) : 

Someone subs 
Call log file
Check entire log file for $nick matches
Message channel with log value?

Something like that.

You'll need the on text event, and some way to store it that you like. Note that this script is extremely inefficient to begin with as it will only take up unneccesary space and most likely have a redundant amount of users with <5 in value.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Oct 2013
Posts: 16
S
Pikka bird
OP Offline
Pikka bird
S
Joined: Oct 2013
Posts: 16
I understand your point, I'm on the same line. I do really like the Pseudo V2 version.

If anyone has an idea how the code would look like feel free to suggest it since I'm not an expert on this situation.

Joined: Jun 2014
Posts: 248
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Jun 2014
Posts: 248
If your talking about scanning an entire IRC log file this will become extremely slow, maybe even taking minutes--tens of minutes to complete. SCanning line by line of a 400 meg log ...yikes

Joined: Oct 2013
Posts: 16
S
Pikka bird
OP Offline
Pikka bird
S
Joined: Oct 2013
Posts: 16
Yeah, it's not gonna happen, I want it immediately. Maybe throw the cmd? What do you guys think?

Joined: Oct 2013
Posts: 16
S
Pikka bird
OP Offline
Pikka bird
S
Joined: Oct 2013
Posts: 16
I'm still looking for a solution, any ideas or anyone that could help with a working script & explanation?


Link Copied to Clipboard