mIRC Home    About    Download    Register    News    Help

Print Thread
write command problem #100374 12/10/04 10:53 AM
Joined: Jul 2004
Posts: 14
B
BlueFire Offline OP
Pikka bird
OP Offline
Pikka bird
B
Joined: Jul 2004
Posts: 14
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

Last edited by BlueFire; 12/10/04 10:56 AM.
Re: write command problem #100375 12/10/04 12:32 PM
Joined: Aug 2003
Posts: 314
S
Sigh Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2003
Posts: 314
You need to surround it with quotes so mIRC recognizes it as a single parameter, /write -ds $+(",$2-,") %ps.file

Re: write command problem #100376 13/10/04 03:34 AM
Joined: Jul 2004
Posts: 14
B
BlueFire Offline OP
Pikka bird
OP Offline
Pikka bird
B
Joined: Jul 2004
Posts: 14
Thanks alot Sigh, that really fixed the problem laugh

Re: write command problem #100377 15/12/04 04:38 AM
Joined: Jul 2004
Posts: 14
B
BlueFire Offline OP
Pikka bird
OP Offline
Pikka bird
B
Joined: Jul 2004
Posts: 14
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