mIRC Home    About    Download    Register    News    Help

Print Thread
#94093 13/08/04 09:28 PM
Joined: Jun 2004
Posts: 291
W
Fjord artisan
OP Offline
Fjord artisan
W
Joined: Jun 2004
Posts: 291
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

#94094 13/08/04 10:11 PM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
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.

#94095 14/08/04 08:51 AM
Joined: Jun 2004
Posts: 291
W
Fjord artisan
OP Offline
Fjord artisan
W
Joined: Jun 2004
Posts: 291
it wont overwrite the text thats there,
i need to update it so it overwrites the old stuff
?

#94096 14/08/04 09:03 AM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
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.

#94097 14/08/04 09:14 AM
Joined: Jun 2004
Posts: 291
W
Fjord artisan
OP Offline
Fjord artisan
W
Joined: Jun 2004
Posts: 291
ok,
thanks :P

#94098 14/08/04 11:07 AM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
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.

Link Copied to Clipboard