mIRC Home    About    Download    Register    News    Help

Print Thread
#136483 28/11/05 08:36 PM
Joined: Nov 2005
Posts: 1
J
jpc2879 Offline OP
Mostly harmless
OP Offline
Mostly harmless
J
Joined: Nov 2005
Posts: 1
Is it possible to script a command that makes my fserve reject a list of filenames contained on a .txt file using wildcards???

ignore= on mirc.ini will only allow 956 chars (1 single line) and I need more chars available

it must be something related with dcc reject, but the truth is that I have no idea about scripting

any help is welcome

tnx in advance,

#136484 29/11/05 12:51 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Two codes here: The first checks for the filename against the entries in the text file and if the filename is in the text file then the code halts.
Code:
 on *:dccserver:Send:{
if $read(badfiles.txt,w,$+(*,$filename,*)) { halt }
}
 

The second, which I wrote after re-reading your request, checks a wildcard entry in the text file against the name of the file the person is trying to send.
Personally, based upon your request, I think the second code is the one you actually want.

Code:
 on *:dccserver:Send:{
  var %a = 1
  while %a <= $lines(badfiles.txt) {
    if $read(badfiles.txt,%a) iswm $filename { halt }
    inc %a
  }
}
 

#136485 29/11/05 08:44 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
while %a <= $lines(badfiles.txt)

Barh! your reading the length of the file for each recusion of the loop!

Code:
on *:dccserver:Send:{
  var %a = $lines(badfiles.txt)
  while (%a) { 
    if $read(badfiles.txt,nt,%a) iswm $filename { halt }
    dec %a
  }
}


however even better might be

Code:
on *:dccserver:Send:{
  hfree -w badfile.list.hashtable | hmake badfile.list.hashtable | hload -n badfile.list.hashtable badfiles.txt
  if ($hfind(badfile.list.hashtable,$filename,1,W).data) { halt }
}


* is $filename just the filename or the path as well ? i cant remember if its the path as well then we should be using $nopath($filename)


Link Copied to Clipboard