Change font size
It is currently Fri Aug 17, 2018 7:45 am

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 3   [ 21 posts ]
Go to page 1, 2, 3  Next
Author Message
 Post subject: Display web page on a prim
PostPosted: Wed Mar 12, 2008 9:24 pm 

Joined: Sat Feb 02, 2008 5:08 pm
Posts: 16
Tx Oh has been kind enough to contribute the script running on the prim at the teleport landing point on Wright Plaza. To see a web site, use channel 5 in chat by typing "/5 http://www.osgrid.org"

{L_CODE}:
// by tx Oh

default {
    state_entry() {
        llListen(5, "", NULL_KEY, "");
        llSetText("Say '/5 http://someurl.org'\nto get a webpage displayd on the prim", <1.0, 0.5, 0.0>, 1);
    }
   
    listen(integer ch, string name, key id, string url) {
        llHTTPRequest("http://pici.picidae.net/browse.php?c=0&f=&u="+url,[],"");
    }
    http_response(key rid, integer status, list metadata, string msg) {
        list l = llParseString2List(msg, ["img src=\""], []);
        string img = llList2String(l, 1);
        l = llParseString2List(img, ["\""], []);
        img = llList2String(l, 1);
        string url = "http://pici.picidae.net/" + img;
        string URLTexture = osSetDynamicTextureURL("", "image", url, "", 600);
        if (llStringLength(URLTexture)>0) {
            llSetTexture(URLTexture, ALL_SIDES);
        }
    }
}


Top
 Profile  
 
 Post subject: Re: Display web page on a prim
PostPosted: Sat Apr 12, 2008 5:14 am 

Joined: Sat Apr 12, 2008 3:22 am
Posts: 1
Could there be a typo in this somewhere? I can't get it to work.


Top
 Profile  
 
 Post subject: Re: Display web page on a prim
PostPosted: Fri May 09, 2008 4:34 pm 
Furious Typer
User avatar

Joined: Sat Feb 02, 2008 10:02 pm
Posts: 104
Location: Romania, Bucharest
kat_lemieux {L_WROTE}:
Could there be a typo in this somewhere? I can't get it to work.


Same here. When I click the prim it replaces the texture with a gray texture that never turns into the web page however. I tried another script like this that had this on a touch event and it did the same, just put on a gray texture.


Top
 Profile  
 
 Post subject: Re: Display web page on a prim
PostPosted: Sat Feb 07, 2009 11:27 am 
OSG Elite
User avatar

Joined: Thu Dec 11, 2008 7:51 am
Posts: 392
Location: England UK
It looks like http://pici.picidae.net/ have changed their setup slightly so the inage URL had changed its position when the list was parsed. Ive made a change to the list index and it appears to eb working now :)

Updated code:
{L_CODE}:
    // by tx Oh

    default {
        state_entry() {
            llListen(5, "", NULL_KEY, "");
            llSetText("Say '/5 http://someurl.org'\nto get a webpage displayd on the prim", <1.0, 0.5, 0.0>, 1);
        }
       
        listen(integer ch, string name, key id, string url) {
            llHTTPRequest("http://pici.picidae.net/browse.php?c=0&f=&u="+url,[],"");
        }
        http_response(key rid, integer status, list metadata, string msg) {
            //llSay(0,msg);
            list l = llParseString2List(msg, ["img src=\""], []);
            string img = llList2String(l, 1);
            l = llParseString2List(img, ["\""], []);
            img = llList2String(l, 0);
            string url = "http://pici.picidae.net/" + img;
            //llSay(0,url);
            string URLTexture = osSetDynamicTextureURL("", "image", url, "", 600);
            if (llStringLength(URLTexture)>0) {
                llSetTexture(URLTexture, ALL_SIDES);
            }
        }
    }

_________________
"Nothing lasts forever; It's scientific"
~David Byrne (Talking Heads)


Top
 Profile  
 
 Post subject: Re: Display web page on a prim
PostPosted: Tue Apr 21, 2009 9:53 am 
OSG Elite
User avatar

