Thread Tools Display Modes
06/16/20, 01:08 AM   #1
remosito
AddOn Author - Click to view addons
Join Date: Dec 2019
Posts: 30
Addon Folder Path ingame

Edit: Have a workaround to needing the path...

Howdie all,

is there a way to get my hands on the full Addon folder path?

Not just the user:/Addons/xyz I get from GetAddOnRootDirectoryPath(index)

But "C:\Users\winusername\Documents\Elder Scrolls Online\live\AddOns"

any help very much appreciated

remosito

Last edited by remosito : 06/16/20 at 02:04 AM.
  Reply With Quote
06/16/20, 01:39 AM   #2
remosito
AddOn Author - Click to view addons
Join Date: Dec 2019
Posts: 30
Might be the path won't do me any good...

just found out that RequestOpenUnsafeURL() seems to not open URLs of the type "file:///path"

Any way to circumvent that?

Alternatively:

- Any way to create a json post request with lua that will run?
- Anybody would by chance know a free place to host a http get request parameter to json send message wrapper html page?

crude version:
Lua Code:
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.   <head>
  4.     <meta charset="UTF-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6.     <title>Display Leads - Location Updater</title>
  7.   </head>
  8.   <body onload="sendMessage()">
  9.     Your Location Data update has been sent. <br>Many thanks!
  10.    
  11.   </body>
  12.  
  13.   <script>
  14.  
  15.     const queryString = window.location.search;
  16.     console.log(queryString);
  17.     const urlParams = new URLSearchParams(queryString);
  18.     var pa = urlParams.get('a')
  19.    
  20.     function sendMessage() {
  21.       var request = new XMLHttpRequest();
  22.       request.open("POST", "https://discord.com/api/webhooks/722214307370238005/_8RkXXwvQQ_LDsDD40_s-UR_X0sPdabmgkQ6ovMmQ8mYd9LzZbTGoIzuZeHkb-kay4VL");
  23.  
  24.       request.setRequestHeader('Content-type', 'application/json');
  25.  
  26.       var params = {
  27.         username: "rdlupdates",
  28.         avatar_url: "",
  29.         content: pa
  30.       }
  31.  
  32.       request.send(JSON.stringify(params));
  33.     }
  34.   </script>
  35. </html>
  Reply With Quote
06/16/20, 02:06 AM   #3
remosito
AddOn Author - Click to view addons
Join Date: Dec 2019
Posts: 30
github pages

Tried github pages to host my "http get request to json post send wrapper" page and it works :-)

Can send Location data updates to a discord channel.


Leaving thread for google to pick up.
  Reply With Quote
06/16/20, 03:05 AM   #4
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
RequestOpenUnsafeURL() only supports http and https so far as I know.
We had asked to support other links like teamSpeak3, discord etc. as well.

Curious how this works:
You save some data to the SavedVariables of an addon and let an external source (script, executable) parse the SV file + send it as http request then?
As SV will only be updated at reloadui/logout normally: Do you use the "priority update of small data to the SavedVariables" that Zos introduced?

Edit:
Oh I understood it now You use the http link of the github website and RequestOpenUnsafeURL() with the location data as URL ?a=<parameter>

Last edited by Baertram : 06/16/20 at 03:08 AM.
  Reply With Quote
06/16/20, 03:53 AM   #5
remosito
AddOn Author - Click to view addons
Join Date: Dec 2019
Posts: 30
Originally Posted by Baertram View Post
RequestOpenUnsafeURL() only supports http and https so far as I know.
We had asked to support other links like teamSpeak3, discord etc. as well.

Curious how this works:
You save some data to the SavedVariables of an addon and let an external source (script, executable) parse the SV file + send it as http request then?
As SV will only be updated at reloadui/logout normally: Do you use the "priority update of small data to the SavedVariables" that Zos introduced?

Edit:
Oh I understood it now You use the http link of the github website and RequestOpenUnsafeURL() with the location data as URL ?a=<parameter>
Exactly :-)

The github website then forwards the "a" parameter as a json post to my discord channel webhook.
Which just posts it as a new message there.

Quite the wild hack but seems to work...

Last edited by remosito : 06/16/20 at 03:57 AM.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Addon Folder Path ingame

Thread Tools
Display Modes

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