Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Homing/Seeking script, a newbie project

Eirinn Overdrive
Woodland Guide
Join date: 27 Jul 2005
Posts: 19
07-28-2005 07:01
Ok, as the title says, this is a newbie project, im not sure im posting this the right place, but here goes :D I made this from scratch with the help of Starax Statosky :) thx for enduring me, lol.

Its not finished yet, and i welcome all the help youre willing to give :D
So here's mr script :p

CODE

integer index;
string name;

default

{
state_entry()
{
llListen( 0, "", llGetOwner(), "" );
}

listen( integer channel, string name, key id, string message )
{
index = llSubStringIndex(message, "target");
if (index>=0)

{
name=llGetSubString(message,index+7,-1);

llSensorRepeat(name, NULL_KEY, AGENT, 96, PI, 1);
}
}

}
Bosozoku Kato
insurrectionist midget
Join date: 16 Jun 2003
Posts: 452
07-28-2005 16:26
From: someone

listen( integer channel, string name, key id, string message )
index = llSubStringIndex(message, "target");
if (index>=0)

Have the conditional as == 0, as it is now (>=0) this: "I had a target yesterday, a cookie" would be TRUE. Using "== 0" requires that "target" is the first word.

From: someone
name=llGetSubString(message,index+7,-1);

Why make the script do math, this is a given. "target" is always first, as long as you're checking the index as above, so just use the known value:
name = llGetSubString(message, 7, -1);

Because I hate html (and this editor doesn't know how to use a tab) I'll end my spew here.

Bos
Eirinn Overdrive
Woodland Guide
Join date: 27 Jul 2005
Posts: 19
weeeee
07-29-2005 05:30
Hi, i was so fortunate to find some people ingame that helped me finish most of the script. I will be posting the rest when its done for sharing :D