mIRC Home    About    Download    Register    News    Help

Print Thread
#170473 09/02/07 03:55 PM
Joined: Feb 2007
Posts: 3
A
Self-satisified door
OP Offline
Self-satisified door
A
Joined: Feb 2007
Posts: 3
So far I have this...

on *:TEXT:*:#originalchannel: { if ($nick == somerandomnickname) && ($chan == #originalchannel) { scon -a if ($network == networkname) msg #channeltoechoto $1- } }

But that only echoes from one channel to another. I need it to read data from one channel (timestamp, text, etc), store it in a database, and have it available to be @searched by another channel. How would I do this? (I know nothing about databases!)

Joined: Dec 2006
Posts: 80
Babel fish
Offline
Babel fish
Joined: Dec 2006
Posts: 80
Your @search would need to be followed up by some form of a matchtext identifier to search for, like @search find-this-word, or something along those lines.

If that is the case, I would suggest just logging everything from #originalchannelname,(using mIRC's log) and then have your @search command be something like @search #whateverchannel-log-file typesearchword-here.

Then it could resort to that file, to search for that word. you can do that with wildcards

Code:

on *:TEXT:@search*:#2ndchannelname: { 
  scon -a $iif($network,networkname) msg #channeltogoto $read(original-channel-log-filename, s (or w), matchtext)
}

 


You would have to read up on the help file to find what switch works best for your application, there is s, r and w where w is a wildcard match. This might be a handy spot for regex evaluations (which I need to brush up on, so I won't get too deep with it)... Thats in the editor too, its not that rough to learn. Check it out.

The only trouble is if you specify a wildcard its going to return any random wildcard line that matches what the user is looking for. (*help* would return words including, help, helper, helpful... wildcard related) Use s for more specific match searches.


Scripto ---- Life is about the relationships. The correct code being: $replace($them,$you,$me)
Joined: Feb 2007
Posts: 3
A
Self-satisified door
OP Offline
Self-satisified door
A
Joined: Feb 2007
Posts: 3
Ok, but I wouldn't want to use a log/txt file. The channel that I'm in is pretty active and the file would get too big in no time. Thats why I was thinking of an SQL database or something... and I need to figure out how it would write to the db and retrieve stuff (know almost nothing about DB's... but only option I have I think..)

Last edited by absentee; 09/02/07 04:48 PM.
Joined: Dec 2006
Posts: 80
Babel fish
Offline
Babel fish
Joined: Dec 2006
Posts: 80
I use a log system that I wrote myself...

Code:
on ^*:TEXT:*:#:{
  if (!$server) return
  var %logfile = logs\ $+ $asctime(mmmdyyyy) $+ $remtok($chan,1,35) $+ .txt
  write %logfile $strip($tik $ut $+ : $1-)
}
 


This creates a new log, every day at midnight... I am in a few channels that are very active, and none of the files get over 400kb's. I guess it would depend on how far back you want to @search, referencing something like this might be tougher if you want to go back a few days, because you would have to know the date, but you could write it for just the current date.

Are you looking for long history type searches?


Scripto ---- Life is about the relationships. The correct code being: $replace($them,$you,$me)
Joined: Feb 2007
Posts: 3
A
Self-satisified door
OP Offline
Self-satisified door
A
Joined: Feb 2007
Posts: 3
Right, but if I wanted to search for something with the @search command, it would have to search for tons of log files instead of one database. For example, if I wanted to search when someone said "badunk-a-dunk". Turns out someone said it 241days ago; it would take forever to search through all those log files to find when they did that, whereas it'd be a simple search command in a database...

Edit: yeah, it'd be for longterm.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Something like that would take a long time regardless of how you formatted it. It would also get very large no matter how you format it. You are better off using Windows' search function to search for text in files and just let it take its time through the logs. You can cut down on log size by stripping control codes as well.

Or, if you know that you don't want to search text from specific people (such as bots) or that include specific information (such as ads), then you can write your own logging script that will not include those things in the logs. That would also cut down on the log sizes.

Regardless what you're looking for, using mIRC to do it would just be slow and the database file (whatever one you use) would be large as well when you're going back that far.


Invision Support
#Invision on irc.irchighway.net
Joined: Aug 2006
Posts: 183
T
Vogon poet
Offline
Vogon poet
T
Joined: Aug 2006
Posts: 183
I log everything in all channels (except control codes). I also have an alias that allows me to find things in the log via mirc, though it uses Regex, so it may not be helpful to you. One of the logs is almost 3 million lines long and it take 30 seconds for a simple Regex and as long as 10 minutes for a complex Regex.

Code:
/scanlog {
  var %logfile = C:\Progra~1\mIRC\logs\ $+ $active $+ . $+ $network $+ .log
  var %get.chan = $active
  window -e @CheckChan
  echo @CheckChan 10Checking %get.chan for the phrase3 $$1-
  filter -fwpg %logfile @CheckChan / $+ $$1- $+1 /i
  if $filtered = 0 { echo @CheckChan No matches found! | join %get.chan | halt }
  echo @CheckChan $filtered entries found!
  join %get.chan
}


You can alter that as you see fit. I could add a few more things to it, but it works for my needs. Enjoy.


Yar

Link Copied to Clipboard