Push All Scripts
This commit is contained in:
6
NPC_Automator/NPC_Automator/NPC_Automator.prj
Normal file
6
NPC_Automator/NPC_Automator/NPC_Automator.prj
Normal file
@@ -0,0 +1,6 @@
|
||||
<Project name="NPC_Automator" guid="D8F0E83C-6C00-1014-B904-200204C60A89">
|
||||
<Object name="Object" guid="D8F0E92D-6C00-1014-B904-200204C60A89">
|
||||
<Script name="NPC_Automator_1.lsl" guid="D8F12CA2-6C00-1014-B904-200204C60A89">
|
||||
</Script>
|
||||
</Object>
|
||||
</Project>
|
||||
202
NPC_Automator/NPC_Automator/Object/NPC_Automator_1.lsl
Normal file
202
NPC_Automator/NPC_Automator/Object/NPC_Automator_1.lsl
Normal file
@@ -0,0 +1,202 @@
|
||||
// :CATEGORY:OpenSim NPC
|
||||
// :NAME:NPC_Automator
|
||||
// :AUTHOR:justi
|
||||
// :CREATED:2013-07-30 13:38:36.710
|
||||
// :EDITED:2013-09-18 15:38:58
|
||||
// :ID:569
|
||||
// :NUM:782
|
||||
// :REV:1.0
|
||||
// :WORLD:OpenSim
|
||||
// :DESCRIPTION:
|
||||
// From http://opensimulator.org/wiki/OSSLNPC
|
||||
//
|
||||
//This is a rough example script for most of the current NPC functionality. One of its major current deficiencies is that it doesn't track more than one created avatar at a time. Please feel free to improve it.
|
||||
// :CODE:
|
||||
|
||||
|
||||
key npc;
|
||||
|
||||
integer listenChannel = 10;
|
||||
|
||||
|
||||
|
||||
default
|
||||
|
||||
{
|
||||
|
||||
// NPC manipulator adapted by justincc 0.0.3 released 20121025
|
||||
|
||||
state_entry()
|
||||
|
||||
{
|
||||
|
||||
llListen(listenChannel,"",NULL_KEY,"");
|
||||
|
||||
llSetText("Listening on " + listenChannel, <0, 255, 0>, 1);
|
||||
|
||||
llOwnerSay("Say /" + (string)listenChannel + " help for commands");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
listen(integer channel, string name, key id, string msg)
|
||||
|
||||
{
|
||||
|
||||
if (msg != "")
|
||||
|
||||
{
|
||||
|
||||
list commands = llParseString2List(msg, [ " " ], []);
|
||||
|
||||
string msg0 = llList2String(commands, 0);
|
||||
|
||||
string msg1 = llList2String(commands, 1);
|
||||
|
||||
string msg2 = llList2String(commands, 2);
|
||||
|
||||
string msg3 = llList2String(commands, 3);
|
||||
|
||||
|
||||
|
||||
if (msg0 == "create")
|
||||
|
||||
{
|
||||
|
||||
if (msg1 != "")
|
||||
|
||||
{
|
||||
|
||||
string notecardName = msg1;
|
||||
|
||||
|
||||
|
||||
npc = osNpcCreate("Jane", "Doe", llGetPos() + <5, 5, 0>, notecardName);
|
||||
|
||||
|
||||
|
||||
llOwnerSay("Created npc from notecard " + notecardName);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
llOwnerSay("Usage: create <notecard-name>");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else if (msg0 =="createm" && msg1 != "")
|
||||
|
||||
{
|
||||
|
||||
osOwnerSaveAppearance("appearance");
|
||||
|
||||
vector pos = llGetPos();
|
||||
|
||||
integer i;
|
||||
|
||||
for (i = 0; i < (integer)msg1; i++)
|
||||
|
||||
{
|
||||
|
||||
osNpcCreate("John", "Doe", pos + <8, 0, 0>, "appearance");
|
||||
|
||||
llSleep(1);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else if (msg0 == "remove" && npc != NULL_KEY)
|
||||
|
||||
{
|
||||
|
||||
osNpcSay(npc, "You will pay for this with your liiiiiivvveeessss!!!.....");
|
||||
|
||||
osNpcRemove(npc);
|
||||
|
||||
}
|
||||
|
||||
else if (msg0 == "say" && npc != NULL_KEY)
|
||||
|
||||
{
|
||||
|
||||
osNpcSay(npc, "I am your worst Nightmare!!!!");
|
||||
|
||||
}
|
||||
|
||||
else if (msg0 == "move")
|
||||
|
||||
{
|
||||
|
||||
if (msg1 != "" && msg2 != "" && npc != NULL_KEY)
|
||||
|
||||
{
|
||||
|
||||
vector delta = <(integer)msg1, (integer)msg2, 0>;
|
||||
|
||||
|
||||
|
||||
if (msg3 != "")
|
||||
|
||||
{
|
||||
|
||||
delta.z = (integer)msg3;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
osNpcMoveTo(npc, osNpcGetPos(npc) + delta);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
llOwnerSay("Usage: move <x> <y> [<z>]");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else if (msg0 == "moveto")
|
||||
|
||||
{
|
||||
|
||||
if (msg1 != "" && msg2 != "" && npc != NULL_KEY)
|
||||
|
||||
{
|
||||
|
||||
vector pos = <(integer)msg1, (integer)msg2, 0>;
|
||||
|
||||
|
||||
|
||||
if (msg3 != "")
|
||||
|
||||
{
|
||||
|
||||
pos.z = (integer)msg3;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
osNpcMoveTo(npc, pos);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
llOwnerSay("Usage: move <x> <y> [<z>]");
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
vti_encoding:SR|utf8-nl
|
||||
vti_timelastmodified:TR|08 Sep 2013 03:49:04 -0000
|
||||
vti_extenderversion:SR|12.0.0.6211
|
||||
vti_backlinkinfo:VX|
|
||||
vti_author:SR|alien\\fred
|
||||
vti_modifiedby:SR|alien\\fred
|
||||
vti_timecreated:TR|18 Sep 2013 20:38:58 -0000
|
||||
6
NPC_Automator/NPC_Automator/_vti_cnf/NPC_Automator.prj
Normal file
6
NPC_Automator/NPC_Automator/_vti_cnf/NPC_Automator.prj
Normal file
@@ -0,0 +1,6 @@
|
||||
vti_encoding:SR|utf8-nl
|
||||
vti_timelastmodified:TR|17 Aug 2013 23:32:41 -0000
|
||||
vti_extenderversion:SR|12.0.0.0
|
||||
vti_cacheddtm:TX|17 Aug 2013 23:32:41 -0000
|
||||
vti_filesize:IR|265
|
||||
vti_backlinkinfo:VX|
|
||||
Reference in New Issue
Block a user