mIRC Home    About    Download    Register    News    Help

Print Thread
#141509 10/02/06 01:58 PM
Joined: Jul 2005
Posts: 56
W
whoami Offline OP
Babel fish
OP Offline
Babel fish
W
Joined: Jul 2005
Posts: 56
I think this feature is useful and would help alot. Which we can handle the result and get out from the -k property. The examples tells alot..

/filter -gff [+f flag] file nul .+
The flag feature is optional.

on *:filter:{
if $fflag == test {
if $fevent == filter {
echo -a $fresult which is it the $1 in the -k property
}
elseif $fevent == filtered {
echo -a finished filtering - $filtered
}
}
}

#141510 10/02/06 02:51 PM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
This sounds like a good idea to me. I think it might be better (required) if there were a 'name' given in the filter command which corresponds to the name in the on FILTER event. The events could allow wildcards to match multiple names (like socket events do). There could also be a separate event for filter done (if this is even necessary). Sometimes parameters would need to be passed to the event, so a 'mark' command like sockmark could be used instead of global variables.

/filtermark NAME $nick $chan $etc
/filter -ff NAME infile outfile search

on *:FILTER:NAME:{
;The result should be in $1- like other events
echo -a $fname result: $1-
echo -a Filtermarks: $fmark(NAME,1-)
}

on*:FILTERDONE:NAME*:{
echo -a Finished Filtering $fname
;Filtermarks are destroyed in the FILTERDONE event
echo -a Filtermarks: $fmark(NAME,1-)
}

-genius_at_work

Last edited by genius_at_work; 10/02/06 02:52 PM.
#141511 10/02/06 10:55 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Since events dont happen untill the currently running script completes, these events would no occur straight away, should they occur straight away, I see nothing they do here, that would lead me to believe it couldnt be done using a filter -k and a command following it (to do the $fevent == filtered section), should there be a large number of filters to do in your script, and thus reproduction of the same following command over and over, then filter and following command could be grouped into an alias and called from the script.

alias filter_flag {
filter $1-
if ($filtered) { echo -a finished filtering - $filtered }
:error
}

your script contains the commands such as filter_flag -fk file.txt somealiasname *fred*

* please note i havent tested any of that, but i dont see a logical problem.

#141512 11/02/06 12:33 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
on SIGNAL events can trigger in the middle of a routine, if that routine calls /signal -n. So I can't think of anything that a combination of signals and /filter -k cannot do but on FILTER could. Signals were added so that you can make your own events and this is exactly the type of event that should be left to signals imo.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#141513 11/02/06 01:32 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Agreed, i knew of signals tripping imediately, i just didnt want to confuse my point by saying since i dont even see the need for an event (On SIGNAL or ON FILTER).

I have actually asked this before, and while answered, i didnt really see a valid purpose to them, What is the point of doing a signal event?
The only practicle use I can see for it is if you are trying to write completely compartmentalised code, that triggers events and IF the script files that react to that event are loaded then and only then well they trigger. (of course an event does have the advantage that it might trip off in 3 sepearte script files, but i done really see the point to that in ON FILTER, like when you ever going to Filter something and want multiple scripts going off dependent ofn your results..... hmmm now that i say that i can start to think of abstarct ideas where that might be used.

Still a ON SIGNAL would be fine for it.

#141514 11/02/06 01:54 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Yeah the main purpose of signals is modularity, especially the fact that different scripters can write modules for a 'core' script that includes a predefined set of /signal commands.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com

Link Copied to Clipboard