Scripts Library

Creating scripts
User avatar
Selby Evans
Posts: 620
Joined: Wed Sep 04, 2013 6:00 pm
Has thanked: 1840 times
Been thanked: 822 times

Re: Scripts Library

Post by Selby Evans »

I have tried to use hypergates in the past. Some did work in Kitely, but were unreliable. Maria Korolov may have more information--she has had a number of hypergates on her place and has tried to get them to work. I have not checked the current status.
Check here:
http://www.hyperica.com/2014/07/hyperica/
Graham Mills
Posts: 1314
Joined: Sun Dec 23, 2012 2:26 pm
Has thanked: 1134 times
Been thanked: 1142 times

Re: Scripts Library

Post by Graham Mills »

Worked OK for me in all three modes with Firestorm 4.7.7 (48706). As Dot said elsewhere, the hypergrid teleport may require a couple of touches (I got a "destination no longer exists"-type error first time). I haven't checked it with any other viewers. The script can be converted to a gate by changing touch_start to collision_start but, of course, it's very basic in many ways compared to other teleport devices out there.
Graham Mills wrote:Last time I checked there were some differences between viewers. There's a touch-activated script here
viewtopic.php?f=26&t=759&start=60#p18850
User avatar
Freda Frostbite
Posts: 742
Joined: Sat Mar 29, 2014 2:10 am
Location: Florida, space coast.
Has thanked: 608 times
Been thanked: 769 times

Re: Scripts Library

Post by Freda Frostbite »

I actually tried going to Hyperica last night for this very purpose and could not get there. I could get to Hyperica north or central, but then could not get from there to Hyperica, so I suspect something is up with that region. For now, I am giving up on Hypergates and using the opensimworld beacon instead. MUCH more reliable. I have noted that gates do not work consistently in any of the places that have them installed. A few even have signs to that affect.
CaitanyaRupa Navarathna
Posts: 5
Joined: Thu Apr 18, 2013 6:31 am
Has thanked: 0
Been thanked: 7 times

MP3 playlist jukebox using osSetParcelMediaURL with timer

Post by CaitanyaRupa Navarathna »

Okay adding an MP3 Jukebox - plays a playlist of MP3 hosted on the internet

Code: Select all

// this script will let you play a list of MP3s that are hosted on the web

// it was created by mutual work with others on opensim - not sure who started it but it has evolved and so is full perm - please share it and don't hoard - it's BAD KARMA!

// first you copy and paste the names of the files into the list songs (make sure you have quotes surrounding each filename for example "file.mp3"

list songs = ["file1.mp3","file2.mp3","file3.mp3","file4.mp3","file5.mp3","file6.mp3","file7.mp3"];
list songlengths = [123,234,150,245,332,332,281];

// time needs to be in seconds - so if song is 2 minutes 30 seconds then that is 2 (minutes) X 60 (seconds per minute) + 30 (seconds) = 150 
// times should match sequence of filenames they match

string path = "http://myurlhere/folder/folder/etc/";
// add your URL to the string path = "http://myurlhere/folder/folder/etc/"

integer currentsong = 0;


default
{
     on_rez(integer start_param)
    {
        // Restarts the script every time the object is rezzed
        llResetScript(); 
    }
     state_entry()
     {
          integer currentsong = 0;
          llSetTimerEvent(0.01);
     }

     timer()
     {
          osSetParcelMediaURL(path + llList2String(songs, currentsong));

          llSetTimerEvent(llList2Float(songlengths, currentsong));
          currentsong = currentsong + 1;
          if (currentsong > 6)
//count the number of files and subtract 1 - counting starts at 0 - so 0,1,2,etc - add this to the currrentsong > #of songs minus 1
          {
              currentsong = 0;
          }
     }

}



These users thanked the author CaitanyaRupa Navarathna for the post (total 4):
Dot MatrixConstance PeregrineShandon LoringDolly Rotten
User avatar
Dolly Rotten
Posts: 10
Joined: Wed Jul 31, 2019 6:01 pm
Has thanked: 15 times
Been thanked: 16 times

Display Object Name as Text

Post by Dolly Rotten »

Just what it says in the title. A wee script we've been getting a lot of use out of, so I thought others might also find handy to have in a toolkit:

Code: Select all

// Display Object Name as Text
// by Dolly Rotten and Conductor Code

