Thread Rating:
  • 5 Vote(s) - 3.2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HTTP or cURL Request
#3
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...

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]
Reply
 


Messages In This Thread
HTTP or cURL Request - by jm86 - 01-25-2015, 03:47 PM
RE: HTTP or cURL Request - by Ace - 01-26-2015, 03:53 PM
RE: HTTP or cURL Request - by jm86 - 01-27-2015, 07:05 PM
RE: HTTP or cURL Request - by Tormiasz - 01-27-2015, 07:35 PM
RE: HTTP or cURL Request - by jm86 - 01-30-2015, 09:17 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)

We help you win the game.

FFXIV Bot and More.

 

Products