Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llHTTPRequest and http_response

Jaxom Winger
Registered User
Join date: 7 Mar 2006
Posts: 2
08-04-2007 14:24
I want to be able to use some form of loop to get items from a website using llHTTPRequest and http_response. For the life of me I can't figure out how to re-trigger http_response. Hoping the intelligent mob can help. Below is the pseudo code of what I have tried.


last_item=10
for(i=1, last_item, i++)
{
reqid = llHTTPRequest( URL + "?index=" + i, [], "" );
}

http_response(key id, integer status, list meta, string body)
{
if ( id != reqid )
return;
else
llOwnerSay(body);
}

No matter what I try, http_response only executes once, seemingly at the end of the script. I tried to put in a wait during the loop to see if it was a timing issue, but no joy. Help!
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
08-04-2007 14:41
How about something more like:

last_item=10;
i = 1;
reqid = llHTTPRequest( URL + "?index=" + i, [], "" );


http_response(key id, integer status, list meta, string body)
{
if ( id != reqid) return;

llOwnerSay(body);
if (i++ < last_item) reqid = llHTTPRequest( URL + "?index=" + i, [], "" );
}