string CommandList = ""; // Storage for our drawing commands
string FontName = "Arial"; // Arial is the default font used, if unspecified
integer FontSize = 36;     // Text size
string FontColour = "Black"; // Text color
integer FaceNumber = 1;    // Face number to display the texture on

default
{
    state_entry()
    { 
        // Get the name of the object this script is in
        string ObjectName = llGetObjectName();

        CommandList = osMovePen(CommandList, 10, 10);   // Position of the pen
        CommandList = osSetFontName(CommandList, FontName);
        CommandList = osSetFontSize(CommandList, FontSize);
        CommandList = osSetPenColor(CommandList, FontColour); 
        CommandList = osDrawText(CommandList, ObjectName); // Display the object's name

        // Now draw the image on the chosen face
        osSetDynamicTextureDataFace ("", "vector", CommandList, "width:256,height:256", 0, FaceNumber);
    }
}
These users thanked the author Dolly Rotten for the post:
Ilan Tochner
User avatar
Lunk Portal
Posts: 150
Joined: Wed Jan 26, 2022 10:03 am
Location: Northern Michigan
Has thanked: 100 times
Been thanked: 151 times
Contact:

Re: Display Object Name as Text

Post by Lunk Portal »

Does anyone have a list of Fontnames that work with this? Or perhaps it is limited by opensim fonts?


Dolly Rotten wrote:
Sat Nov 30, 2024 11:27 am
Just what it says in the title. A wee script we've been getting a lot of use out of, so I thought others might also find handy to have in a toolkit:

Code: Select all

// Display Object Name as Text
// by Dolly Rotten and Conductor Code

string CommandList = ""; // Storage for our drawing commands
string FontName = "Arial"; // Arial is the default font used, if unspecified
integer FontSize = 36;     // Text size
string FontColour = "Black"; // Text color
integer FaceNumber = 1;    // Face number to display the texture on

default
{
    state_entry()
    { 
        // Get the name of the object this script is in
        string ObjectName = llGetObjectName();

        CommandList = osMovePen(CommandList, 10, 10);   // Position of the pen
        CommandList = osSetFontName(CommandList, FontName);
        CommandList = osSetFontSize(CommandList, FontSize);
        CommandList = osSetPenColor(CommandList, FontColour); 
        CommandList = osDrawText(CommandList, ObjectName); // Display the object's name

        // Now draw the image on the chosen face
        osSetDynamicTextureDataFace ("", "vector", CommandList, "width:256,height:256", 0, FaceNumber);
    }
}
These users thanked the author Lunk Portal for the post:
Dolly Rotten
User avatar
Dolly Rotten
Posts: 10
Joined: Wed Jul 31, 2019 6:01 pm
Has thanked: 15 times
Been thanked: 16 times

Re: Display Object Name as Text

Post by Dolly Rotten »

Image

Can't remember now where I found this font tester, but hope this is of use:

Code: Select all

//fonttest MT

