WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   I/O question (https://www.wowinterface.com/forums/showthread.php?t=2167)

nalmeth 10-22-05 05:10 PM

I/O question
 
Alright, I'm relatively new to WOW addons, but not to programming. I spent a few days and learned some lua. I've written a few small things just to get the hang of it. Now i'm working on a larger project and have come across a problem. I am trying to use the following

Code:

io.input("localpathtofile");
What happens is that when my addon loads up I call a function that has this line in it, but WOW barfs back an error. I have a Addmessage() line right before this that does display properly, but the one after the io line does not display at all. I thought possibly it was because the path must be relative to the Interface directory and I tried adjusting it, but that did not work either. Is this function allowed? Please help me out here. I've tried posting a few places with no response. (This mod has no dependencies).

Gello 10-22-05 09:57 PM

It's intentionally not allowed. All file i/o is denied. The game goes to extreme lengths to prevent real-time information from going in or out of the game. As an example, when you /chatlog, instead of writing as new stuff is added, it holds your chat history session in game and won't even write it out on a /script ReloadUI(), it waits until you exit the game completely. There are loopholes still but they'll be closed off in time.

Your best best in saving information is SavedVariables.lua, or the chat logs. These can't update in realtime.

nalmeth 10-23-05 10:17 AM

io
 
It's not that i'm using it for variable saving. I realize there's already a built-in method for that. I can also see why blizzard would disable any output, but why the input?

Basically I'm trying to parse a file that is generate by another program. My parser works fine using the lua interpreter, but errors on that function in wow. /sigh. So there's no work-arounds for this? (that are not against tos)

Gorak 10-24-05 01:27 AM

There's no way to read or write files from inside World of Warcraft. To store variables between gaming sessions, you use SavedVariables command in the TOC file.

This is a limitation we have to live with, and quite frankly, I am 100% happy that this feature is there. Looking at the flexibility available for add-ons, this doesn't seem to limit their creativeness or complexity. The sad fact is that you just have to do whatever it is you're trying to, in a different manner, without external programs.


All times are GMT -6. The time now is 02:27 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI