you want to do this when a file is created by mIRC in a folder .. ir when a file is created by any means in a folder (for example even if you created it manualy in windows, or if anouther program besides mIRC created it) ???

there is no event in mIRC that trigers when a new file is created. so beings there is no event for it, the only way you can know if any new file is created (be it from mIRC or not) in a given folder u would have to manualy monitor the contents of that folder ..

write an alias to check to see if a new file is in the folder .. to do this you would obviously have to know what files were already in that folder, so the first time the alias runs u will need to store in memory somehow the current contents of the folder. . be it by varable, hash table, ini file .. or however .. then u need to compair the current contents with the old .. use $findfile()

have the alias do whatever it is you want it to do when a new file is created.

now that you have an alias to check for a new file, and beings we have no event that automaticly trigers, u will have to have a timer run the alias every so often to check the folder manualy.

timer 0 30 newfile.chk

for example .. asuming the name of your aliases in this case is 'newfile.chk' .. this timer will run the alias once every 30 seconds (which i'd guess would be sufficent)

and your alias would then do whatever it is your wanting to do.

if you need help writeing the specific alias let us know, but that should be fairly simple for you.


if you want something that trigers only when a new file is created by a script .. u could write your own write { } and writeini { } identifers to check to see if the file your trying to write to already exists or not, if not then u know mIRC will creat a new file after execution ..

for example
Code:
write {
  if (!$exists($$1)) { ; it will be a new file, do whatever }
  !write $1 $2-
}


hope this answered your question.

Cobra^