mIRC Homepage
Posted By: chump Search and del script - 16/12/06 03:25 PM
hi i am trying to make a script that deletes an entry from a txt file

my two text files are called nuked and unnuked..what i am trying to achieve is this

it writes to nuked txt on a on txt contaning *nuked* ect
as in

[NUKED] discovery.Channel.a.Day.In.The.Life.Of.Japan.Bracing.For.The.Big.One.HDTV.XviD-G4L]

and also writes to the unnuked.txt on the on txt *unnuked* as in..

[UNNUKED] [Discovery.Channel.a.Day.In.The.Life.Of.Japan.Bracing.For.The.Big.One.HDTV.XviD-G4L]

now what i am trying to get it to do is this..when the trigger for unnuked is displayed..it searches the nuke.txt and if it finds the match ie Discovery.Channel.a.Day.In.The.Life.Of.Japan.Bracing.For.The.Big.One.HDTV.XviD-G4L it will delete the entry from the nuke.txt but still write it to unnuked.txt

so basically it finds the whole string and deletes it from the file..i hope this makes sense..anyways any help is more then welcomed smile
Posted By: Kurdish_Assass1n Re: Search and del script - 16/12/06 07:06 PM
Quote:
[NUKED] discovery.Channel.a.Day.In.The.Life.Of.Japan.Bracing.For.The.Big.One.HDTV.XviD-G4L]

is this a file being sent? or....?
if so..this looks like a movie file..and File Sharing is illegal.
Posted By: Riamus2 Re: Search and del script - 16/12/06 08:51 PM
You could put this in an on TEXT event (or wherever you're seeing the messages).
Code:
if ($read(nuked.txt,w,* $+ $2- $+ *)) {
  write -dl $+ $readn nuked.txt
  write unnuked.txt $1-
}


This assumes that you're seeing what you displayed and that $1 is [NUKED] or [UNNUKED] and that $2- is the item.
© mIRC Discussion Forums