New NPC chatbot controller
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
</Script>
|
||||
<Script name="Collision test.lsl" guid="9a7e990c-7f43-400f-b2a7-2e0311162d5a">
|
||||
</Script>
|
||||
<Script name="Listener for things that appear and disappear.lsl" guid="4ec868f0-b792-4fb1-bb0c-ef5747d20327">
|
||||
</Script>
|
||||
<Script name="Stop Processing.lsl" guid="1a220cc3-3120-4997-9d06-01f721ccda97">
|
||||
</Script>
|
||||
<Script name="Touch to Go.lsl" guid="1f188bfb-241f-410b-b29c-e81b8df22358">
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
// :DESCRIPTION:
|
||||
// All in one NPC recorder player set of debug functions. Add these ONLY if you are compileing in LSLEditor.
|
||||
// :CODE:
|
||||
// IMPORTANT NOTE
|
||||
// IMPORTANT NOTE
|
||||
// DELETE ALL these lines out for Opensim, leave uncommented for testing in LSLEditor
|
||||
|
||||
integer OS_NPC_CREATOR_OWNED = 1;
|
||||
@@ -26,110 +26,110 @@ integer OS_NPC_FLY = 7;
|
||||
|
||||
|
||||
integer osIsNpc(key id){
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
osNpcStand(key npc) {
|
||||
llOwnerSay("Standing");
|
||||
llOwnerSay("Standing");
|
||||
}
|
||||
vector osNpcGetPos(key id) {
|
||||
vector vDestPos;
|
||||
vDestPos.x += llFrand(1.0); // some randomness for debugging
|
||||
llOwnerSay("Reached " + (string) vDestPos);
|
||||
return vDestPos;
|
||||
vector vDestPos;
|
||||
vDestPos.x += llFrand(1.0); // some randomness for debugging
|
||||
llOwnerSay("Reached " + (string) vDestPos);
|
||||
return vDestPos;
|
||||
}
|
||||
osNpcMoveToTarget(key npc, vector target, integer options){
|
||||
llSay(0,"Moving to " + (string) target);
|
||||
llSay(0,"Moving to " + (string) target);
|
||||
}
|
||||
key osNpcCreate(string firstname, string lastname, vector position, string cloneFrom, integer options) {
|
||||
llSay(0,"Creating NPC " + firstname + " " + lastname + " at " + (string) position);
|
||||
return (key) "12345000-0000-0000-0000-0000000000002";
|
||||
llSay(0,"Creating NPC " + firstname + " " + lastname + " at " + (string) position);
|
||||
return (key) "12345000-0000-0000-0000-0000000000002";
|
||||
}
|
||||
osNpcLoadAppearance(key npc, string notecard) {
|
||||
llSay(0,"Load notecard " + notecard);
|
||||
llSay(0,"Load notecard " + notecard);
|
||||
}
|
||||
osNpcPlayAnimation(key npc, string animation) {
|
||||
llSay(0,"Playing animation " + animation);
|
||||
llSay(0,"Playing animation " + animation);
|
||||
}
|
||||
osNpcStopAnimation(key npc, string animation) {
|
||||
llSay(0,"Stopped animation " + animation);
|
||||
llSay(0,"Stopped animation " + animation);
|
||||
}
|
||||
osNpcSay(key npc, integer iChannel, string message) {
|
||||
llSay(0,"Saying " + message);
|
||||
llSay(0,"Saying " + message);
|
||||
}
|
||||
osNpcWhisper(key npc, integer iChannel, string message) {
|
||||
llSay(0,"Whispering " + message);
|
||||
llSay(0,"Whispering " + message);
|
||||
}
|
||||
osNpcShout(key npc, integer iChannel, string message) {
|
||||
llSay(0,"Shouting " + message);
|
||||
llSay(0,"Shouting " + message);
|
||||
}
|
||||
osNpcSit(key npc, key target, integer options) {
|
||||
llSay(0,"Sat on " +target);
|
||||
llSay(0,"Sat on " +target);
|
||||
}
|
||||
osNpcSetRot(key npc, rotation rot) {
|
||||
llSay(0,"Set rotation of NPC to " + (string) rot);
|
||||
llSay(0,"Set rotation of NPC to " + (string) rot);
|
||||
}
|
||||
osOwnerSaveAppearance(string notecard) {
|
||||
llSay(0,"Created Notecard " + notecard);
|
||||
llSay(0,"Created Notecard " + notecard);
|
||||
}
|
||||
osAgentSaveAppearance(key avatar, string notecard) {
|
||||
llSay(0,"Created Notecard " + notecard);
|
||||
llSay(0,"Created Notecard " + notecard);
|
||||
}
|
||||
osNpcRemove (key target) {
|
||||
llSay(0,"NPC removed");
|
||||
llSay(0,"NPC removed");
|
||||
}
|
||||
list osGetAvatarList () {
|
||||
list lStuff = [(key) "12345000-0000-0000-0000-0000000000002", <1,2,3>, "Digit Gorilla"];
|
||||
return lStuff;
|
||||
list lStuff = [(key) "12345000-0000-0000-0000-0000000000002", <1,2,3>, "Digit Gorilla"];
|
||||
return lStuff;
|
||||
}
|
||||
osMakeNotecard(string notecardName, string contents) {
|
||||
llOwnerSay("Make Notecard " + notecardName + "Contents:" + (string) contents);
|
||||
llOwnerSay("Make Notecard " + notecardName + "Contents:" + (string) contents);
|
||||
}
|
||||
string osGetNotecard(string name) {
|
||||
// sample notecard for testing
|
||||
string str = "@spawn=Digit Gorilla|<645, 128, 25>\n"
|
||||
+ "@walk=<645, 120, 25>\n"
|
||||
+ "REPEAT\n"
|
||||
+ "@cmd=0|Hello on channel 0\n"
|
||||
+ "@wander=3|5\n"
|
||||
+ "@say=say , walking is so tiresome...\n"
|
||||
+ "@whisper=whisper, walking is so tiresome...\n"
|
||||
+ "@shout=shout, walking is so tiresome...\n"
|
||||
+ "@goto=REPEAT\n"
|
||||
+ "@goto=NEXT\n"
|
||||
+ "@say=i will never say this...\n"
|
||||
+ "NEXT\n"
|
||||
+ "@sound=somesound\n"
|
||||
+ "@randsound\n"
|
||||
+ "@pause=5\n"
|
||||
+ "@rotate=90\n"
|
||||
+ "@wander=3|1\n"
|
||||
+ "@say=Uff, I'm done...\n"
|
||||
+ "@delete\n";
|
||||
return str;
|
||||
// sample notecard for testing
|
||||
string str = "@spawn=Digit Gorilla|<645, 128, 25>\n"
|
||||
+ "@walk=<645, 120, 25>\n"
|
||||
+ "REPEAT\n"
|
||||
+ "@cmd=0|Hello on channel 0\n"
|
||||
+ "@wander=3|5\n"
|
||||
+ "@say=say , walking is so tiresome...\n"
|
||||
+ "@whisper=whisper, walking is so tiresome...\n"
|
||||
+ "@shout=shout, walking is so tiresome...\n"
|
||||
+ "@goto=REPEAT\n"
|
||||
+ "@goto=NEXT\n"
|
||||
+ "@say=i will never say this...\n"
|
||||
+ "NEXT\n"
|
||||
+ "@sound=somesound\n"
|
||||
+ "@randsound\n"
|
||||
+ "@pause=5\n"
|
||||
+ "@rotate=90\n"
|
||||
+ "@wander=3|1\n"
|
||||
+ "@say=Uff, I'm done...\n"
|
||||
+ "@delete\n";
|
||||
return str;
|
||||
}
|
||||
|
||||
osAvatarPlayAnimation(key npc, string animation){
|
||||
llSay(0,"playing " + animation);
|
||||
llSay(0,"playing " + animation);
|
||||
}
|
||||
|
||||
osAvatarStopAnimation(key npc, string animation){
|
||||
llSay(0,"Stopping " + animation);
|
||||
llSay(0,"Stopping " + animation);
|
||||
}
|
||||
|
||||
osForceOtherSit(key AvatarKey, key UUID) {
|
||||
llSay(0,"Sitting");
|
||||
llSay(0,"Sitting");
|
||||
}
|
||||
|
||||
|
||||
osSetSpeed(key NPC, float speed) {
|
||||
llSay(0,"Speed set to " + (string) speed);
|
||||
llSay(0,"Speed set to " + (string) speed);
|
||||
}
|
||||
|
||||
osNpcTouch(key NPC, key thing, integer where) {;}
|
||||
|
||||
osForceAttachToOtherAvatarFromInventory(key npc, string inventory, integer point) {
|
||||
llSay(0,"attach " + inventory + " to " + (string) point);
|
||||
llSay(0,"attach " + inventory + " to " + (string) point);
|
||||
}
|
||||
|
||||
osTeleportAgent( key avi, string name, vector dest, vector lookat) {;}
|
||||
@@ -137,4 +137,4 @@ osTeleportAgent( key avi, string name, vector dest, vector lookat) {;}
|
||||
// END commented code for OpenSim vs Editor environments
|
||||
//*******************************************************************//
|
||||
// comment this out, is only here for testing in LSLEditor.
|
||||
default {}
|
||||
default {}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,10 @@
|
||||
// :SHOW:
|
||||
// :SHOW:1
|
||||
// :CATEGORY:NPC
|
||||
// :NAME:All In One NPC Recorder and Player
|
||||
// :AUTHOR:Ferd Frederix
|
||||
// :KEYWORDS:
|
||||
// :CREATED:2015-07-17 13:15:19
|
||||
// :EDITED:2015-07-17 12:15:19
|
||||
// :EDITED:2016-07-10 09:24:25
|
||||
// :ID:27
|
||||
// :NUM:1807
|
||||
// :REV:1
|
||||
@@ -15,13 +15,13 @@
|
||||
|
||||
default
|
||||
{
|
||||
state_entry() {
|
||||
llSetText("Type commands in chat to control the NPC, such as '@say=Hello'",<1,1,1>,1.0);
|
||||
llListen(0,"","","");
|
||||
}
|
||||
state_entry() {
|
||||
llSetText("Type commands in chat to control the NPC, such as '@say=Hello'",<1,1,1>,1.0);
|
||||
llListen(0,"","","");
|
||||
}
|
||||
|
||||
listen(integer channel, string name, key id, string message)
|
||||
{
|
||||
llMessageLinked(LINK_ROOT,0, message,"");
|
||||
}
|
||||
listen(integer channel, string name, key id, string message)
|
||||
{
|
||||
llMessageLinked(LINK_ROOT,0, message,"");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// :AUTHOR:Ferd Frederix
|
||||
// :KEYWORDS:
|
||||
// :CREATED:2015-07-17 13:15:49
|
||||
// :EDITED:2015-09-23 12:06:52
|
||||
// :EDITED:2016-07-10 09:24:25
|
||||
// :ID:27
|
||||
// :NUM:1808
|
||||
// :REV:3
|
||||
@@ -15,33 +15,33 @@
|
||||
// rev 3: added on_rez() and STATUS_PHANTOM to state_entry - otherwise reset on Linux boxes did no collide any more.
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
llSetStatus(STATUS_PHANTOM,FALSE);
|
||||
llVolumeDetect(FALSE);
|
||||
llSleep(0.1);
|
||||
llVolumeDetect(TRUE);
|
||||
}
|
||||
|
||||
collision_start(integer n) {
|
||||
llMessageLinked(LINK_SET,0, "@animate=someanimation|10","");
|
||||
llSetTimerEvent(5);
|
||||
}
|
||||
timer()
|
||||
{
|
||||
llMessageLinked(LINK_SET,0, "@animate=Stand|1","");
|
||||
llSetTimerEvent(0);
|
||||
}
|
||||
|
||||
changed(integer what)
|
||||
{
|
||||
if (what & CHANGED_REGION_START)
|
||||
{
|
||||
llResetScript();
|
||||
}
|
||||
}
|
||||
on_rez(integer p)
|
||||
{
|
||||
llResetScript();
|
||||
}
|
||||
state_entry()
|
||||
{
|
||||
llSetStatus(STATUS_PHANTOM,FALSE);
|
||||
llVolumeDetect(FALSE);
|
||||
llSleep(0.1);
|
||||
llVolumeDetect(TRUE);
|
||||
}
|
||||
|
||||
collision_start(integer n) {
|
||||
llMessageLinked(LINK_SET,0, "@animate=someanimation|10","");
|
||||
llSetTimerEvent(5);
|
||||
}
|
||||
timer()
|
||||
{
|
||||
llMessageLinked(LINK_SET,0, "@animate=Stand|1","");
|
||||
llSetTimerEvent(0);
|
||||
}
|
||||
|
||||
changed(integer what)
|
||||
{
|
||||
if (what & CHANGED_REGION_START)
|
||||
{
|
||||
llResetScript();
|
||||
}
|
||||
}
|
||||
on_rez(integer p)
|
||||
{
|
||||
llResetScript();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// :SHOW:
|
||||
// :SHOW:1
|
||||
// :CATEGORY:NPC
|
||||
// :NAME:All In One NPC Recorder and Player
|
||||
// :AUTHOR:Ferd Frederix
|
||||
// :KEYWORDS:
|
||||
// :CREATED:2015-07-17 13:16:10
|
||||
// :EDITED:2015-07-17 12:16:10
|
||||
// :EDITED:2016-07-10 09:24:25
|
||||
// :ID:27
|
||||
// :NUM:1809
|
||||
// :REV:1
|
||||
@@ -15,12 +15,12 @@
|
||||
|
||||
default
|
||||
{
|
||||
state_entry() {
|
||||
llSetText("Click to make the NPC stop processing commands",<1,1,1>,1.0);
|
||||
}
|
||||
state_entry() {
|
||||
llSetText("Click to make the NPC stop processing commands",<1,1,1>,1.0);
|
||||
}
|
||||
|
||||
touch_start(integer total_number)
|
||||
{
|
||||
llMessageLinked(LINK_ROOT,0, "@stop","");
|
||||
}
|
||||
touch_start(integer total_number)
|
||||
{
|
||||
llMessageLinked(LINK_ROOT,0, "@stop","");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
// :SHOW:
|
||||
// :SHOW:1
|
||||
// :CATEGORY:NPC
|
||||
// :NAME:All In One NPC Recorder and Player
|
||||
// :AUTHOR:Ferd Frederix
|
||||
// :KEYWORDS:
|
||||
// :CREATED:2015-07-17 13:16:51
|
||||
// :EDITED:2015-07-17 12:16:51
|
||||
// :EDITED:2016-07-10 09:24:25
|
||||
// :ID:27
|
||||
// :NUM:1811
|
||||
// :REV:1
|
||||
// :WORLD:Second Life
|
||||
// :WORLD:Opensim
|
||||
// :DESCRIPTION:
|
||||
// Sample touch to trigger a NPC script
|
||||
// :CODE:
|
||||
|
||||
default
|
||||
{
|
||||
state_entry() {
|
||||
llSetText("Click to make the NPC say hello",<1,1,1>,1.0);
|
||||
}
|
||||
state_entry() {
|
||||
llSetText("Click to make the NPC say hello",<1,1,1>,1.0);
|
||||
}
|
||||
|
||||
touch_start(integer total_number)
|
||||
{
|
||||
llMessageLinked(LINK_ROOT, 0, "@say=Hello there, " + llDetectedName(0), "");
|
||||
}
|
||||
touch_start(integer total_number)
|
||||
{
|
||||
llMessageLinked(LINK_ROOT, 0, "@say=Hello there, " + llDetectedName(0), "");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
// :SHOW:
|
||||
// :SHOW:1
|
||||
// :CATEGORY:NPC
|
||||
// :NAME:All In One NPC Recorder and Player
|
||||
// :AUTHOR:Ferd Frederix
|
||||
// :KEYWORDS:
|
||||
// :CREATED:2015-07-17 13:16:29
|
||||
// :EDITED:2015-07-17 12:16:29
|
||||
// :EDITED:2016-07-10 09:24:25
|
||||
// :ID:27
|
||||
// :NUM:1810
|
||||
// :REV:1
|
||||
// :WORLD:Second Life
|
||||
// :WORLD:Opensim
|
||||
// :DESCRIPTION:
|
||||
// Sample touch to go script for all in one NPC animator
|
||||
// :CODE:
|
||||
|
||||
default
|
||||
{
|
||||
state_entry() {
|
||||
llSetText("Click to make the NPC continue processing commands",<1,1,1>,1.0);
|
||||
}
|
||||
state_entry() {
|
||||
llSetText("Click to make the NPC continue processing commands",<1,1,1>,1.0);
|
||||
}
|
||||
|
||||
touch_start(integer total_number)
|
||||
{
|
||||
llMessageLinked(LINK_ROOT,0, "@go","");
|
||||
}
|
||||
touch_start(integer total_number)
|
||||
{
|
||||
llMessageLinked(LINK_ROOT,0, "@go","");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,67 +1,69 @@
|
||||
// :SHOW:1
|
||||
// :CATEGORY:Flying Bee
|
||||
// :CATEGORY:Flying Bee
|
||||
// :NAME:Flying Bee and Hive
|
||||
// :AUTHOR:Ferd Frederix
|
||||
// :AUTHOR:Ferd Frederix
|
||||
// :KEYWORDS:
|
||||
// :CREATED:2013-09-08 12:59:45
|
||||
// :EDITED:2015-03-17 09:26:22
|
||||
// :CREATED:2013-09-08 12:59:45
|
||||
// :EDITED:2016-07-10 09:24:29
|
||||
// :ID:995
|
||||
// :NUM:1725
|
||||
// :REV:4
|
||||
// :REV:5
|
||||
// :WORLD:Opensim, SecondLife
|
||||
// :DESCRIPTION:
|
||||
// A free flying bee that gathers pollen and takes it to his hive for either OpenSim or Second Life
|
||||
// :CODE:
|
||||
// Simple Bee script to locate and gather pollen from all prims named "Flower" then returns to the "Beehive"
|
||||
// Simple Bee script to locate and gather pollen from all prims named "Flower" then returns to the "Beehive"
|
||||
// Requires 2 sounds buzz1 and buzz2
|
||||
// !!!!!!!!!!!!!!
|
||||
// Mods by Donjr Spiegelblatt for Opensim to remove chance of thread locking on 3/7/2015
|
||||
// Thank YOU very much, DonJr !
|
||||
// 03-17-2015 fixed up a problem reported by DonJr where the bees visited to flowers in the wrong sequence.
|
||||
|
||||
// Note: For Opensim, make sure to set the prim to PHYSICS type = NONE manually
|
||||
|
||||
// Note: For Opensim, make sure to set the prim to PHYSICS type = NONE manually
|
||||
//======================================================================
|
||||
// Note: Inworldz Revisions - 7/9/2016
|
||||
// RadioRoy Wattz (Inworldz)
|
||||
//======================================================================
|
||||
// Tunable items
|
||||
|
||||
|
||||
integer debug = FALSE; // enablefor chattiness
|
||||
integer PHYSICAL = TRUE; // for smooth movemenents enable physical.
|
||||
// For less lag, set this to false, but the motion willl be very quick and jerky.
|
||||
|
||||
string FLOWER_NAME = "Flower"; // the name of the thing we seek
|
||||
string HIVE_NAME = "Beehive";
|
||||
float DIST = 15.0; // gow far to fly, max
|
||||
// For less lag, set this to false, but the motion willl be very quick and jerky.
|
||||
|
||||
string FLOWER_NAME = "Flower"; // the name of the thing we seek
|
||||
string HIVE_NAME = "Beehive Box-1";
|
||||
float DIST = 25.0; // gow far to fly, max
|
||||
float SPEED = 1; // move in this number of seconds from place to place
|
||||
|
||||
|
||||
// code bits
|
||||
vector vInitROT = <90,0,0> ; // due to the sculpted body, this bee gets rotated 90 degrees.
|
||||
vector vFlowerOffset = <0,.10,0.1>;// due to the rotation on the sculpted body, this is back and up a bit.
|
||||
vector vHiveOffset = <0,.5,0>;
|
||||
vector vHiveOffset = <0,.5,0>;
|
||||
rotation r90; // a calculated 90 degree rotation ends up here
|
||||
integer iCount = 0; // hive counter
|
||||
string sLocatedName; // located name of item
|
||||
list lGlist; // This is used as a first in first out stack with 2 entries per element
|
||||
|
||||
string sLocatedName = "Beehive Box-1"; // located name of item
|
||||
list lGlist; // This is used as a first in first out stack with 2 entries per element
|
||||
|
||||
DEBUG(string str)
|
||||
{
|
||||
if (debug) llOwnerSay(llGetScriptName() + ":" + str);
|
||||
}
|
||||
|
||||
|
||||
// pop the top entry off the stack
|
||||
poplGlist() {
|
||||
lGlist = llDeleteSubList(lGlist,0,1);
|
||||
}
|
||||
|
||||
// Get the top Position
|
||||
vector Gpos() {
|
||||
return llList2Vector(lGlist,0);
|
||||
}
|
||||
|
||||
// Get the top Rotation
|
||||
rotation Grot() {
|
||||
return llList2Rot(lGlist,1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// pop the top entry off the stack
|
||||
poplGlist() {
|
||||
lGlist = llDeleteSubList(lGlist,0,1);
|
||||
}
|
||||
|
||||
// Get the top Position
|
||||
vector Gpos() {
|
||||
return llList2Vector(lGlist,0);
|
||||
}
|
||||
|
||||
// Get the top Rotation
|
||||
rotation Grot() {
|
||||
return llList2Rot(lGlist,1);
|
||||
}
|
||||
|
||||
SetRotPos(rotation rot, vector dest)
|
||||
{
|
||||
DEBUG("moveto:" + (string) dest);
|
||||
@@ -71,111 +73,118 @@ SetRotPos(rotation rot, vector dest)
|
||||
} else {
|
||||
llSetRegionPos(dest);
|
||||
llSetRot(rot);
|
||||
llSetStatus(STATUS_PHANTOM,TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
default
|
||||
{
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
{
|
||||
llStopMoveToTarget(); // new inworldz
|
||||
sLocatedName = "";
|
||||
llSetLinkPrimitiveParamsFast(LINK_ALL_CHILDREN, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_NONE]);
|
||||
// set rotation for this sculpted bee - remove this if yiou use a base prim
|
||||
vector new = vInitROT * DEG_TO_RAD;
|
||||
llSetLinkPrimitiveParamsFast(LINK_ALL_CHILDREN, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_NONE]); //new inworldz
|
||||
llSleep(2); //new Inworldz
|
||||
// set rotation for this sculpted bee - remove this if yiou use a base prim| saved-> PRIM_PHYSICS_SHAPE_TYPE
|
||||
vector new = vInitROT * DEG_TO_RAD;
|
||||
r90 = llEuler2Rot(new);
|
||||
|
||||
llSetTimerEvent(.1); // let's go!
|
||||
|
||||
if (PHYSICAL)
|
||||
llSetStatus(STATUS_PHYSICS,TRUE);
|
||||
else
|
||||
llSetStatus(STATUS_PHYSICS,FALSE);
|
||||
}
|
||||
|
||||
on_rez(integer p)
|
||||
{
|
||||
llResetScript();
|
||||
}
|
||||
|
||||
timer()
|
||||
{
|
||||
llSetTimerEvent(0);
|
||||
if (sLocatedName == FLOWER_NAME)
|
||||
{
|
||||
if ( lGlist != [] )
|
||||
{
|
||||
llPlaySound("buzz1",1.0);
|
||||
|
||||
SetRotPos(Grot() * r90 , Gpos() + vFlowerOffset); // orient to it
|
||||
llSetTimerEvent(4);
|
||||
poplGlist(); // pop the top entry off the stack
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
llSetTimerEvent(.2); // let's go!// move time up from .1 to .2
|
||||
|
||||
if (PHYSICAL) {
|
||||
llSetStatus(STATUS_PHYSICS,FALSE); // disable, then enable to get it to engage
|
||||
llSetStatus(STATUS_PHYSICS,TRUE);
|
||||
} else{
|
||||
llSetStatus(STATUS_PHYSICS,FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
on_rez(integer p)
|
||||
{
|
||||
llSetStatus(STATUS_PHYSICS,FALSE); //new Inworldz
|
||||
llStopMoveToTarget( ); // new - inworldz - I Know Overkill!
|
||||
llResetScript();
|
||||
}
|
||||
|
||||
timer()
|
||||
{
|
||||
llSetTimerEvent(0);
|
||||
if (sLocatedName == FLOWER_NAME)
|
||||
{
|
||||
if ( lGlist != [] )
|
||||
{
|
||||
llPlaySound("buzz1",1.0);
|
||||
|
||||
SetRotPos(Grot() * r90 , Gpos() + vFlowerOffset); // orient to it
|
||||
llSetTimerEvent(4);
|
||||
poplGlist(); // pop the top entry off the stack
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG("Look for Hive");
|
||||
llSensor(HIVE_NAME,NULL_KEY,ACTIVE|PASSIVE,DIST,PI); // Hive can be scripted, or not
|
||||
}
|
||||
}
|
||||
else if (sLocatedName == HIVE_NAME)
|
||||
{
|
||||
if ( iCount == 0 )
|
||||
{
|
||||
SetRotPos(llGetRot(), Gpos()); // move in
|
||||
llSetTimerEvent(10);
|
||||
}
|
||||
else if ( iCount == 1 )
|
||||
{
|
||||
llSetTimerEvent(2);
|
||||
SetRotPos(llGetRot(),Gpos() + vHiveOffset); // move out
|
||||
}
|
||||
else {
|
||||
sLocatedName = ""; // fall into llSensor FLOWER_NAME
|
||||
llSetTimerEvent(1); // adjust pause here
|
||||
}
|
||||
iCount++;
|
||||
}
|
||||
else if (sLocatedName == HIVE_NAME)
|
||||
{
|
||||
if ( iCount == 0 )
|
||||
{
|
||||
SetRotPos(llGetRot(), Gpos()); // move in
|
||||
llSetTimerEvent(10);
|
||||
}
|
||||
else if ( iCount == 1 )
|
||||
{
|
||||
llSetTimerEvent(2);
|
||||
SetRotPos(llGetRot(),Gpos() + vHiveOffset); // move out
|
||||
}
|
||||
else {
|
||||
sLocatedName = ""; // fall into llSensor FLOWER_NAME
|
||||
llSetTimerEvent(2); // adjust pause here
|
||||
}
|
||||
iCount++;
|
||||
} else { // fixed here
|
||||
// as you don't want to "fall" into here until after a 1 second pause
|
||||
|
||||
DEBUG("Look for Flower");
|
||||
// as you don't want to "fall" into here until after a 1 second pause
|
||||
|
||||
DEBUG("Look for Flower");
|
||||
llSensor(FLOWER_NAME, NULL_KEY, ACTIVE|PASSIVE, DIST,PI); // flowers can be scripted, or not
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sensor(integer numDetected)
|
||||
{
|
||||
DEBUG("detected:" + (string) numDetected);
|
||||
sLocatedName = llDetectedName(0);
|
||||
// Clear the stack and place the first entry on it
|
||||
lGlist = [ llDetectedPos(0), llDetectedRot(0) ];
|
||||
if (sLocatedName == FLOWER_NAME)
|
||||
{
|
||||
// Append any additional Flowers entries onto the stack
|
||||
integer i;
|
||||
for (i = 1; i < numDetected; i++)
|
||||
{
|
||||
lGlist += [ llDetectedPos(i), llDetectedRot(i) ];
|
||||
}
|
||||
} else {
|
||||
iCount = 0;
|
||||
llPlaySound("buzz1",1.0);
|
||||
// start moving towards the Hive
|
||||
SetRotPos(Grot() * r90,Gpos() + vHiveOffset); // orient to it
|
||||
}
|
||||
// next step is always timer event
|
||||
llSetTimerEvent(1);
|
||||
}
|
||||
|
||||
no_sensor()
|
||||
{
|
||||
sLocatedName = "";
|
||||
|
||||
|
||||
sensor(integer numDetected)
|
||||
{
|
||||
DEBUG("detected:" + (string) numDetected);
|
||||
sLocatedName = llDetectedName(0);
|
||||
// Clear the stack and place the first entry on it
|
||||
lGlist = [ llDetectedPos(0), llDetectedRot(0) ];
|
||||
if (sLocatedName == FLOWER_NAME)
|
||||
{
|
||||
// Append any additional Flowers entries onto the stack
|
||||
integer i;
|
||||
for (i = 1; i < numDetected; i++)
|
||||
{
|
||||
lGlist += [ llDetectedPos(i), llDetectedRot(i) ];
|
||||
}
|
||||
} else {
|
||||
iCount = 0;
|
||||
llPlaySound("buzz1",1.0);
|
||||
// start moving towards the Hive
|
||||
SetRotPos(Grot() * r90,Gpos() + vHiveOffset); // orient to it
|
||||
}
|
||||
// next step is always timer event
|
||||
llSetTimerEvent(1);
|
||||
}
|
||||
|
||||
no_sensor()
|
||||
{
|
||||
sLocatedName = "";
|
||||
llSetTimerEvent(15); // try again
|
||||
}
|
||||
|
||||
|
||||
changed(integer change)
|
||||
{
|
||||
if (change & CHANGED_REGION_START)
|
||||
llResetScript();
|
||||
llResetScript();
|
||||
}
|
||||
}
|
||||
// end of code
|
||||
}
|
||||
// end of code
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
<Solution name="Give all inventory items in a folder when close by">
|
||||
<Project name="Give all inventory items in a folder when close by" path="Give all inventory items in a folder when close by\Give all inventory items in a folder when close by.prj" active="true"/>
|
||||
</Solution>
|
||||
@@ -1,10 +0,0 @@
|
||||
<Project name="Give all inventory items in a folder when close by" guid="47643d58-cfd1-4fb6-aea1-277c935847bb">
|
||||
<Object name="Object" guid="dfefe270-c8f3-46d3-a706-bcbd19cfd927" active="true">
|
||||
<Snapshot name="dragon lady5;2;5.jpg" guid="43d895e0-a601-461c-94d4-6a977cef6220">
|
||||
</Snapshot>
|
||||
<Snapshot name="dragon;4;4;5.jpg" guid="73685177-2a5b-4500-a85f-d740672ea814">
|
||||
</Snapshot>
|
||||
<Script name="Script for Board.lsl" guid="eb71690d-a6f8-4520-9fbb-57abde9fae58">
|
||||
</Script>
|
||||
</Object>
|
||||
</Project>
|
||||
@@ -1,171 +0,0 @@
|
||||
// :SHOW:
|
||||
// :CATEGORY:Presentation
|
||||
// :NAME:Give all inventory items in a folder when close by
|
||||
// :AUTHOR:Lum Pfohl
|
||||
// :KEYWORDS:
|
||||
// :CREATED:2015-11-24 20:25:32
|
||||
// :EDITED:2015-11-24 19:25:32
|
||||
// :ID:1086
|
||||
// :NUM:1833
|
||||
// :REV:1
|
||||
// :WORLD:Second Life
|
||||
// :DESCRIPTION:
|
||||
// LumVision-Presentation Script v 0.2
|
||||
// :CODE:
|
||||
// Mods by Ferd Frederix to support GIFS
|
||||
//
|
||||
// LumVision-Presentation Script v 0.2
|
||||
//
|
||||
// Written by Lum Pfohl December 11, 2007
|
||||
//
|
||||
// January 02, 2008 - Added code to precache the next texture after a short time delay
|
||||
|
||||
|
||||
// set to TRUE if you want debug messages written to chat screen
|
||||
integer __debug = FALSE;
|
||||
string __version_id = "Presentation Script v 0.3";
|
||||
|
||||
// global variables
|
||||
integer interval;
|
||||
integer currentTexture = 0;
|
||||
|
||||
integer totalTextures = 0;
|
||||
list textureList =[];
|
||||
integer messageChannel = 999888;
|
||||
list dynMenu =["Back", "Version", "Forward", "Reset"];
|
||||
|
||||
|
||||
gif()
|
||||
{
|
||||
string t = llList2String(textureList, currentTexture);
|
||||
list gif = llParseString2List(t,[";"],[]);
|
||||
string aname = llList2String(gif,0);
|
||||
integer X = (integer) llList2String(gif,1);
|
||||
integer Y = (integer) llList2String(gif,2);
|
||||
float FPS = (float) llList2String(gif,3);
|
||||
float product = X * Y;
|
||||
|
||||
|
||||
|
||||
// Set the new prim texture
|
||||
|
||||
llSetTexture(llList2String(textureList, currentTexture), 0);
|
||||
|
||||
if (X) {
|
||||
llSetTextureAnim( ANIM_ON | LOOP, ALL_SIDES, X, Y, 0.0, product, FPS);
|
||||
} else {
|
||||
llSetTextureAnim( LOOP, ALL_SIDES, 1,1, 0.0, 1 , FPS);
|
||||
}
|
||||
|
||||
}
|
||||
default {
|
||||
state_entry() {
|
||||
|
||||
|
||||
// read in the textures in the prim and store it
|
||||
integer typeCount = llGetInventoryNumber(INVENTORY_TEXTURE);
|
||||
|
||||
integer j;
|
||||
|
||||
for (j = 0; j < typeCount; ++j) {
|
||||
string invName = llGetInventoryName(INVENTORY_TEXTURE, j);
|
||||
if (__debug) {
|
||||
llWhisper(0, "Inventory " + invName);
|
||||
}
|
||||
textureList += invName;
|
||||
++totalTextures;
|
||||
}
|
||||
|
||||
if (__debug) {
|
||||
llWhisper(0, "Found " + (string) totalTextures + " textures");
|
||||
}
|
||||
|
||||
llSetTexture(llList2String(textureList, 0), 0);
|
||||
gif();
|
||||
|
||||
// initialize the channel on which the vendor will talk to the owner via dialog
|
||||
messageChannel = (integer) llFrand(2000000000.0);
|
||||
llListen(messageChannel, "", NULL_KEY, "");
|
||||
|
||||
currentTexture = 0;
|
||||
}
|
||||
|
||||
on_rez(integer start_param) {
|
||||
llResetScript();
|
||||
}
|
||||
|
||||
|
||||
touch_start(integer total_number) {
|
||||
|
||||
if (llDetectedKey(0) == llGetOwner()) {
|
||||
llDialog(llDetectedKey(0), "What do you want to do?", dynMenu, messageChannel);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// listen for for dialog box messages and respond to them as appropriate
|
||||
|
||||
listen(integer channel, string name, key id, string message) {
|
||||
|
||||
if (id != llGetOwner()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (message == "Version") {
|
||||
llWhisper(0, __version_id);
|
||||
return;
|
||||
}
|
||||
|
||||
if (message == "Reset") {
|
||||
llResetScript();
|
||||
}
|
||||
|
||||
if (message == "Back" && currentTexture > 0) {
|
||||
--currentTexture;
|
||||
} else if (message == "Forward") {
|
||||
++currentTexture;
|
||||
} else {
|
||||
llDialog(llGetOwner(), "What do you want to do?", dynMenu, messageChannel);
|
||||
return;
|
||||
}
|
||||
|
||||
// If there are textures to apply, do so now. Otherwise - quietly
|
||||
// do nothing.
|
||||
if (totalTextures > 0) {
|
||||
|
||||
// Ensure that we do not go out of bounds with the index
|
||||
if (currentTexture >= totalTextures) {
|
||||
currentTexture = 0;
|
||||
}
|
||||
if (currentTexture < 0 ) {
|
||||
currentTexture = 0;
|
||||
}
|
||||
|
||||
gif();
|
||||
|
||||
// set up so that in 3 seconds, we display the next image on a different face (hidden)
|
||||
llSetTimerEvent(3.00);
|
||||
|
||||
llDialog(llGetOwner(), "What do you want to do?", dynMenu, messageChannel);
|
||||
}
|
||||
}
|
||||
|
||||
timer() {
|
||||
// Cancel any further timer events
|
||||
llSetTimerEvent(0.00);
|
||||
|
||||
// set the next texture (as a pre-cache) on the reverse face
|
||||
integer nextTexture = currentTexture + 1;
|
||||
if (nextTexture >= totalTextures) {
|
||||
nextTexture = 0;
|
||||
}
|
||||
llSetTexture(llList2String(textureList, nextTexture), 1);
|
||||
}
|
||||
|
||||
changed(integer what)
|
||||
{
|
||||
if (what & CHANGED_INVENTORY)
|
||||
llResetScript();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
llSay(0, "Hello, Avatar!");
|
||||
}
|
||||
touch_start(integer total_number)
|
||||
{
|
||||
llSay(0, "Touched: "+(string)total_number);
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 180 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 35 KiB |
@@ -4,7 +4,7 @@
|
||||
// :AUTHOR:Ferd Frederix
|
||||
// :KEYWORDS:
|
||||
// :CREATED:2012-09-04 15:30:52.010
|
||||
// :EDITED:2016-07-09 14:33:55
|
||||
// :EDITED:2016-07-27 15:13:53
|
||||
// :ID:902
|
||||
// :NUM:1278
|
||||
// :REV:1.1
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
<Project name="Multi-pose script" guid="233f6e31-95a1-438e-80d0-4448aa0cac7b">
|
||||
<Object name="Object" guid="bc7ae54d-932e-4b75-9bb2-f63409d6fccd" active="true">
|
||||
<Animation name="Animation.ani" guid="584c57c3-bd10-48d4-bea6-19ba8fe8e430">
|
||||
</Animation>
|
||||
<Animation name="Animation2.ani" guid="1c465e9c-6a22-4ec3-a5db-85a25a8f9006">
|
||||
</Animation>
|
||||
<Script name="Script.lsl" guid="e52a0629-9fda-4d09-b6ef-e8a41a54115b">
|
||||
</Script>
|
||||
</Object>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// :AUTHOR:Ferd Frederix
|
||||
// :KEYWORDS:
|
||||
// :CREATED:2013-12-14 13:33:32
|
||||
// :EDITED:2016-07-09 14:34:03
|
||||
// :EDITED:2016-07-27 15:14:06
|
||||
// :ID:902
|
||||
// :NUM:1558
|
||||
// :REV:1.2
|
||||
|
||||
@@ -178,7 +178,7 @@ getCategories()
|
||||
{
|
||||
type = 1;
|
||||
busy = TRUE;
|
||||
string url = "http://www.free-lsl-scripts.com/cgi/shoutcast.plx?search=1";
|
||||
string url = "http://www.outworldz.com/cgi/shoutcast.plx?search=1";
|
||||
http_request_id = llHTTPRequest(url, [], "");
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ getCategory()
|
||||
{
|
||||
type = 2;
|
||||
busy = TRUE;
|
||||
string url = "http://www.free-lsl-scripts.com/cgi/shoutcast.plx?genre=" + llEscapeURL(genre);
|
||||
string url = "http://www.outworldz.com/cgi/shoutcast.plx?genre=" + llEscapeURL(genre);
|
||||
|
||||
// llOwnerSay(url);
|
||||
|
||||
@@ -197,7 +197,7 @@ getURL()
|
||||
{
|
||||
type = 3;
|
||||
busy = TRUE;
|
||||
string url = "http://www.free-lsl-scripts.com/cgi/shoutcast.plx?genre=" + llEscapeURL(genre) + "&station=" + llEscapeURL(station);
|
||||
string url = "http://www.outworldz.com/cgi/shoutcast.plx?genre=" + llEscapeURL(genre) + "&station=" + llEscapeURL(station);
|
||||
|
||||
http_request_id = llHTTPRequest(url, [], "");
|
||||
}
|
||||
@@ -328,10 +328,11 @@ listen(integer channel, string name, key id, string message)
|
||||
}
|
||||
|
||||
http_response(key request_id, integer status, list metadata, string body)
|
||||
{
|
||||
{
|
||||
if (request_id == http_request_id)
|
||||
{
|
||||
busy = FALSE;
|
||||
|
||||
if (type == 1)
|
||||
{
|
||||
lCategories = llParseString2List(body,["|"],[]);
|
||||
|
||||
Reference in New Issue
Block a user