Difference between revisions of "Talk:Chatbot"

From Second Life Wiki
Jump to navigation Jump to search
m (clarify -- emphasise "and stop moving", allude to "verbose prefix arithmetic", reformat with bullet points, etc.)
m (Strike obsolete text, e.g., the answered wish for parameters and results of the list type)
Line 1: Line 1:
== Examples That We Could/ Should Soon Add ==
We could/ should soon add yet a few more concise demoes, such as:
* verbose prefix arithmetic
<pre>
/7 llSetPos("+"(llGetPos(), <0, 0, 2>));
/7 "*"(ZERO_ROTATION, ZERO_ROTATION)
</pre>
* step to owner and stop moving
* rotate to face the sun and stop rotating
* name the sitting avatar
== Bugs/ Wishes ==
* parms and results of type list
LSL doesn't do lists of lists, so as yet parameters of type list don't work (e.g., llSetPrimitiveParams is hard to call) and results of type list don't work yet (e.g., llParseString2List is hard to call).
We could/ should tweak the code to fix this. We could index each list found and then pass and return that index in place of the list.
== Chatbot vs. the SL GUI ==
== Chatbot vs. the SL GUI ==


I do think the SL GUI should let me toggle a switch to make my prim chattable, i.e., to teach any prim of mine to listen to my LSL chat, for the sake of script folk like me who think by chatting. Meanwhile, I write code like this to let me chat commands to my prims anyhow. I wrote this sample just after walking thru the delightfully concise [[Help:Getting_started_with_LSL|Getting Started with LSL]] tutorial, which only taught me to call [[llSetColor]] and [[llSetText]].
The SL GUI does let you rapidly compile and run one command at a time.


How I use the Chatbot is that I paste in commands from a menu I build elsewhere in a text editor. We could/ should demo how short a similar edit-compile-test can be, despite the SL GUI, if we write a script to execute one statement and print its parameters and result. For example, we could keep a script window open to llSetText to the last string saved there.
To run one command once, you can edit and save a short script like:


<pre>
<pre>
// http://wiki.secondlife.com/wiki/Talk:Chatbot
default
default
{
{
Line 38: Line 15:
}
}
</pre>
</pre>
== Example One-liner's That We Could/ Should Soon Add ==
We could/ should soon add yet a few more concise demoes, such as:
* name the sitting avatar
* move to owner and stop moving
* rotate to face the sun and stop rotating
* show World > Force Sun > Region Default on the face of a cube

Revision as of 15:58, 6 September 2007

Chatbot vs. the SL GUI

The SL GUI does let you rapidly compile and run one command at a time.

To run one command once, you can edit and save a short script like:

// http://wiki.secondlife.com/wiki/Talk:Chatbot
default
{
    state_entry()
    {
        llSetText("look at me blue", <0.0, 0.0, 1.0>, 1.0);
    }
}

Example One-liner's That We Could/ Should Soon Add

We could/ should soon add yet a few more concise demoes, such as:

  • name the sitting avatar
  • move to owner and stop moving
  • rotate to face the sun and stop rotating
  • show World > Force Sun > Region Default on the face of a cube