mIRC Homepage
Posted By: whatsthedillio $readn overwrite help - 13/08/04 09:28 PM
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
Posted By: Coolkill Re: $readn overwrite help - 13/08/04 10:11 PM
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.
Posted By: whatsthedillio Re: $readn overwrite help - 14/08/04 08:51 AM
it wont overwrite the text thats there,
i need to update it so it overwrites the old stuff
?
Posted By: Coolkill Re: $readn overwrite help - 14/08/04 09:03 AM
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.
Posted By: whatsthedillio Re: $readn overwrite help - 14/08/04 09:14 AM
ok,
thanks :P
Posted By: starbucks_mafia Re: $readn overwrite help - 14/08/04 11:07 AM
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-)
© mIRC Discussion Forums