Jump to content

Looking for some help with a script


Laufiair Hexicola
 Share

You are about to reply to a thread that has been inactive for 2353 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Trying to construct a script that displays song info and it's misbehaving. I've bult these before using this script as the base and have had no issue. Even changed the clauses due to the change in llhttprequest and it still refuses to display info. Maybe someone could look at it and see what's up? Would appreciate it.

-Logan

// 7.html gives the following in the body
// 0 -> current listeners
// 1 -> status
// 2 -> listener peak
// 3 -> max listeners
// 4 -> reported listeners
// 5 -> bitrate
// 6 -> song


string stream = "http://198.15.88.42:8042"; 
key kSentRequest;

default
{
    state_entry()
    {   
        kSentRequest=llHTTPRequest(stream + "/7.html", [HTTP_USER_AGENT, "LSL_Script (Mozilla Compatible)"],"");
    }
    
    http_response (key kRecRequest, integer intStatus, list lstMeta, string strBody)
    {
        if (kRecRequest == kSentRequest)
        {   
            // Strip the html out of the received information and just show what is inbetween the body tags
            list html = llParseString2List(strBody,["<body>", "</body>"],[]);
            string info = (llList2String(html,6));
            
            list status = llCSV2List(info);
            llSetText ("Now playing on Aristide Radio \n"+llList2String(status,6),<1,1,1>,1);
            
//            llSay(0," Current Listeners: " + llList2String(status,0));
//            llSay(0,"Status: " + llList2String(status,1));
//            llSay(0,"listener peak: " + llList2String(status,2));
//            llSay(0,"max listeners: " + llList2String(status,3));
//            llSay(0,"reported listeners: " + llList2String(status,4));
//            llSay(0,"bitrate: " + llList2String(status,5));
//            llSay(0,"Song: " + llList2String(status,6));
            kSentRequest = NULL_KEY;
        }
    }
}

 

Link to comment
Share on other sites

I've been all over that thread and didn't see anything specific past what I updated in my script already (the line llHTTPRequest(stream + "/7.html", [HTTP_USER_AGENT, "LSL_Script (Mozilla Compatible)"],""); ). Also it was pointed out by someone who contacted me in world, but my stream's shoutcast v2. Not sure if that makes a difference or not.

I might need to tack this on the bottom of that thread to get an answer.

Edited by Laufiair Hexicola
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2353 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...