mIRC Homepage
Posted By: LordoftheX DCC script - 14/01/05 08:30 PM
ok, what I am trying to accomplish is this.

I am set on auto-get DCC of a certain filename ( *.dxm) and I want it where, when the file is sent, the script looks at a certain part of the file name, and puts that part down in a hash table

44file.dxm <- I want it to record the 44 part in the hash table
Posted By: DaveC Re: DCC script - 14/01/05 09:02 PM
this trips off when you get sent the file, Although it might be better if u really did this when you have recieved the file intacked.

Code:
ctcp *:DCC SEND *file.dxm *:?:{
  if (*file.dxm iswm $nopath($filename)) {
    var %number = $left($nopath($filename),-8)
    .... jam %number into your hash table here how ever you want to ...
  }
}

^^ thats untested but looks right, i double check the filename becuase im kinda open matching for filename, in the On event, ie someone might send a file called "big dump of all file.dxm files in text format.txt" and it would match, but the later check on $filename would fail.

this might be what you want really, it goes off after the file is recieved.

Code:
on *:FILERCVD:*file.dxm:{
  var %number = $left($nopath($filename),-8)
  .... jam %number into your hash table here how ever you want to ...
}
Posted By: Iori Re: DCC script - 14/01/05 10:23 PM
Code:
on $*:filercvd:/^(\d+)file\.dxm$/:{
  echo -a hadd table item data here using--&gt; $regml(1)
}
Posted By: FiberOPtics Re: DCC script - 14/01/05 11:21 PM
Don't forget to escape the . dot Iori.

I'm sorry, it seems I always catch these little things when you post something, if you find it annoying, next time I won't post, let me know.

Cya
Posted By: Iori Re: DCC script - 14/01/05 11:28 PM
Good point, forgot the dot laugh
In this instance it wouldn't really matter though because ".dxm" = 1 char followed by dxm at the end of the filename.
© mIRC Discussion Forums