Joined: Wed Mar 11, 2009 3:57 pm
Posts: 444
I've added a few enhancements to the base script. They are commented in the code below.
-) The URL is now stored & persistent
-) Set Listen to Owner Only, that way a Griefer can come and put a Porno Site on it... ;)

EDIT: Removed Timer Event, it was causing a Trip and the osSetDynamicTextureURL has it's own refresh.

{L_CODE}:
// Original by tx Oh
// commented MODS by WhiteStar (Apr.21.09)
//
string url;  // to keep the URL persistent
default
{
    state_entry()
    {
        llListen(5, "", llGetOwner(), ""); // listen to Owner Only
        llSetText("Say '/5 http://someurl.org'\nto get a webpage displayd on the prim", <1.0, 0.5, 0.0>, 1);
    }
       
    listen(integer ch, string name, key id, string url)
    {
        llSetText("",<0,0,0>,0); // Got a URL so clear the hover text
        llHTTPRequest("http://pici.picidae.net/browse.php?c=0&f=&u="+url,[],"");
    }
    http_response(key rid, integer status, list metadata, string msg) {
        list l = llParseString2List(msg, ["img src=\""], []);
        string img = llList2String(l, 1);
        l = llParseString2List(img, ["\""], []);
        img = llList2String(l, 0);
        string url = "http://pici.picidae.net/" + img;
        string URLTexture = osSetDynamicTextureURL("", "image", url, "", 600);
        if (llStringLength(URLTexture)>0)
        {
            llSetTexture(URLTexture, ALL_SIDES);
        }
    }
}

_________________
No further support of any kind, for any of my materials. Use as/is whereis.
PLEASE UNSTICKY Any Stickied Posting by myself.


Top
 Profile  
 
 Post subject: Re: Display web page on a prim
PostPosted: Tue Apr 21, 2009 12:06 pm 
Site Admin
User avatar

Joined: Sun Feb 22, 2009 1:39 pm
Posts: 402
Location: Wisconsin, USA
This works on my OSGrid homestead, but not on my standalone.
I wonder what I'm missing on my SA? That's running coyled's "releases" version for Ubuntu, 0.6.4.9136 so not too far behind.


Top
 Profile  
 
 Post subject: Re: Display web page on a prim
PostPosted: Tue Apr 21, 2009 3:43 pm 
OSG Elite
User avatar

Joined: Wed Mar 11, 2009 3:57 pm
Posts: 444
Key....

Make sure that you have the os functions enabled on your closed sim. That is likely the culprit.

_________________
No further support of any kind, for any of my materials. Use as/is whereis.
PLEASE UNSTICKY Any Stickied Posting by myself.


Top
 Profile  
 
 Post subject: Re: Display web page on a prim
PostPosted: Tue Apr 21, 2009 5:53 pm 

Joined: Mon Nov 24, 2008 8:00 pm
Posts: 22
There are a couple of osFunction switches in the ini - one each in the DotNet and XEngine sections. Use the appropriate one or use em both lol.

You should also consider the ThreatLevel setting near them. VeryLow might be too low for the web toy, I dunno.

Have fun!


Top
 Profile  
 
 Post subject: Re: Display web page on a prim
PostPosted: Wed Apr 22, 2009 11:44 pm 
Site Admin
User avatar

Joined: Sun Feb 22, 2009 1:39 pm
Posts: 402
Location: Wisconsin, USA
Enabling the two OSFunction switches did the trick.
thanks, guys! :)


Top
 Profile  
 
 Post subject: Re: Display web page on a prim
PostPosted: Fri Apr 24, 2009 10:14 am 
Site Admin
User avatar

Joined: Sun Feb 22, 2009 1:39 pm
Posts: 402
Location: Wisconsin, USA
Is there any way to improve the graphic quality of this?
It's badly pixelated, and also the aspect ratio of the webpage never fits the prim.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 3   [ 21 posts ]
Go to page 1, 2, 3  Next


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net