mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2003
Posts: 9
C
CWO Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
C
Joined: Oct 2003
Posts: 9
I'm kinda new to the $read and /write commands and I'm trying to find a way to remove a variable line number. Basically I have the /write command write your *!*@host or known as $address($nick,2) to a text file. Now I have

if $read(masks.txt, w, $address($nick,2)) == $address($nick,2) {

in this part of my file I want it to now delete the matching entry. I know $readn returns the line number but I cant seem to get it to be useful in the /write command. The only thing I got it to delete so far was the first line no matter what it is.
So far I have tried
/write -dl$readn masks.txt
/write -dw$readn masks.txt
/write -ds$address($nick,2) masks.txt

I know there has to be a way to get this to work. I also have tried the same after setting a variable to $readn and the variable is being set to the right line number, just not working in /write. I just dont want to have to make it

If ($readn == 1) {
/write -dl1 masks.txt
}
If ($readn ==2) {
/write -dl2 masks.txt
}

and so on... since theres going to be a whole ton of lines in this text file.

Joined: Feb 2003
Posts: 282
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Feb 2003
Posts: 282
How about:
/write -dl $+ $readn masks.txt

If you write -dl$readn, I won't work, cause mIRC doesn't recognize the $readn


When you write -dl$readn, mIRC doesn't know what you want, and $readn in this cause will be Null, so you actualy wrote

/write -dl masks.txt

Note: You can't write anothing at the left side of a $something (It will cause it to not recognize the $something), but you CAN write $somethingsomethingelse . For example:

If $readn was 3 then
//echo -a $readn.hello
will return 3.hello

and
//echo -s hello.$readn
Will return hello.

Joined: Oct 2003
Posts: 9
C
CWO Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
C
Joined: Oct 2003
Posts: 9
Thanks that worked. Didnt think you can space it out like that without it taking the number as the file name smile cool grin


Link Copied to Clipboard