<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.secondlife.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Silky+Mesmeriser</id>
	<title>Second Life Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.secondlife.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Silky+Mesmeriser"/>
	<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/wiki/Special:Contributions/Silky_Mesmeriser"/>
	<updated>2026-06-14T07:12:14Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlGetSimulatorHostname&amp;diff=1179435</id>
		<title>LlGetSimulatorHostname</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlGetSimulatorHostname&amp;diff=1179435"/>
		<updated>2013-06-24T15:54:37Z</updated>

		<summary type="html">&lt;p&gt;Silky Mesmeriser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL_Function&lt;br /&gt;
|func_id=283|func_sleep=10.0|func_energy=10.0&lt;br /&gt;
|func=llGetSimulatorHostname&lt;br /&gt;
|return_type=string&lt;br /&gt;
|func_footnote&lt;br /&gt;
|func_desc&lt;br /&gt;
|return_text=that is the hostname of the machine the script is running on (same as string in viewer Help dialog)&lt;br /&gt;
|spec&lt;br /&gt;
|caveats&lt;br /&gt;
|constants&lt;br /&gt;
|examples=&amp;lt;lsl&amp;gt;&lt;br /&gt;
// The beginnings of a region-info script.&lt;br /&gt;
string region;&lt;br /&gt;
string sim;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(1.0);&lt;br /&gt;
    }&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        string here = llGetRegionName();&lt;br /&gt;
        if(region != here)&lt;br /&gt;
        {&lt;br /&gt;
            sim = llGetSimulatorHostname();&lt;br /&gt;
            region = here;&lt;br /&gt;
        }&lt;br /&gt;
        llSetText(&lt;br /&gt;
                &amp;quot;   REGION NAME : &amp;quot; + region + &lt;br /&gt;
              &amp;quot;\n  SIM HOSTNAME : &amp;quot; + sim + &lt;br /&gt;
              &amp;quot;\nTIME DIALATION : &amp;quot; + (string)llGetRegionTimeDilation() +&lt;br /&gt;
              &amp;quot;\n    REGION FPS : &amp;quot; + (string)llGetRegionFPS(),&lt;br /&gt;
            &amp;lt;0,1,0&amp;gt;, 1.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Alternative method by Silky Mesmeriser&lt;br /&gt;
// This example is more complex than the direct llGetSimulatorHostname() call however it avoids the&lt;br /&gt;
// imposed delay of the ll function and is useful sometimes if the undue delay is a problem for your&lt;br /&gt;
// script.  Of course HTTP transactions to third party services like this can fail at times thus this&lt;br /&gt;
// example will fall back to the LSL function with it&#039;s delay if it is unable to successfully get&lt;br /&gt;
// the hostname from the selected third party source.&lt;br /&gt;
 &lt;br /&gt;
string HOSTNAME_URI = &amp;quot;http://www.displaymyhostname.com/&amp;quot;; // URL to grab hostname from&lt;br /&gt;
string HOSTNAME_START = &amp;quot;&amp;lt;div class=\&amp;quot;hostname\&amp;quot;&amp;gt;&amp;quot;; // What to look for before the hostname string&lt;br /&gt;
string HOSTNAME_END = &amp;quot;&amp;lt;/div&amp;gt;&amp;quot;; // What marks the end of the hostname string&lt;br /&gt;
 &lt;br /&gt;
// Variable to store the simulator hostname set initially to Pending... to inform the end user&lt;br /&gt;
// if they request the information from the object prior to successful retrieval.&lt;br /&gt;
string g_sSimHost = &amp;quot;Pending...&amp;quot;;&lt;br /&gt;
key g_kHostReqID; // Variable to store the HTTP request ID so we can handle the correct http_response&lt;br /&gt;
 &lt;br /&gt;
string smReadHostname(string sData)&lt;br /&gt;
{ // Parse the reply from the remote server and grab the hostname&lt;br /&gt;
    integer iIndex = llSubStringIndex(sData, HOSTNAME_START);&lt;br /&gt;
    sData = llGetSubString(sData, iIndex + llStringLength(HOSTNAME_START), llStringLength(sData));&lt;br /&gt;
    iIndex = llSubStringIndex(sData, HOSTNAME_END);&lt;br /&gt;
    sData = llGetSubString(sData, 0, iIndex -1);&lt;br /&gt;
    // Sanity check the hostname it should end with .lindenlab.com and not contain any characters like spaces or newlines&lt;br /&gt;
    // If this is untrue for some reason it&#039;s very likely that something on the page changed making it parse incorrectly&lt;br /&gt;
    // and thus the result can&#039;t be trusted.&lt;br /&gt;
    if (llSubStringIndex(sData, &amp;quot;.lindenlab.com&amp;quot;) != (llStringLength(sData) - llStringLength(&amp;quot;.lindenlab.com&amp;quot;)) || llSubStringIndex(sData, &amp;quot; &amp;quot;) &amp;gt; -1 || llSubStringIndex(sData, &amp;quot;\n&amp;quot;) &amp;gt; -1) sData == &amp;quot;ERROR&amp;quot;;&lt;br /&gt;
    return sData;&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
string smGetSimulatorHostname()&lt;br /&gt;
{&lt;br /&gt;
    // If called before we have a hostname start the request process&lt;br /&gt;
    if (g_sSimHost == &amp;quot;Pending...&amp;quot;) g_kHostReqID = llHTTPRequest(HOSTNAME_URI,[HTTP_METHOD, &amp;quot;GET&amp;quot;], &amp;quot;&amp;quot;);&lt;br /&gt;
    // Return the hostname if available or indicate pending status&lt;br /&gt;
    return g_sSimHost;&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    changed(integer iChange)&lt;br /&gt;
    { // If the region restarts it may be moved to another simulator this should be the only time we need to check again.&lt;br /&gt;
        if (iChange &amp;amp; CHANGED_REGION_START) smGetSimulatorHostname();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    http_response(key kReqID, integer iStatus, list lMeta, string sBody)&lt;br /&gt;
    {&lt;br /&gt;
        if (kReqID == g_kHostReqID &amp;amp;&amp;amp; iStatus == 200) {&lt;br /&gt;
            g_sSimHost = smReadHostname(sBody);&lt;br /&gt;
            if (g_sSimHost == &amp;quot;ERROR&amp;quot;)&lt;br /&gt;
            { // The hostname doesn&#039;t seem to be parsing properly so lets inform the user and fall back to the LSL function&lt;br /&gt;
                llOwnerSay(&amp;quot;API error determining simulator hostname, falling back to LSL method this will take a few seconds due to imposed limitations in LSL&amp;quot;);&lt;br /&gt;
                g_sSimHost = llGetSimulatorHostname();&lt;br /&gt;
            }&lt;br /&gt;
        } else if (kReqID == g_kHostReqID) { // The HTTP status code indicates something went wrong we inform the user and fall back to the LSL function to be safe&lt;br /&gt;
            llOwnerSay(&amp;quot;HTTP error determining simulator hostname: HTTP Code &amp;quot; + (string)iStatus + &amp;quot; falling back to LSL method this will take a few seconds due to imposed limitations in LSL&amp;quot;);&lt;br /&gt;
            g_sSimHost = llGetSimulatorHostname();&lt;br /&gt;
        }&lt;br /&gt;
        llOwnerSay(&amp;quot;Simulator Hostname: &amp;quot; + smGetSimulatorHostname());&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // This begins the HTTP request for the sim hostname I think it makes&lt;br /&gt;
        // sense to do this right away at startup as there is no need to ask&lt;br /&gt;
        // every time we want to use it.&lt;br /&gt;
        smGetSimulatorHostname();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
|helpers&lt;br /&gt;
|also_functions={{LSL DefineRow||[[llGetRegionFPS]]|Gets the region FPS}}&lt;br /&gt;
{{LSL DefineRow||[[llGetRegionTimeDilation]]|Gets the region time dilation}}&lt;br /&gt;
|also_tests&lt;br /&gt;
|also_events&lt;br /&gt;
|also_articles={{LSL DefineRow||[[Simulator IP Addresses]]|}}&lt;br /&gt;
|notes&lt;br /&gt;
|cat1=Region&lt;br /&gt;
|cat2&lt;br /&gt;
|cat3&lt;br /&gt;
|cat4&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Silky Mesmeriser</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Talk:LSL3&amp;diff=930072</id>
		<title>Talk:LSL3</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Talk:LSL3&amp;diff=930072"/>
		<updated>2010-05-27T09:54:27Z</updated>

		<summary type="html">&lt;p&gt;Silky Mesmeriser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I&#039;d add the to this the switch/case statement. SInce LSL isn&#039;t a run-time scripting language, per se, it should be quite possible to at least allow optimizations for switch(integer) situations and switch(string) would at least allow programming clarity, even if no other optimization was done.&lt;br /&gt;
&lt;br /&gt;
The other proposed changes I listed in the jira also have merit, though perhaps the single most important would be a provision for a common library of functions beyond what LL defines. New functions could be added on a a regular basis after vetting by the community and LL within a cc* namespace. Perhaps a cc.* namespace to make 100% certain of backwards compatability. [[User:Saijanai Kuhn|Saijanai]] 07:38, 24 February 2008 (PST)&lt;br /&gt;
&lt;br /&gt;
I&#039;m not sure if this has previously been suggested but it would be useful as an add on to dialog menus to be able to request text input from the user though a similar interface perhaps through a function like llGetTextInput would save having to open listeners and essentially break out of the menu to a completely different method of input which is at best a little confusing.  I appreciate this would probably need a small addition to the viewer as well, but as a new viewer is under development then perhaps that functionality could be included in preparation. [[User:Silky Mesmeriser|Silky Mesmeriser]] 09:54, 27 May 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Better support for other spoken human languages ==&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a constant in a script for a message in English.&lt;br /&gt;
&lt;br /&gt;
 MsgAlreadyGiven = &amp;quot;Not found, perhaps already given out?&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
Now, here&#039;s the same constant, in French and Italian.        &lt;br /&gt;
&lt;br /&gt;
 MsgAlreadyGiven = &amp;quot;Pas trouve, peut-etre deja enleve?&amp;quot;;&lt;br /&gt;
 MsgAlreadyGiven = &amp;quot;Non trovato, forse gia dato?&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
In French and Italian there, it&#039;s wrong, though.&lt;br /&gt;
&lt;br /&gt;
It&#039;s wrong because LSL forced me to drop the accents, which creates spelling mistakes, forcing me to look illiterate in a multitude of languages. While that has a certain rakish appeal to it :} if there&#039;s another version of LSL, it really needs to be able to handle accents. I know lots of unilingual anglophone programmers will pshaw this idea, but still. [[User:Chaz Longstaff|Chaz Longstaff]] 08:25, 24 February 2008&lt;br /&gt;
&lt;br /&gt;
:The compiler supports accented characters, the font used by the editor doesn&#039;t show them. {{JIRA|VWR-3857}} -- [[User:Strife Onizuka|Strife Onizuka]] 04:48, 25 February 2008 (PST)&lt;br /&gt;
&lt;br /&gt;
::last i checked, characters like ç and ã displayed on the script editor just fine (hell, even stuff like φ, ▅ and ░ show as expected), but when saving it would give an error (often pointing to the wrong point on the script as the source of the error), the solution I found was to use llUnEscapeURL for inputing such characters on the script code (but since it ias afunction, it won&#039;t work unles run inside an state), to figure out what is the code to an specific charater, one way would be having a script tel you the escaped version of what it hears and say to it the characters you want the escape code for, then use the returned code on yoru script--[[User:TigroSpottystripes Katsu|TigroSpottystripes Katsu]] 23:58, 25 February 2008 (PST)&lt;br /&gt;
&lt;br /&gt;
:::I thought they had that bug fixed ~_~ -- [[User:Strife Onizuka|Strife Onizuka]] 04:42, 26 February 2008 (PST)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Less aggressive/smarter generation of function delays. ==&lt;br /&gt;
&lt;br /&gt;
Some functions have pointful but painfully long delays attached to them to prevent abuse. But by stalling the script for long periods of time you train people to break the function out into seperate linkmessaged scripts, at which point its alot easier for them to start multiplying them to outright defeat the delay, which creates more load.&lt;br /&gt;
&lt;br /&gt;
I suggest making most of those functions /not/ delay unless they get called twice in a delaylength period of time, in which case the function can silently pause for the remainder of the expected time before carrying on.&lt;br /&gt;
&lt;br /&gt;
Of course it creates situations where otherwise instantaneous functions can be laggy in effect if being called rapidfire with soon-to-be-outdated arguments, but I feel its a much better alternative to what we have now. If its a big enough problem people can load in their own explicit delays. --[[User:Elbereth Witte|Elbereth Witte]] 20:30, 27 June 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>Silky Mesmeriser</name></author>
	</entry>
</feed>