File Accessing

Posted by Rynok on Sat 22 Jul 2006 02:02 PM — 7 posts, 26,786 views.

USA #0
Any reason why Mushclient can't find any files for reading/writing?
Here is an error I get:
cannot read DataManip.lua: No such file or directory
stack traceback:
[C]: in function `dofile'
[string "Script file"]:2: in main chunk

I also took out the dofile() and I put the code directly into my main script, but then I tryed to run it and it said it could not get one of my text files that had all the data in it (another could not read error). Apparently it is having trouble reading the data, but I'm not sure why.
USA #1
Ok, I figured it out. As it turns out, you have to have your script (and all other files) in the same folder as you have your world file (WorldFile.Mcl)
Australia Forum Administrator #2
Doing a dofile without a path is going to take whatever the current directory is.

I would use GetInfo (59) to find the script file path, and prepend that to the file name. Or, at least hard-code a pathname in.

http://www.gammon.com.au/scripts/doc.php?function=GetInfo
USA #3
Yep, they were in the default directory so it should of worked. I figured out what the problem was. At first I thought it was the location of the world file. As it really turns out, it has to do with the plugins you use. I added the ColourNote plugin and it gave me those errors like the files didn't exist, and a simple reloading of the script CTRL+SHIFT+R didn't work. I went to the control itself, told it which script to run, said "OK" and it worked after that.

Not sure why it was having trouble due to an added plugin, but that seems to be the problem, although repointing to the script fixed it.
Australia Forum Administrator #4
I'm pretty sure there was a post about that recently, but can't find it.

It is something to do with the default plugins directory. You could try setting global preferences to point the plugins directory to the right place, although it sounds like you have solved it.
USA #5
Where would I access the default plugin directories under global preferences? (in case I wanted to use a plugin)

I looked for it under the different tabs but didn't see anything on it.

Thanks
Australia Forum Administrator #6
Global Preferences -> Plugins -> Plugins Directory (near the bottom of the dialog).