New NPC chatbot controller

This commit is contained in:
Fred Beckhusen
2016-07-27 16:16:37 -05:00
parent 58a3180d13
commit b64eb5baef
23 changed files with 5929 additions and 6109 deletions

View File

@@ -26,6 +26,8 @@
</Script> </Script>
<Script name="Collision test.lsl" guid="9a7e990c-7f43-400f-b2a7-2e0311162d5a"> <Script name="Collision test.lsl" guid="9a7e990c-7f43-400f-b2a7-2e0311162d5a">
</Script> </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 name="Stop Processing.lsl" guid="1a220cc3-3120-4997-9d06-01f721ccda97">
</Script> </Script>
<Script name="Touch to Go.lsl" guid="1f188bfb-241f-410b-b29c-e81b8df22358"> <Script name="Touch to Go.lsl" guid="1f188bfb-241f-410b-b29c-e81b8df22358">

View File

@@ -26,110 +26,110 @@ integer OS_NPC_FLY = 7;
integer osIsNpc(key id){ integer osIsNpc(key id){
return TRUE; return TRUE;
} }
osNpcStand(key npc) { osNpcStand(key npc) {
llOwnerSay("Standing"); llOwnerSay("Standing");
} }
vector osNpcGetPos(key id) { vector osNpcGetPos(key id) {
vector vDestPos; vector vDestPos;
vDestPos.x += llFrand(1.0); // some randomness for debugging vDestPos.x += llFrand(1.0); // some randomness for debugging
llOwnerSay("Reached " + (string) vDestPos); llOwnerSay("Reached " + (string) vDestPos);
return vDestPos; return vDestPos;
} }
osNpcMoveToTarget(key npc, vector target, integer options){ 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) { key osNpcCreate(string firstname, string lastname, vector position, string cloneFrom, integer options) {
llSay(0,"Creating NPC " + firstname + " " + lastname + " at " + (string) position); llSay(0,"Creating NPC " + firstname + " " + lastname + " at " + (string) position);
return (key) "12345000-0000-0000-0000-0000000000002"; return (key) "12345000-0000-0000-0000-0000000000002";
} }
osNpcLoadAppearance(key npc, string notecard) { osNpcLoadAppearance(key npc, string notecard) {
llSay(0,"Load notecard " + notecard); llSay(0,"Load notecard " + notecard);
} }
osNpcPlayAnimation(key npc, string animation) { osNpcPlayAnimation(key npc, string animation) {
llSay(0,"Playing animation " + animation); llSay(0,"Playing animation " + animation);
} }
osNpcStopAnimation(key npc, string animation) { osNpcStopAnimation(key npc, string animation) {
llSay(0,"Stopped animation " + animation); llSay(0,"Stopped animation " + animation);
} }
osNpcSay(key npc, integer iChannel, string message) { osNpcSay(key npc, integer iChannel, string message) {
llSay(0,"Saying " + message); llSay(0,"Saying " + message);
} }
osNpcWhisper(key npc, integer iChannel, string message) { osNpcWhisper(key npc, integer iChannel, string message) {
llSay(0,"Whispering " + message); llSay(0,"Whispering " + message);
} }
osNpcShout(key npc, integer iChannel, string message) { osNpcShout(key npc, integer iChannel, string message) {
llSay(0,"Shouting " + message); llSay(0,"Shouting " + message);
} }
osNpcSit(key npc, key target, integer options) { osNpcSit(key npc, key target, integer options) {
llSay(0,"Sat on " +target); llSay(0,"Sat on " +target);
} }
osNpcSetRot(key npc, rotation rot) { 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) { osOwnerSaveAppearance(string notecard) {
llSay(0,"Created Notecard " + notecard); llSay(0,"Created Notecard " + notecard);
} }
osAgentSaveAppearance(key avatar, string notecard) { osAgentSaveAppearance(key avatar, string notecard) {
llSay(0,"Created Notecard " + notecard); llSay(0,"Created Notecard " + notecard);
} }
osNpcRemove (key target) { osNpcRemove (key target) {
llSay(0,"NPC removed"); llSay(0,"NPC removed");
} }
list osGetAvatarList () { list osGetAvatarList () {
list lStuff = [(key) "12345000-0000-0000-0000-0000000000002", <1,2,3>, "Digit Gorilla"]; list lStuff = [(key) "12345000-0000-0000-0000-0000000000002", <1,2,3>, "Digit Gorilla"];
return lStuff; return lStuff;
} }
osMakeNotecard(string notecardName, string contents) { osMakeNotecard(string notecardName, string contents) {
llOwnerSay("Make Notecard " + notecardName + "Contents:" + (string) contents); llOwnerSay("Make Notecard " + notecardName + "Contents:" + (string) contents);
} }
string osGetNotecard(string name) { string osGetNotecard(string name) {
// sample notecard for testing // sample notecard for testing
string str = "@spawn=Digit Gorilla|<645, 128, 25>\n" string str = "@spawn=Digit Gorilla|<645, 128, 25>\n"
+ "@walk=<645, 120, 25>\n" + "@walk=<645, 120, 25>\n"
+ "REPEAT\n" + "REPEAT\n"
+ "@cmd=0|Hello on channel 0\n" + "@cmd=0|Hello on channel 0\n"
+ "@wander=3|5\n" + "@wander=3|5\n"
+ "@say=say , walking is so tiresome...\n" + "@say=say , walking is so tiresome...\n"
+ "@whisper=whisper, walking is so tiresome...\n" + "@whisper=whisper, walking is so tiresome...\n"
+ "@shout=shout, walking is so tiresome...\n" + "@shout=shout, walking is so tiresome...\n"
+ "@goto=REPEAT\n" + "@goto=REPEAT\n"
+ "@goto=NEXT\n" + "@goto=NEXT\n"
+ "@say=i will never say this...\n" + "@say=i will never say this...\n"
+ "NEXT\n" + "NEXT\n"
+ "@sound=somesound\n" + "@sound=somesound\n"
+ "@randsound\n" + "@randsound\n"
+ "@pause=5\n" + "@pause=5\n"
+ "@rotate=90\n" + "@rotate=90\n"
+ "@wander=3|1\n" + "@wander=3|1\n"
+ "@say=Uff, I'm done...\n" + "@say=Uff, I'm done...\n"
+ "@delete\n"; + "@delete\n";
return str; return str;
} }
osAvatarPlayAnimation(key npc, string animation){ osAvatarPlayAnimation(key npc, string animation){
llSay(0,"playing " + animation); llSay(0,"playing " + animation);
} }
osAvatarStopAnimation(key npc, string animation){ osAvatarStopAnimation(key npc, string animation){
llSay(0,"Stopping " + animation); llSay(0,"Stopping " + animation);
} }
osForceOtherSit(key AvatarKey, key UUID) { osForceOtherSit(key AvatarKey, key UUID) {
llSay(0,"Sitting"); llSay(0,"Sitting");
} }
osSetSpeed(key NPC, float speed) { 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) {;} osNpcTouch(key NPC, key thing, integer where) {;}
osForceAttachToOtherAvatarFromInventory(key npc, string inventory, integer point) { 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) {;} 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 // END commented code for OpenSim vs Editor environments
//*******************************************************************// //*******************************************************************//
// comment this out, is only here for testing in LSLEditor. // comment this out, is only here for testing in LSLEditor.
default {} default {}

