mIRC Home    About    Download    Register    News    Help

Print Thread
#18843 11/04/03 10:14 AM
Joined: Jan 2003
Posts: 11
E
Ecks Offline OP
Pikka bird
OP Offline
Pikka bird
E
Joined: Jan 2003
Posts: 11
I'm trying to write a fairly large bot script that will be able to modify itself through commands given in text in chats. The problem that has come up is that while searching for a way to write this, I noticed that under the writeini help file it says not to modify the ini files while in use. So do I unload the script, modify it, and then load it back up?

Next question, it says that it will try two write to a file that is larger than 64k. Does this mean that it will try and sometimes work, or what exactly will happen?

Sorry for the fairly basic questions, but I couldn't find any answers in the forums or help files anywhere. It's a shame the forums are cleaned to 7 pages often. A lot of information is lost that way =\.

-Ecks

Joined: Feb 2003
Posts: 47
G
Ameglian cow
Offline
Ameglian cow
G
Joined: Feb 2003
Posts: 47
I think the comment in the help file is meant for ini files in use by mIRC (the ini files the program itself is using, not by user-scripts).
If mirc tries to read or write to a file at the same time you are doing something similar then mirc's action on the ini file will fail, thus resulting in unexpected results for mirc (possibly a crash?).
I never seen it happen at home but i don't really use mirc's own ini files.

For you second question, the 64K maximum has probably got something to do with the memory allocated to the writeini function call.
I don't know how this exactly works but i think it just doesn't garantuee that there is enough free memory available beyond 64K which might make the function call fail.

If you don't want to take the risk then just split your stored information over several ini files (makes it more readable for you as well).

just my 2 cents, grtz

Joined: Jan 2003
Posts: 11
E
Ecks Offline OP
Pikka bird
OP Offline
Pikka bird
E
Joined: Jan 2003
Posts: 11
Ah, that writeini thing makes sense now. I couldn't figure out why editing it through the mirc interface was fine, but wouldn't be if a script did it. It's all clear to me now. Thanks smile.

-Ecks

Joined: Sep 2003
Posts: 5
Z
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
Z
Joined: Sep 2003
Posts: 5
Heya..

I'm trying to build a little fileserver script (doesn't mather i guess), but all the scripts configs are stored in a ini-based file. (such as triggers, downloads, fails, etc) .. The fileserver itself has become stable enough for personal beta testing, so everynight when i go to sleep, I keep my script running to be able to find bugs the morning after.. Two days in a row now, mIRC has got an "Unexpected error" abd crashed.. frown Does this has to do with "writing/reading to the same file at the same time" ? I'm using mIRC 6.12 under Windows XP Pro (swedish).. Any solution to this?

Regards,
Jesper 'Z3l3zT' Wallin

Last edited by Z3l3zT; 13/12/03 06:22 AM.

Link Copied to Clipboard