mIRC Homepage
Posted By: BlueFire write command problem - 12/10/04 10:53 AM
Hi all, i had a problem with this code below:

ctcp *:!dead *:*:{
inc %count
set %lastdelete $nick
set %ps.freedel $2-
write -ds %ps.freedel %ps.file
.notice $nick $read(%findreply,7)
halt
}

the file.txt (%ps.file) i had looks like this:

somethingblahblah
somethingblahblahblah
somethingsomething
and so on.. (all lines without space)

So, if the users write /ctcp $nick !dead somethingblahblah or /ctcp $nick !dead somethingblahblahblah it will removed those lines nicely (as there is no space) but if the user extra hit /ctcp $nick !dead somethingblahblah 2 (which is not same as the lines inside the file.txt) it will try to write/create a file 2.txt on mirc folder with C:\mIRC\system\file.txt inside as text

Is there any way to fix that problem ?

I hope that i explained as detailed as enough smile Thanks in advance for the help laugh
Posted By: Sigh Re: write command problem - 12/10/04 12:32 PM
You need to surround it with quotes so mIRC recognizes it as a single parameter, /write -ds $+(",$2-,") %ps.file
Posted By: BlueFire Re: write command problem - 13/10/04 03:34 AM
Thanks alot Sigh, that really fixed the problem laugh
Posted By: BlueFire Re: write command problem - 15/12/04 04:38 AM
Hi again,

Sigh helped me with this code and it works nicely...
Code:
ctcp *:!dead *:*:{ 
  set %ps.freedel $2-
  write -ds $+(",$2-,") %ps.file
  .notice $nick Successfully Removed :)
  halt
}

Inside file.txt (all without space) :
Code:
somethingsomething
blahblahblah
blahblah

The problem is that sometimes they will type extra text after somethingsomething, how do i add a notice telling them it is wrong command instead of noticing back it is "successfully removed" ?

Also, can u please add kick/ban if they flooded me with that command 3 times in row ?

I think it is better to stick with this thread instead of opening a new thread for the same code problem smile

Thanks in advance laugh
© mIRC Discussion Forums