View File

@@ -1,10 +1,10 @@
// :SHOW: // :SHOW:1
// :CATEGORY:NPC // :CATEGORY:NPC
// :NAME:All In One NPC Recorder and Player // :NAME:All In One NPC Recorder and Player
// :AUTHOR:Ferd Frederix // :AUTHOR:Ferd Frederix
// :KEYWORDS: // :KEYWORDS:
// :CREATED:2015-07-17 13:15:19 // :CREATED:2015-07-17 13:15:19
// :EDITED:2015-07-17 12:15:19 // :EDITED:2016-07-10 09:24:25
// :ID:27 // :ID:27
// :NUM:1807 // :NUM:1807
// :REV:1 // :REV:1
@@ -15,13 +15,13 @@
default default
{ {
state_entry() { state_entry() {
llSetText("Type commands in chat to control the NPC, such as '@say=Hello'",<1,1,1>,1.0); llSetText("Type commands in chat to control the NPC, such as '@say=Hello'",<1,1,1>,1.0);
llListen(0,"","",""); llListen(0,"","","");
} }
listen(integer channel, string name, key id, string message) listen(integer channel, string name, key id, string message)
{ {
llMessageLinked(LINK_ROOT,0, message,""); llMessageLinked(LINK_ROOT,0, message,"");
} }
} }

