//write -dstest test.txt deletes test from test.txt. What I'm looking for is to delete the whole line, even if it's like "test test and once again test ..." Any1 knows how that works? I already took a look on $lines(filename) but I just don't get it
/write -d only deletes one line at a time. So if you had the following two lines in a file:
test test test and test again
then use /write -dstest file.txt it will delete the first line it finds that starts with test and stop. And here is where you lose me. I'm not sure if you want it to skip the first line and delete the second line or if you want it to delete any lines that start with test. Please post more information.
on *:text:!add*:#:{
write msgs.txt $time $address
write msgs.txt $nick said: $2-
}
on *:text:!delete*:#:{
if ($address isin $read(msgs.txt)) { delete both lines which used to be added }
}
Sorry that's not what I'm looking for. Thx anyway.
The script should work with two lines: .write msgs.txt $time $address and .write msgs.txt $nick said: $2-
So if someone typs !delete and his/her Hostname ($address) is saved in msgs.txt, then the script should be able to delete both lines. Anyone got an idea how that could work?
you desire to use two lines does make it harder, but you can use $readn once the first line is found, and add 1 to it in a var, then delete the next line