ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   AddOn Search/Requests (https://www.esoui.com/forums/forumdisplay.php?f=165)
-   -   Create a File at Login (https://www.esoui.com/forums/showthread.php?t=8113)

TheIvoryKitty 10/21/18 01:44 PM

Create a File at Login
 
Hey guys. I've never written an add-on before. I am trying to find out whether I can write a file out (externally) on character login. I tried to do something like this:

function MyAddon:Initialize()
file = nil
file = io.open("../test.txt", "w")
file:write("test me!")
file:close()
end

But I receive a nil error, so, apparently something about that is not correct. I code in Java for a living; don't really know anything about LUA. Any help would be appreciated!

sirinsidiator 10/21/18 01:57 PM

The game doesn't allow direct filesystem access for obvious security reasons and also because ZOS doesn't want addons to communicate with external services in real time.

Baertram 10/21/18 02:37 PM

You are only able to use ZO_SavedVars to write to a predefined SV file in the Elder Scrolls Online/live/SsavedVariables folder.
This file will be written upon /reloadui, /logout ingame.
So again: There is no real-time update possible.

Check the esoui wiki for SavedVariables:
https://wiki.esoui.com/Circonians_Sa...ables_Tutorial

Or the forums, e.g. this thread:
https://www.esoui.com/forums/showthr...t=ZO_SavedVars

TheIvoryKitty 10/21/18 05:43 PM

Quote:

Originally Posted by Baertram (Post 36345)
You are only able to use ZO_SavedVars to write to a predefined SV file in the Elder Scrolls Online/live/SsavedVariables folder.
This file will be written upon /reloadui, /logout ingame.
So again: There is no real-time update possible.

Check the esoui wiki for SavedVariables:
https://wiki.esoui.com/Circonians_Sa...ables_Tutorial

Or the forums, e.g. this thread:
https://www.esoui.com/forums/showthr...t=ZO_SavedVars

Hey, that seems useful! I really just want to know if ESO is logged in in general, so, that would probably do the trick. :)

sirinsidiator 10/22/18 01:12 AM

Not sure I understand your use-case, but wouldn't it be enough to check if eso64.exe is running? Most of the time that would be equal to being logged in, wouldn't it? :D


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

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