View File

@@ -4,7 +4,7 @@
// :AUTHOR:Ferd Frederix // :AUTHOR:Ferd Frederix
// :KEYWORDS: // :KEYWORDS:
// :CREATED:2015-07-17 13:15:49 // :CREATED:2015-07-17 13:15:49
// :EDITED:2015-09-23 12:06:52 // :EDITED:2016-07-10 09:24:25
// :ID:27 // :ID:27
// :NUM:1808 // :NUM:1808
// :REV:3 // :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. // rev 3: added on_rez() and STATUS_PHANTOM to state_entry - otherwise reset on Linux boxes did no collide any more.
default default
{ {
state_entry() state_entry()
{ {
llSetStatus(STATUS_PHANTOM,FALSE); llSetStatus(STATUS_PHANTOM,FALSE);
llVolumeDetect(FALSE); llVolumeDetect(FALSE);
llSleep(0.1); llSleep(0.1);
llVolumeDetect(TRUE); llVolumeDetect(TRUE);
} }
collision_start(integer n) { collision_start(integer n) {
llMessageLinked(LINK_SET,0, "@animate=someanimation|10",""); llMessageLinked(LINK_SET,0, "@animate=someanimation|10","");
llSetTimerEvent(5); llSetTimerEvent(5);
} }
timer() timer()
{ {
llMessageLinked(LINK_SET,0, "@animate=Stand|1",""); llMessageLinked(LINK_SET,0, "@animate=Stand|1","");
llSetTimerEvent(0); llSetTimerEvent(0);
} }
changed(integer what) changed(integer what)
{ {
if (what & CHANGED_REGION_START) if (what & CHANGED_REGION_START)
{ {
llResetScript(); llResetScript();
} }
} }
on_rez(integer p) on_rez(integer p)
{ {
llResetScript(); llResetScript();
} }
} }

View File

@@ -1,10 +1,10 @@
// :SHOW: // :SHOW:1
// :CATEGORY:NPC // :CATEGORY:NPC
// :NAME:All In One NPC Recorder and Player // :NAME:All In One NPC Recorder and Player
// :AUTHOR:Ferd Frederix // :AUTHOR:Ferd Frederix
// :KEYWORDS: // :KEYWORDS:
// :CREATED:2015-07-17 13:16:10 // :CREATED:2015-07-17 13:16:10
// :EDITED:2015-07-17 12:16:10 // :EDITED:2016-07-10 09:24:25
// :ID:27 // :ID:27
// :NUM:1809 // :NUM:1809
// :REV:1 // :REV:1
@@ -15,12 +15,12 @@
default default
{ {
state_entry() { state_entry() {
llSetText("Click to make the NPC stop processing commands",<1,1,1>,1.0); llSetText("Click to make the NPC stop processing commands",<1,1,1>,1.0);
} }
touch_start(integer total_number) touch_start(integer total_number)
{ {
llMessageLinked(LINK_ROOT,0, "@stop",""); llMessageLinked(LINK_ROOT,0, "@stop","");
} }
} }

View File

