Advertisement
Guest User

Untitled

a guest
May 26th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. on *:text:!s *:#: {
  2. var %rlsmss = $strip($2)
  3. var %keymss = * $+ $strip($2-) $+ *
  4. var %resultmss = 0, %limitmss = 49, %lastmss = 0
  5.  
  6. ; Search as long as there are matches or if we reach the limit.
  7. while ($len($read(C:\Internet\_MP3\db.txt,w,%keymss,%lastmss)) > 0) {
  8.  
  9. ; 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 !!!)
  10. var %matchmss $read(C:\Internet\_MP3\db.txt, $readn)
  11.  
  12. ; Display result to channel
  13. .msg $chan 13[ 11SEARCH 13]-[15 $replace(%matchmss,$chr(32),$chr(32) $+ 13]-[14 $+ $chr(32)) 13]
  14.  
  15. ; Increment the totale number of result displayed.
  16. inc %resultmss
  17.  
  18. ; If we hit the limit for results, break out of the loop
  19. if ( %resultmss > %limitmss ) { break }
  20.  
  21. ; Set the starting line for the next iteration of the loop
  22. %lastmss = $calc($readn + 1)
  23. }
  24.  
  25. ; Now that search is done we can say how many results were displayed. If you want to do this before
  26. ; displaying results you'll need to store them before sending them to the IRC server with .msg)
  27. if (%resultmss == 0) {
  28. .msg $chan 13[ 11SEARCH 13]-[ 14Nothing found for 07 $+ %rlsmss $+ 14 in my 15dB13 ]
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement