[¤1-Description¤] :
You can with this snippet search nick in the channel . For example :
if you type /searchnick m the snippet gives you all nicknames who have the letter "M" in their nicks
This is my example from my mIRC xD
/searchnick m
-> Milarkovic
-> Webcam-M0nster
-> islamabadBoY
-> American^Pie
-> Fat3maa
-> X-Women-Power
-> Rose-lady-fem
-> Dementia
-> priya-da-ice-cream-head
-> Electric^Mayhem
-> _Ho-hum-wut-now
-> Gamble
-> ysalamiri
-> mashed
-> ImTheDuDe
-> SoBiYa^Malik
-> Hamil
-> staminus
-> Smiles
-> Macan
-> karima
-> MissDior
-> Miss_Power
-> Montana
Don't forget to use MASK ( nick )
;### /searchnick | Put in your remote :)
alias searchnick {
who +cn # * $+ $1 $+ *
set -u2 %searchnick $1
.enable #searchnick
echo $color(Info2) -a <- $+ $msgt(searchnick-list,$$1,$active) $+ :
}
#searchnick off
raw 352:*:{
if ($check_serv) { haltdef }
echo $color(info) -a -> $replace($6,%searchnick,04 $+ %searchnick $+ )
}
raw 315:*:{
if ($check_serv) { haltdef }
echo $color(info2) -a <- $msgt(end-list)
.disable #searchnick
}
#searchnick end
that's not the point. your example is misleading; you suggest '/searchnick m' which seems to imply that the wildcards around 'm' are necessary to check for 'm' at any position in a nickname, whereas '/searchnick m' has the same effect.
it isn't a good idea to enclose the search term in - what if a user specifically wanted to search for a substring at the beginning or end of a nickname?
AmytiX, it'd look a lot better to have the result displayed horizontally. The vertical display looks rather "floody." Borrowing from jaytea's concept, you can do this:
alias search {
while ($fline(#,$+(*,$$1,*),$0,1).text) { tokenize 32 $1- $v1 }
echo -ag $replace($2-,$chr(32),$chr(44) $chr(32))
}
Then the search will give you all the related nicknames in this fashion: nick1, nick2, nick3, nick4 etc...
The latest mIRC versions have the ability to chop up long text and split it into the next line, (it's enabled by default) so you don't have to worry about the search result being cut off.
The use of $fline() is by far the most efficient method to search nicknames on the nicklist.
i wouldn't say it's complicated, just wasteful since it relies upon a response from the server containing data that is already computable given the information stored by the client (the pertinent data at least).
you should be using 'iswm' instead of 'isin' for it to be functionally similar to the original code. also, you may use $fline() to find nicknames that match a certain wildcarded pattern in a given channel. for example:
var %t = 1
while ($fline($chan, $1, %t, 1).text) {
echo -ag -> $v1
inc %t
}
This seems more complicated than it needs to be.
A shorter version below so you can understand my comment above.
alias searchnick {
var %t 1 | while (%t <= $nick($chan,0)) {
if ($1 isin $nick($chan,%t)) { var %snick $addtok(%snick,$nick($chan,%t),32) }
inc %t
}
$iif($isid,return,echo -ag) %snick
}
Or if you wish to keep it one name per line.
alias searchnick {
var %t 1 | while (%t <= $nick($chan,0)) {
if ($1 isin $nick($chan,%t)) { echo -ag -> $v2 }
inc %t
}
}