@@ -1,26 +1,26 @@
// :SHOW: // :SHOW:1
// :CATEGORY:NPC // :CATEGORY:NPC
// :NAME:All In One NPC Recorder and Player // :NAME:All In One NPC Recorder and Player
// :AUTHOR:Ferd Frederix // :AUTHOR:Ferd Frederix
// :KEYWORDS: // :KEYWORDS:
// :CREATED:2015-07-17 13:16:51 // :CREATED:2015-07-17 13:16:51
// :EDITED:2015-07-17 12:16:51 // :EDITED:2016-07-10 09:24:25
// :ID:27 // :ID:27
// :NUM:1811 // :NUM:1811
// :REV:1 // :REV:1
// :WORLD:Second Life // :WORLD:Opensim
// :DESCRIPTION: // :DESCRIPTION:
// Sample touch to trigger a NPC script // Sample touch to trigger a NPC script
// :CODE: // :CODE:
default default
{ {
state_entry() { state_entry() {
llSetText("Click to make the NPC say hello",<1,1,1>,1.0); llSetText("Click to make the NPC say hello",<1,1,1>,1.0);
} }
touch_start(integer total_number) touch_start(integer total_number)
{ {
llMessageLinked(LINK_ROOT, 0, "@say=Hello there, " + llDetectedName(0), ""); llMessageLinked(LINK_ROOT, 0, "@say=Hello there, " + llDetectedName(0), "");
} }
} }

View File

@@ -1,26 +1,26 @@
// :SHOW: // :SHOW:1
// :CATEGORY:NPC // :CATEGORY:NPC
// :NAME:All In One NPC Recorder and Player // :NAME:All In One NPC Recorder and Player
// :AUTHOR:Ferd Frederix // :AUTHOR:Ferd Frederix
// :KEYWORDS: // :KEYWORDS:
// :CREATED:2015-07-17 13:16:29 // :CREATED:2015-07-17 13:16:29
// :EDITED:2015-07-17 12:16:29 // :EDITED:2016-07-10 09:24:25
// :ID:27 // :ID:27
// :NUM:1810 // :NUM:1810
// :REV:1 // :REV:1
// :WORLD:Second Life // :WORLD:Opensim
// :DESCRIPTION: // :DESCRIPTION:
// Sample touch to go script for all in one NPC animator // Sample touch to go script for all in one NPC animator
// :CODE: // :CODE:
default default
{ {
state_entry() { state_entry() {
llSetText("Click to make the NPC continue processing commands",<1,1,1>,1.0); llSetText("Click to make the NPC continue processing commands",<1,1,1>,1.0);
} }
touch_start(integer total_number) touch_start(integer total_number)
{ {
llMessageLinked(LINK_ROOT,0, "@go",""); llMessageLinked(LINK_ROOT,0, "@go","");
} }
} }

View File

