| |
|
| beeper - Thu Jun 14, 2012 12:14 pm |
|
|
| I'll make this simple I'm looking for a script that will allow me to search the mIRC log files via the bot using a command like "!log <searchword>" and will display to chat, (one) line of text from any irc logs with that string. |
|
|
|
| Jethro - Thu Jun 14, 2012 1:52 pm |
|
|
| Use: |
|
|
|
| beeper - Thu Jun 14, 2012 4:52 pm |
|
|
Something like this or do I need to define somehow all of the logfiles in $read(logfile,nw,%keyword)? There is a lot of files. |
|
|
|
| beeper - Thu Jun 14, 2012 4:56 pm |
|
|
|
|
|
|
| beeper - Thu Jun 14, 2012 5:01 pm |
|
|
Maybe this looks a little better. |
|
|
|
| KilllerX - Fri Jun 15, 2012 2:18 am |
|
|
@beeper just so you know another way to do
if ($2 == $null)
is just
if (!$2)
the ! in coding usually signifies that the next string isn't provided, or isn't there.
to me looks neater and is fairly easier. skips unnecessary checks. by unnecessary, I mean the ($nick isop #) check, as it first checks if they aren't op, then it looks at if they are, and if $2 isn't provided, then it checks if it is.
By the way, if you want to search for a string of text use $2- instead of $2 |
|
|
|
| Jethro - Fri Jun 15, 2012 2:28 am |
|
|
| killerx, I'll suggest that you use the if-elseif-else, respectively, rather than insert a redundant else statement after the first if condition:you can unset as many variable values as you want horizontally, so you don't have to place another instance. |
|
|
|
| Lenooox - Fri Jun 15, 2012 12:55 pm |
|
|
I'm looking at this snippet, but I get error
* /msg: insufficient parameters (line 11, script1.mrc)
line 11 is : msg # %found |
|
|
|
| MoMy - Fri Jun 15, 2012 1:20 pm |
|
|
there must be a file ''logfile'' otherwise $read does not find anything and %found = $null.
I think I need a control, both on the file exists and the existence of $2 in the file. |
|
|
|