mIRC Home    About    Download    Register    News    Help

Print Thread
#56166 19/10/03 06:36 PM
Joined: Oct 2003
Posts: 4
D
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Oct 2003
Posts: 4
trying to debug a simple script to use as an example the problem seems to be mirc wont read the file i put the txt file in the main mirc directory

on 1:TEXT:*!test*:#:/msg $chan test $read($mircdir/quote.txt)


it does output to the channel "test" but nothing from the txt file
this is using mirc6.1
thanks for any ideas

#56167 19/10/03 06:40 PM
Joined: Jun 2003
Posts: 994
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Jun 2003
Posts: 994
you wanting to read one line? or the entire text file?


I refuse to engage in a battle of wits with an unarmed person. wink
#56168 19/10/03 06:42 PM
Joined: Oct 2003
Posts: 4
D
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Oct 2003
Posts: 4
just one line

#56169 19/10/03 06:45 PM
Joined: Jun 2003
Posts: 994
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Jun 2003
Posts: 994
try this

on 1:TEXT:*!test*:#: msg $chan test $read(quote.txt)


I refuse to engage in a battle of wits with an unarmed person. wink
#56170 19/10/03 06:51 PM
Joined: Oct 2003
Posts: 4
D
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Oct 2003
Posts: 4
same problem just outputs test

#56171 19/10/03 06:55 PM
Joined: Oct 2003
Posts: 4
D
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Oct 2003
Posts: 4
nevermind i found the problem lol i named my text file quote.txt which made the file name qoute.txt.txt now i can only hope all the hair i pulled out will grow back

#56172 19/10/03 06:55 PM
Joined: Jun 2003
Posts: 994
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Jun 2003
Posts: 994
then the quote.txt either doesn't exist, or is not in the main mirc folder

works perfectly here


I refuse to engage in a battle of wits with an unarmed person. wink
#56173 20/10/03 03:31 AM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
In addition to the other posts, I'd like to mention it's safer to always use $read(file,n). The n switch prevents variables and identifiers in the line from being evaluated.

Evaluation means if you have $me in the file, using //echo $read(file) will show your current nickname. This can easily turn to be harmful if you allow other users to add quotes to the database with a command.

If, for example, they know your password is stored in %mypass they can add a "quote" with that variable, and requesting the quote will cause your password to be displayed on their screen.

Or even worse, if a bad guy puts a harmful identifier (like $findfile() with a /remove command that will be executed on any file found) inside a quote, the identifier will be evaluated next time your script $read's it, and you'll will end up with your hard drive being wiped crazy


Link Copied to Clipboard