Talk:Chatbot

From Second Life Wiki
Revision as of 08:48, 5 September 2007 by Ppaatt Lynagh (talk | contribs) (add wish for more idiomatic string parms/ results, add wish for list parms/ results)
Jump to navigation Jump to search

Examples That We Could/ Should Soon Add

We could/ should soon add such concise example commands as:

llSetAlpha
zero rotation

push linear
push rotational
/7 llApplyRotationalImpulse(<3.0, 0.0, 0.0>, TRUE); // roll about the X axis
/7 llApplyRotationalImpulse(<0.0, 3.0, 0.0>, TRUE); // pitch about the Y axis
/7 llApplyRotationalImpulse(<0.0, 0.0, 3.0>, TRUE); // yaw about the Z axis
/7 llSetStatus(STATUS_PHYSICS, FALSE); llSetStatus(STATUS_PHYSICS, TRUE); // zero inertia

move away from owner, move toward owner
face the sun, turn away

name the sitting avatar

We could/ should soon add vector/ rotation arithmetic in prefix syntax (cf., the syntax of overloaded operators in C++):

"*"(ZERO_ROTATION, ZERO_ROTATION)

Bugs/ Wishes

  • parms and results of type string

String parms and results work, but only arcanely, as yet. The resultOf function calls cbList2String to decode string type parms and call its inverse to encode string results. That technique works, but the naive maintainer of the code expects to call llList2String instead and not bother with the inverse. We could/ should refactor to meet those expectations: call cbList2String in callEach for each parameter pushed, before calling resultOf.

  • parms and results of type list

List parms and results don't work yet. We could/ should demo encoding list parms and results as slices of a global list, e.g., "[]" for the empty list else "[first,last]" for other lists

Chatbot vs. the SL GUI

I do think the SL GUI should let me toggle a switch to do this, 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.