Thank you for your answer. In the meantime i did a small research on the forum and ended up on Havoc's module which uses this (and another library to extract json data). I got it to work, the main issue is as soon as i use fp:read it freezes FFXIV until i get the results from the API i'm calling.... and it takes about 4 seconds to get the response...
I got the API URL from Guilwork digging in the network tab of chrome and found the ajax call to it ^o^
You can imagine where i want to go with this... but yeah this 4 seconds total freeze is not a viable option. Any other workaround ?
I thought using a library for it like this one (=> https://github.com/diegonehab/luasocket)... but this goes far beyond my knowledge (i'm a web dev)
Edit : I didn't read entirely your answer, so yeah that would the ideal solution. But is there any way i can use it even if it's not included in minion files... Or is it even possible to get it included by modifying a few things ? I tried to, by putting lua files directly in FFXIV folder (when i use require in my module it looks for the files in FFXIV dir, no matter what i do like this : prohunter.path = GetStartupPath() .. [[\LuaMods\prohunter\]]; but at some point it looks for core.lua , but there's no core.lua file, only a dll and i can't get lua to call it... Dunno if that makes sense ...
Anyway thanks for replying greatly appreciated[/code]
Code:
function prohunter.getDataFromAPI(ticks)
local fp = io.popen(
prohunter.curl ..
' "' ..
prohunter.apiURL
.. '"'
)
d('Read ticks');
prohunter.readticks = ticks
local response = fp:read("*a")
fp:close()
SendTextCommand(prohunter.CallText .. response);
end
I got the API URL from Guilwork digging in the network tab of chrome and found the ajax call to it ^o^
Code:
prohunter.apiURL = "http://guildwork.com/api/games/ffxiv/moogle/hunts";
You can imagine where i want to go with this... but yeah this 4 seconds total freeze is not a viable option. Any other workaround ?
I thought using a library for it like this one (=> https://github.com/diegonehab/luasocket)... but this goes far beyond my knowledge (i'm a web dev)
Edit : I didn't read entirely your answer, so yeah that would the ideal solution. But is there any way i can use it even if it's not included in minion files... Or is it even possible to get it included by modifying a few things ? I tried to, by putting lua files directly in FFXIV folder (when i use require in my module it looks for the files in FFXIV dir, no matter what i do like this : prohunter.path = GetStartupPath() .. [[\LuaMods\prohunter\]]; but at some point it looks for core.lua , but there's no core.lua file, only a dll and i can't get lua to call it... Dunno if that makes sense ...
Anyway thanks for replying greatly appreciated[/code]