Talk:Chatbot

From Second Life Wiki
Revision as of 04:29, 6 September 2007 by Ppaatt Lynagh (talk | contribs) (clarify -- emphasise "and stop moving", allude to "verbose prefix arithmetic", reformat with bullet points, etc.)
Jump to navigation Jump to search

Examples That We Could/ Should Soon Add

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

  • verbose prefix arithmetic
/7 llSetPos("+"(llGetPos(), <0, 0, 2>));
/7 "*"(ZERO_ROTATION, ZERO_ROTATION)
  • 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

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 Getting Started with LSL tutorial, which only taught me to call llSetColor and llSetText.

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.

default
{
    state_entry()
    {
        llSetText("look at me blue", <0.0, 0.0, 1.0>, 1.0);
    }
}