@@ -4,10 +4,10 @@
// :AUTHOR:Ferd Frederix // :AUTHOR:Ferd Frederix
// :KEYWORDS: // :KEYWORDS:
// :CREATED:2013-09-08 12:59:45 // :CREATED:2013-09-08 12:59:45
// :EDITED:2015-03-17 09:26:22 // :EDITED:2016-07-10 09:24:29
// :ID:995 // :ID:995
// :NUM:1725 // :NUM:1725
// :REV:4 // :REV:5
// :WORLD:Opensim, SecondLife // :WORLD:Opensim, SecondLife
// :DESCRIPTION: // :DESCRIPTION:
// A free flying bee that gathers pollen and takes it to his hive for either OpenSim or Second Life // A free flying bee that gathers pollen and takes it to his hive for either OpenSim or Second Life
@@ -18,18 +18,20 @@
// Mods by Donjr Spiegelblatt for Opensim to remove chance of thread locking on 3/7/2015 // Mods by Donjr Spiegelblatt for Opensim to remove chance of thread locking on 3/7/2015
// Thank YOU very much, DonJr ! // 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. // 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 // Tunable items
integer debug = FALSE; // enablefor chattiness integer debug = FALSE; // enablefor chattiness
integer PHYSICAL = TRUE; // for smooth movemenents enable physical. integer PHYSICAL = TRUE; // for smooth movemenents enable physical.
// For less lag, set this to false, but the motion willl be very quick and jerky. // 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 FLOWER_NAME = "Flower"; // the name of the thing we seek
string HIVE_NAME = "Beehive"; string HIVE_NAME = "Beehive Box-1";
float DIST = 15.0; // gow far to fly, max float DIST = 25.0; // gow far to fly, max
float SPEED = 1; // move in this number of seconds from place to place float SPEED = 1; // move in this number of seconds from place to place
// code bits // code bits
@@ -38,7 +40,7 @@ vector vFlowerOffset = <0,.10,0.1>;// due to the rotation on the sculpted body,
vector vHiveOffset = <0,.5,0>; vector vHiveOffset = <0,.5,0>;
rotation r90; // a calculated 90 degree rotation ends up here rotation r90; // a calculated 90 degree rotation ends up here
integer iCount = 0; // hive counter integer iCount = 0; // hive counter
string sLocatedName; // located name of item 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 list lGlist; // This is used as a first in first out stack with 2 entries per element
DEBUG(string str) DEBUG(string str)
@@ -49,17 +51,17 @@ DEBUG(string str)
// pop the top entry off the stack // pop the top entry off the stack
poplGlist() { poplGlist() {
lGlist = llDeleteSubList(lGlist,0,1); lGlist = llDeleteSubList(lGlist,0,1);
} }
// Get the top Position // Get the top Position
vector Gpos() { vector Gpos() {
return llList2Vector(lGlist,0); return llList2Vector(lGlist,0);
} }
// Get the top Rotation // Get the top Rotation
rotation Grot() { rotation Grot() {
return llList2Rot(lGlist,1); return llList2Rot(lGlist,1);
} }
SetRotPos(rotation rot, vector dest) SetRotPos(rotation rot, vector dest)
@@ -71,6 +73,7 @@ SetRotPos(rotation rot, vector dest)
} else { } else {
llSetRegionPos(dest); llSetRegionPos(dest);
llSetRot(rot); llSetRot(rot);
llSetStatus(STATUS_PHANTOM,TRUE);
} }
} }
@@ -78,23 +81,29 @@ default
{ {
state_entry() state_entry()
{ {
llStopMoveToTarget(); // new inworldz
sLocatedName = ""; sLocatedName = "";
llSetLinkPrimitiveParamsFast(LINK_ALL_CHILDREN, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_NONE]); llSetLinkPrimitiveParamsFast(LINK_ALL_CHILDREN, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_NONE]); //new inworldz
// set rotation for this sculpted bee - remove this if yiou use a base prim llSleep(2); //new Inworldz
vector new = vInitROT * DEG_TO_RAD; // 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); r90 = llEuler2Rot(new);
llSetTimerEvent(.1); // let's go! llSetTimerEvent(.2); // let's go!// move time up from .1 to .2
if (PHYSICAL) if (PHYSICAL) {
llSetStatus(STATUS_PHYSICS,TRUE); llSetStatus(STATUS_PHYSICS,FALSE); // disable, then enable to get it to engage
else llSetStatus(STATUS_PHYSICS,TRUE);
llSetStatus(STATUS_PHYSICS,FALSE); } else{
llSetStatus(STATUS_PHYSICS,FALSE);
}
} }
on_rez(integer p) on_rez(integer p)
{ {
llResetScript(); llSetStatus(STATUS_PHYSICS,FALSE); //new Inworldz
llStopMoveToTarget( ); // new - inworldz - I Know Overkill!
llResetScript();
} }
timer() timer()
@@ -130,13 +139,13 @@ default
} }
else { else {
sLocatedName = ""; // fall into llSensor FLOWER_NAME sLocatedName = ""; // fall into llSensor FLOWER_NAME
llSetTimerEvent(1); // adjust pause here llSetTimerEvent(2); // adjust pause here
} }
iCount++; iCount++;
} else { // fixed here } else { // fixed here
// as you don't want to "fall" into here until after a 1 second pause // as you don't want to "fall" into here until after a 1 second pause
DEBUG("Look for Flower"); DEBUG("Look for Flower");
llSensor(FLOWER_NAME, NULL_KEY, ACTIVE|PASSIVE, DIST,PI); // flowers can be scripted, or not llSensor(FLOWER_NAME, NULL_KEY, ACTIVE|PASSIVE, DIST,PI); // flowers can be scripted, or not
} }
} }
@@ -157,7 +166,7 @@ default
lGlist += [ llDetectedPos(i), llDetectedRot(i) ]; lGlist += [ llDetectedPos(i), llDetectedRot(i) ];
} }
} else { } else {
iCount = 0; iCount = 0;
llPlaySound("buzz1",1.0); llPlaySound("buzz1",1.0);
// start moving towards the Hive // start moving towards the Hive
SetRotPos(Grot() * r90,Gpos() + vHiveOffset); // orient to it SetRotPos(Grot() * r90,Gpos() + vHiveOffset); // orient to it

View File

@@ -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>

View File

@@ -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>

View File

@@ -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();
}
}

