WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   import external text file and vise versa (https://www.wowinterface.com/forums/showthread.php?t=49982)

ProgrammaXx 09-27-14 03:55 AM

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

Rilgamon 09-27-14 03:57 AM

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

Vlad 09-27-14 04:03 AM

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.

Sharparam 09-27-14 04:04 AM

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.

ProgrammaXx 09-27-14 04:22 AM

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?

Sharparam 09-27-14 04:42 AM

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.

Rilgamon 09-27-14 05:12 AM

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.

ProgrammaXx 09-27-14 05:58 AM

Well 2 bad, anyway, thanks for the answers :banana:


cheers pX

elcius 09-27-14 06:33 AM

There are actually a few ways you can read in data without a reload, load-on-demand addons get parsed at load time, so can be changed while the game is running but before the addon is loaded, however once loaded they can't be reloaded, obviously you can get around it by making & updating multiple separate addons and loading them when you want an update, but that is hardly an acceptable solution, because the reloads are finite and makes a mess of the addon folder.

A slightly cleaner but harder to implement solution is texture size scanning, texture files are purged from memory when they are no longer being used, and as such can be reloaded live, unfortunately the only information provided by the client about a texture are its dimensions.
But in theory you can have an external application feeding data into the client by constantly resizing the texture file, the bit-rate for communication will be quite restricted, as it depends on the maximum texture size that can be loaded in game, wow requires a power of 2 for texture resolution, assuming a limit of 65536x65536 (2^16, dunno real limit) it gives you 16 possible height values and 16 possible width values, for a payload of 1 byte.

ProgrammaXx 09-27-14 08:36 AM

Quote:

Originally Posted by elcius (Post 297250)
There are actually a few ways you can read in data without a reload, load-on-demand addons get parsed at load time, so can be changed while the game is running but before the addon is loaded, however once loaded they can't be reloaded, obviously you can get around it by making & updating multiple separate addons and loading them when you want an update, but that is hardly an acceptable solution, because the reloads are finite and makes a mess of the addon folder.

A slightly cleaner but harder to implement solution is texture size scanning, texture files are purged from memory when they are no longer being used, and as such can be reloaded live, unfortunately the only information provided by the client about a texture are its dimensions.
But in theory you can have an external application feeding data into the client by constantly resizing the texture file, the bit-rate for communication will be quite restricted, as it depends on the maximum texture size that can be loaded in game, wow requires a power of 2 for texture resolution, assuming a limit of 65536x65536 (2^16, dunno real limit) it gives you 16 possible height values and 16 possible width values, for a payload of 1 byte.

hahah, i like the idea but as you said, hardly a solution for 1 byte.

/pX

Seerah 09-27-14 12:05 PM

Quote:

Originally Posted by elcius (Post 297250)
But in theory you can have an external application feeding data into the client by constantly resizing the texture file,

If an external application messes with anything in the client while it's running, that's against the TOU.

elcius 09-27-14 12:11 PM

so the curse client is against the tou if i use it to update an addon while logged in?

Fizzlemizz 09-27-14 12:40 PM

Once addons are loaded, they're not re-read until the next login so Curse technically can't mess with anything while the client is "running".

elcius 09-27-14 12:49 PM

The curse client just dumps the new files into the addon directory, a /reload would load the newly downloaded addons, redrawing any textures would show the newly downloaded version, even before a reload, same with sound files and fonts.
If you're saying modifying addon files while the game is running is against the TOS, then it's against the TOS to update your addons while the game is running.

Seerah 09-27-14 01:00 PM

The Curse Client (or our Minion) isn't altering anything in the client. It's altering the addon files. The new contents of the files aren't *in the client* until you reload your UI.

elcius 09-27-14 01:28 PM

Except for texture files, which can be updated without a reload, IE exactly what i said.

SDPhantom 09-29-14 01:00 PM

Manipulating game and/or addon data for the sole purpose of bypassing the sandbox feature of the addon system is against the ToU. Addon clients like Curse and Minion don't attempt any exploit to achieve this and are therefore allowed. As hacks and exploits are illegal and WoWI is an official Blizzard community site, any further discussion of this is dangerously close to violating the rules of this forum as well.


All times are GMT -6. The time now is 05:05 PM.

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