I am trying to make a picture changer that:
1: works with both direction prims (Next) and (Prev) and chat commands /1Next, /1Prev
2: will utlimately only respond to people in the group the object is set to
I haven't gotten to the 2nd part yet, but I am stumped on the whole listen thing, primarily because I just am dense when it comes to understanding where things should be placed (among other faults of my programming skills).
I am using an existing script and trying to modify it. The error I have been getting so far is:
(76,15) : ERROR: Name not defined within scope
I would appreciate any direction anyone can give.
Thank you.
Dmitriy
CODE
// TWO-BUTTON TEXTURE VENDOR
// Origional script by Thili Playfair
// Heavily Modified by Karandas Banjo
// Tiny alter by Maxwell Harmison (just so I can put my name in it...lol)
// Please include these names if you modify or
// re-distribute this code ^_^
string objname;
integer total;
integer counter;
integer change;
next()
{
total=llGetInventoryNumber(INVENTORY_TEXTURE);
objname = llGetObjectName();
counter++;
if(counter>=total)
{
counter=0;
}
llSetTexture(llGetInventoryName(INVENTORY_TEXTURE, counter),4);
}
prev()
{
total=llGetInventoryNumber(INVENTORY_TEXTURE);
objname = llGetObjectName();
if (counter > 0)
{
counter--;
}
else
{
counter=total - 1;
}
llSetTexture(llGetInventoryName(INVENTORY_TEXTURE, counter),4);
}
default
{
state_entry()
{
next();
llSetTimerEvent(0);
llListen(1, "", llGetOwner(), "");
}
listen(integer channel, string name, key id, string msg)
{
}
touch_start(integer total_number)
{
if (msg == "/1next")
{
next();
}
else if ( llGetLinkName(llDetectedLinkNumber(0)) == "next" )
{
next();
}
else if ( llGetLinkName(llDetectedLinkNumber(0)) == "prev" )
{
prev();
}
}
timer()
{
next();
}
on_rez(integer start_param)
{
llResetScript();
}
}CODE