View File

@@ -1,12 +0,0 @@
default
{
state_entry()
{
llSay(0, "Hello, Avatar!");
}
touch_start(integer total_number)
{
llSay(0, "Touched: "+(string)total_number);
}
}

View File

@@ -4,7 +4,7 @@
// :AUTHOR:Ferd Frederix // :AUTHOR:Ferd Frederix
// :KEYWORDS: // :KEYWORDS:
// :CREATED:2012-09-04 15:30:52.010 // :CREATED:2012-09-04 15:30:52.010
// :EDITED:2016-07-09 14:33:55 // :EDITED:2016-07-27 15:13:53
// :ID:902 // :ID:902
// :NUM:1278 // :NUM:1278
// :REV:1.1 // :REV:1.1

View File

@@ -1,5 +1,9 @@
<Project name="Multi-pose script" guid="233f6e31-95a1-438e-80d0-4448aa0cac7b"> <Project name="Multi-pose script" guid="233f6e31-95a1-438e-80d0-4448aa0cac7b">
<Object name="Object" guid="bc7ae54d-932e-4b75-9bb2-f63409d6fccd" active="true"> <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 name="Script.lsl" guid="e52a0629-9fda-4d09-b6ef-e8a41a54115b">
</Script> </Script>
</Object> </Object>

View File

@@ -4,7 +4,7 @@
// :AUTHOR:Ferd Frederix // :AUTHOR:Ferd Frederix
// :KEYWORDS: // :KEYWORDS:
// :CREATED:2013-12-14 13:33:32 // :CREATED:2013-12-14 13:33:32
// :EDITED:2016-07-09 14:34:03 // :EDITED:2016-07-27 15:14:06
// :ID:902 // :ID:902
// :NUM:1558 // :NUM:1558
// :REV:1.2 // :REV:1.2

View File

@@ -178,7 +178,7 @@ getCategories()
{ {
type = 1; type = 1;
busy = TRUE; 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, [], ""); http_request_id = llHTTPRequest(url, [], "");
} }
@@ -186,7 +186,7 @@ getCategory()
{ {
type = 2; type = 2;
busy = TRUE; 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); // llOwnerSay(url);
@@ -197,7 +197,7 @@ getURL()
{ {
type = 3; type = 3;
busy = TRUE; 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, [], ""); http_request_id = llHTTPRequest(url, [], "");
} }
@@ -332,6 +332,7 @@ listen(integer channel, string name, key id, string message)
if (request_id == http_request_id) if (request_id == http_request_id)
{ {
busy = FALSE; busy = FALSE;
if (type == 1) if (type == 1)
{ {
lCategories = llParseString2List(body,["|"],[]); lCategories = llParseString2List(body,["|"],[]);