mIRC Home    About    Download    Register    News    Help

Print Thread
$readn overwrite help #94093
13/08/04 09:28 PM
13/08/04 09:28 PM
Joined: Jun 2004
Posts: 291
Uk
W
whatsthedillio Offline OP
Fjord artisan
whatsthedillio  Offline OP
Fjord artisan
W

Joined: Jun 2004
Posts: 291
Uk
can someone pls tell me why this wont work?
______________________________________________________
on *:TEXT:*:#: {
if ($xpack($1-)) {
if ($read("Website Database\db.txt", s, $nick)) {
write -dl $+ $readn "Website Database\db.txt" $nick $+ _ $+ $1 $+ = $+ $chan $+ = $+ $4-
}
else
write -i "Website Database\db.txt" $nick $+ _ $+ $1 $+ = $+ $chan $+ = $+ $4-
}
}
}
_____________________________________________________
pls help
thanks alot
laugh

Re: $readn overwrite help #94094
13/08/04 10:11 PM
13/08/04 10:11 PM
Joined: Dec 2002
Posts: 788
Wales, United Kingdom.
C
Coolkill Offline
Hoopy frood
Coolkill  Offline
Hoopy frood
C

Joined: Dec 2002
Posts: 788
Wales, United Kingdom.
on *:TEXT:*:#: {
if ($xpack($1-)) {
if ($read("Website Database\db.txt", s, $nick)) {
write -dl $+ $readn "Website Database\db.txt" $nick $+ _ $+ $1 $+ = $+ $chan $+ = $+ $4-
}
else {
write -i "Website Database\db.txt" $nick $+ _ $+ $1 $+ = $+ $chan $+ = $+ $4-
}
}
}

Perhaps, what exactly is it not doing.

Eamonn.

Re: $readn overwrite help #94095
14/08/04 08:51 AM
14/08/04 08:51 AM
Joined: Jun 2004
Posts: 291
Uk
W
whatsthedillio Offline OP
Fjord artisan
whatsthedillio  Offline OP
Fjord artisan
W

Joined: Jun 2004
Posts: 291
Uk
it wont overwrite the text thats there,
i need to update it so it overwrites the old stuff
?

Re: $readn overwrite help #94096
14/08/04 09:03 AM
14/08/04 09:03 AM
Joined: Dec 2002
Posts: 788
Wales, United Kingdom.
C
Coolkill Offline
Hoopy frood
Coolkill  Offline
Hoopy frood
C

Joined: Dec 2002
Posts: 788
Wales, United Kingdom.
If the item in the file exists, it deletes the line, otherwise it inserts, from the look on your coding..

write -iline-number "Website Database

if you want to add it to the end, remove the -i

Eamonn.

Re: $readn overwrite help #94097
14/08/04 09:14 AM
14/08/04 09:14 AM
Joined: Jun 2004
Posts: 291
Uk
W
whatsthedillio Offline OP
Fjord artisan
whatsthedillio  Offline OP
Fjord artisan
W

Joined: Jun 2004
Posts: 291
Uk
ok,
thanks :P

Re: $readn overwrite help #94098
14/08/04 11:07 AM
14/08/04 11:07 AM
Joined: Dec 2002
Posts: 2,962
Norwich, UK
S
starbucks_mafia Offline
Hoopy frood
starbucks_mafia  Offline
Hoopy frood
S

Joined: Dec 2002
Posts: 2,962
Norwich, UK
If you just want to replace the line if it's there and append it if it's not then you can use this:
Code:
on *:TEXT:*:#:if ($xpack($1-)) write -s $+ $nick "Website Database\db.txt" $+($nick, _, $1, =, $chan, =, $4-)


Spelling mistakes, grammatical errors, and stupid comments are intentional.