Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on *:text:!s *:#: {
- var %rlsmss = $strip($2)
- var %keymss = * $+ $strip($2-) $+ *
- var %resultmss = 0, %limitmss = 49, %lastmss = 0
- ; Search as long as there are matches or if we reach the limit.
- while ($len($read(C:\Internet\_MP3\db.txt,w,%keymss,%lastmss)) > 0) {
- ; Read the line that matched (so you can change "w" to "s" if you really need... and also because I can't be arsed to find how to assign a value inside the loop condition !!! DAMN mIRC Scripting !!!)
- var %matchmss $read(C:\Internet\_MP3\db.txt, $readn)
- ; Display result to channel
- .msg $chan 13[ 11SEARCH 13]-[15 $replace(%matchmss,$chr(32),$chr(32) $+ 13]-[14 $+ $chr(32)) 13]
- ; Increment the totale number of result displayed.
- inc %resultmss
- ; If we hit the limit for results, break out of the loop
- if ( %resultmss > %limitmss ) { break }
- ; Set the starting line for the next iteration of the loop
- %lastmss = $calc($readn + 1)
- }
- ; Now that search is done we can say how many results were displayed. If you want to do this before
- ; displaying results you'll need to store them before sending them to the IRC server with .msg)
- if (%resultmss == 0) {
- .msg $chan 13[ 11SEARCH 13]-[ 14Nothing found for 07 $+ %rlsmss $+ 14 in my 15dB13 ]
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement