mIRC Home    About    Download    Register    News    Help

Print Thread
#183664 21/08/07 05:27 PM
Joined: Aug 2007
Posts: 6
K
Kevvin Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
K
Joined: Aug 2007
Posts: 6
Ok, so i have been messing with 6.3 for a while now, and found that, when i update a file, i.e pelts.txt

and use $read(pelts.txt) It will use old written information.

For example, i have updated my text file to <NOT CONTAIN THE FOLLOWING>
<Kevin> gets a knife and kills digweed.
<Kevin> gets a knife and kills digweed.
----
Below you will find what pelts.txt really contains.
<Kevin> hm
<Kevin> see
<Kevin> yet
<Kevin> my file has this saved
<Kevin> throws +username+ in the bush
<Kevin> makes sweet love to +username+..... With a razor blade

The only way i can seem to get this updated, is by closing mirc and re-opening it.

Kevvin #183667 21/08/07 05:40 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
I can't reproduce this here, and I wouldn't really expect to. $read re-opens the file for each call and doesn't keep any kind of cache to my knowledge.

It's more likely to be a problem with your script. If you're calling $read on a timer make sure it's evaluated when the timer fires, not when you start it. The same goes for other commands, notably /scon.

For example, this would read a random line from versions.txt before starting the timer and then send it to #channel twice:
Code:
alias readtest {
  .timer 2 5 msg #channel $read(versions.txt,n)
}
Whereas this would read a random line from versions.txt each time the timer fires:
Code:
alias readtest {
  .timer 2 5 msg #channel $!read(versions.txt,n)
}

Collective #183678 21/08/07 07:38 PM
Joined: Aug 2007
Posts: 6
K
Kevvin Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
K
Joined: Aug 2007
Posts: 6
There are no timers involved, infact, I didnt encounter this problem until i upgradded to 6.3.

Kevvin #183680 21/08/07 07:54 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Can you provide a script that reproduces the problem?

Collective #183689 21/08/07 09:44 PM
Joined: Aug 2007
Posts: 6
K
Kevvin Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
K
Joined: Aug 2007
Posts: 6
on *:input:#: {
if ($1 == !pelt) { msg $chan $replace($read(pelts.txt),+username+,$2-) | halt }
}

Kevvin #183690 21/08/07 09:51 PM
Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031
Is pelts.txt in the install folder and $mircdir is in the application data folder where $read with no path is looking for the file?

~ Edit ~

Did that make sense?

Kevvin #183691 21/08/07 09:53 PM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
I can't reproduce this here. The file is re-read each time it is updated.

What happens if you open pelts.txt in a text editor? Does it display the updated file contents?

Also, what command(s) are you using to update the file?


Spelling mistakes, grammatical errors, and stupid comments are intentional.
starbucks_mafia #183722 22/08/07 04:16 AM
Joined: Aug 2007
Posts: 6
K
Kevvin Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
K
Joined: Aug 2007
Posts: 6
if i open the file after i save it, in note-pad it shows the new content, but as for mIRC reading it, it's not working, I know what i'm talking about, i have been using mIRC for many years, I know it's not me, Maybe a bug between vista and mIRC still?

Kevvin #183723 22/08/07 04:25 AM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
The fact you just said Vista makes me think you probably are $read'ing one file and opening another in notepad. Make sure you're opening the file in $mircdir. If $mircdir is in Program Files it's also possible Vista may redirect $reads to your VirtualStore folder, so check there, too.

You could also make it easier to check by using an absolute path to a file somewhere outside of Program Files.

Kevvin #183738 22/08/07 07:54 AM
Joined: Dec 2002
Posts: 5,412
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,412
Are you storing your mirc.ini and other settings in the "Program Files\mIRC" folder? If you are, and you are using Vista, then that won't work. For Vista-compatible applications, such as mIRC 6.3, Vista does not allow writing to the "Program Files" or other protected folders and does not use the Virtual Store folder to redirect non-compatible read/write requests.


Link Copied to Clipboard