list lFonts = ["Abadi MT","Agency FB","Algerian","Andale Mono","Arial","Arial Rounded MT","Avant-Garde","Baskerville Old Face","Bauhaus 93","Beesknees ITC","Bell MT","Berlin Sans FB","Bernard MT","BernhardMod BT","Bitstream Vera Sans","Bitstream Vera Sans Mono","Bitstream Vera Serif","Blackadder ITC","Blackletter 686 BT","Book Antiqua","Bookman Old Style","Bradley Hand ITC","Braggadocio","Britannic","Broadway","Brush738 BT","Brush Script MT","Brushwood Italic","Californian FB","Calisto MT","CaslonOpenface BT","Castellar","Centaur","Century Gothic","Century Schoolbook","Chiller","Colonna MT","Comic Sans MS","Cooper","Copperplate Gothic","Courier","Courier New","Curlz MT","Desdemona","Edwardian Script ITC","Elephant","Engravers MT","EngraversGothic BT","Eras ITC","Eurostile","Felix Titling","Flexure","Footlight MT","Forte","Franklin Gothic Book","Freestyle Script","French Script MT","Garamond","Georgia","Gigi","Gill Sans MT","Gloucester MT","Goudy Old Style","Goudy Stout","Gradl","Haettenschweiler","Harlow Solid Italic","Harrington","Helvetia","High Tower Text","Hippo","Humanist521 Bold Cn BT","Impact","Imprint MT Shadow","Informal Roman","Jokerman","Juice ITC","Kino MT","Kristen ITC","Kunstler Script","LcdD","Lucida Blackletter","Lucida Calligraphy","Lucida Fax","Lucida Handwriting","Lucida Sans","Lucida Sans Typewriter","Magneto","Maiandra GD","Matisse ITC","Matura MT Script Capitals","Mead","Mercurius Script MT","Mistral","Modern No. 20","Monotype Corsiva","MS Sans Serif","News Gothic MT","Niagara Engraved","Niagara Solid","
OCR A","Old English Text MT","Onyx","Onyx BT","Oz Handicraft BT","Palace Script MT","Palatino Linotype","Papyrus","Parchment","Perpetua Titling MT","Placard Condensed","Playbill","Poor Richard","Pristina","QuickType","Rage","Ransom","Ravie","Ribbon131 Bd BT","Rockwell","Script MT","ShelleyVolante","Showcard Gothic","Snap ITC","Stencil","Swiss721 BlkEx BT","Tahoma","Tempus Sans ITC","Terminal","Times New Roman","T-Roman","Transam","Trebuchet MS","Tw Cen MT","Utopia","Verdana","Viner Hand ITC","Vivaldi","Vladimir Script","Westminster","Wide Latin","Xerox Sans Serif","Xerox Serif","Utopia","Zapf Chancery",

// Microsoft fonts
"Andale Mono", "Arial", "Arial Black", "Calibri", "Cambria", "Comic Sans MS", "Candara", "Consolas", "Constantia", "Corbel", "Courier New", "Georgia",  "Impact", "Times New Roman", "Webdings",

// urw-fonts
"Bookman", "Zapf Chancery", "URW Gothic L", "Palatino", "New Century Schoolbook"
];


string sContentType = "vector";
string sData = "";                               
string sExtraParams = "width:1024,height:1024";
integer i;
integer j;
integer k;


draw_fonts(list fonts)
{
    sData += "PenSize 5; ";
    sData += "PenColour Red; "; 
    sData += "FontSize 14; ";    
    for (i = 0; i <= llGetListLength(fonts); ++i)
    {
        j=i;
        k=1;
        if (i>=40)
        {
            j= i-40;
            k= 250;
        }
        if (i>=80)
        {
            j= i-80;
            k= 500;
        }
        if (i>=120)
        {
            j= i-120;
            k= 750;
        }                 
        //llOwnerSay((string)i+","+(string)j+","+(string)k+llList2String(fonts,i));
        sData += "MoveTo "+(string)k+","+(string)(20*j)+"; ";
        string name = llList2String(fonts,i);
        sData += "FontName "+name+"; Text "+name+";";
    }

    osSetDynamicTextureData("", sContentType, sData, sExtraParams, 0);
}


default
{
    state_entry()
    {
        draw_fonts(lFonts);
    }
}
Lunk Portal wrote:
Sat Mar 08, 2025 10:13 am
Does anyone have a list of Fontnames that work with this? Or perhaps it is limited by opensim fonts?


Dolly Rotten wrote:
Sat Nov 30, 2024 11:27 am
Just what it says in the title. A wee script we've been getting a lot of use out of, so I thought others might also find handy to have in a toolkit:

Code: Select all

// Display Object Name as Text
// by Dolly Rotten and Conductor Code

string CommandList = ""; // Storage for our drawing commands
string FontName = "Arial"; // Arial is the default font used, if unspecified
integer FontSize = 36;     // Text size
string FontColour = "Black"; // Text color
integer FaceNumber = 1;    // Face number to display the texture on

default
{
    state_entry()
    { 
        // Get the name of the object this script is in
        string ObjectName = llGetObjectName();

        CommandList = osMovePen(CommandList, 10, 10);   // Position of the pen
        CommandList = osSetFontName(CommandList, FontName);
        CommandList = osSetFontSize(CommandList, FontSize);
        CommandList = osSetPenColor(CommandList, FontColour); 
        CommandList = osDrawText(CommandList, ObjectName); // Display the object's name

        // Now draw the image on the chosen face
        osSetDynamicTextureDataFace ("", "vector", CommandList, "width:256,height:256", 0, FaceNumber);
    }
}
These users thanked the author Dolly Rotten for the post (total 2):
Lunk PortalIlan Tochner
Post Reply