Jump to content
  • 0

Do force stop script, when gg.makeRequest() is called.


n3kitOzz

Question

I have some issues with gg.makeRequest() function. If server not respond - script can freeze up to 1 min. And stopping the script not help, anyway you waiting about a minute to stop script.

Its possible to fix that, its very annoying.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

function get_url(target_url)
::reload::
local url_content = gg.makeRequest(target_url).content
gg.sleep(3000)
if url_content == nil or string.find(url_content,"HTTP ERROR [0-9][0-9][0-9]") then
goto reload
end
return load(url_content)()
end

get_url("https://yoururl.com")

This will make the request, pause for 3 seconds then check if content is nil or if server delivered error page and makes request again if either is true until the page loads properly

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.