Thread Tools Display Modes
09-27-14, 03:55 AM   #1
ProgrammaXx
A Murloc Raider
Join Date: Sep 2014
Posts: 4
Smile import external text file and vise versa

Hello guise, im new here, but not new to programming.

Anyway, my question is what the title says, is it possible with an home-made addon to import files for readonly? i never found a documentation for wow LUA api.


psudo example of what im going to do:

1. my local JSon file is changed
2. "Lua magic"
3. the data from the JSon file is loaded


i am working with Skype4COM (Google it!), and i thought it would be fun to try "implement" skype


Cheers /pX
  Reply With Quote
09-27-14, 03:57 AM   #2
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
You cant. There is no automated way to get data into the sandbox of wow-lua. All you can do is stop the client and reload a certain file on startup.

http://wowpedia.org/World_of_Warcraft_API
http://wowprogramming.com/docs/api
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote
09-27-14, 04:03 AM   #3
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
Reloading the UI will write to the config file then read from it. It might be possible to do some magic there. :P

But it's not a very user friendly way to communicate outside the lua environment.
__________________
Profile: Curse | Wowhead
  Reply With Quote
09-27-14, 04:04 AM   #4
Sharparam
A Flamescale Wyrmkin
 
Sharparam's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2011
Posts: 102
In addition to what Rilgamon said, you can avoid restarting the entire client (and get away with a /reload command), if the file you want to write to exists in the addon at load time. So you'd have some file data.lua that your external app writes to, and after a /reload in-game, the data would be available.
  Reply With Quote
09-27-14, 04:22 AM   #5
ProgrammaXx
A Murloc Raider
Join Date: Sep 2014
Posts: 4
hmm okay, so its not possible to refresh the addon without using /reload, thats sad for me


@Vlad im not sure what you are saying?



I will take a look at these links Rilgamon, thanks

/pX


edit: the /reload function must go through some steps, isnt it possible to only run the needed /reload functions so u dont get that loading screen?

Last edited by ProgrammaXx : 09-27-14 at 04:25 AM.
  Reply With Quote
09-27-14, 04:42 AM   #6
Sharparam
A Flamescale Wyrmkin
 
Sharparam's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2011
Posts: 102
I don't know the specifics of the UI reloading process, but I think it's pretty safe to say that the internal functions to reload files are not available to us.
  Reply With Quote
09-27-14, 05:12 AM   #7
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
If you find a way to (re)load external files this is a breach of security. Those limitations are here for a reason.
So you should not look into ways to pass by this functions.
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » import external text file and vise versa


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off