Ok. This is easier than the script
here , but you might identify the similar structure:
1) An on text event for the !trigger. Here further flood protection/a restricted access to the trigger etc might be added.
2) Now it scans for all (matching on *.ini) files of a specific directory. A command, (in this case: "searchini") is performed on each matching file.
3) This searchini-command (an alias) does the actual in-file search, this time it's a $readini command (the other script used /filter). The result ("matches") of each in-file search is written to a temporary file. All the results thus sum up in this temporary file (and you can format the desired output here).
4) After all the files had been processed by the command, it will check if there had been any matches (=is there a tempfile?). If this is true, the tempfile is "played" to the channel (which is a good way to prevent message flood, and in fact that's why I used a temp-file at all
). The tempfile can now be removed.
on *:text:!searchini:#YOURCHANNEL: {
var %dir = $mircdir $+ ini
noop $findfile(%dir,*.ini,0,searchini $1-)
if ($isfile(searchiniresults.txt)) {
.play -q5m3 $chan searchiniresults.txt 500
.remove searchiniresults.txt
}
}
alias -l searchini {
if ($readini($1-,settings,name)) {
write searchiniresults.txt INI: $nopath($1-) VALUE: $v1
}
}