This...
Code:
default
{
state_entry()
{
prims=llGetNumberOfPrims();
if(prims>=(numprims+1))
{
N=prims-numprims;
}
reset();
}
changed(integer change)
{
if(change & CHANGED_LINK)
{
prims=llGetNumberOfPrims();
if(prims>=(numprims+1))
{
N=prims-numprims;
}
reset();
}
}
touch_start(integer total_number)
{
llPlaySound("15768d1d-df0b-ade8-63a0-b5ac9e765b33",1.0);
llMessageLinked(LINK_SET,letchan1,up,NULL_KEY);
}
link_message(integer linknum, integer num, string str, key id)
{
if(num==letchan1)
{
if(str==up)
{
if(totalbase>=0)
{
letbase+=1;
totalbase-=1;
llMessageLinked(N+4,letgraph,(string)letbase,NULL_KEY);
}
}
else
{
if(letbase<=0)
{
llSay(0,"already at 0");
}
else
{
if(totalbase<=100)
{
letbase-=1;
totalbase+=1;
llMessageLinked(N+4,letgraph,(string)letbase,NULL_KEY);
}
}
}
}
if(num==potchan1)
{
if(str==up )
{
if(totalbase>=0)
{
potbase+=1;
totalbase-=1;
llMessageLinked(N+5,potgraph,(string)potbase,NULL_KEY);
}
}
else
{
if(potbase<=0)
{
llSay(0,"already at 0");
}
else
{
if(totalbase<=100)
{
potbase-=1;
totalbase+=1;
llMessageLinked(N+5,potgraph,(string)potbase,NULL_KEY);
}
}
}
}
if(num==soychan1)
{
if(str==up )
{
if(totalbase>=0)
{
soybase+=1;
totalbase-=1;
llMessageLinked(N+6,soygraph,(string)soybase,NULL_KEY);
}
}
else
{
if(soybase<=0)
{
llSay(0,"already at 0");
}
else
{
if(totalbase<=100)
{
soybase-=1;
totalbase+=1;
llMessageLinked(N+6,soygraph,(string)soybase,NULL_KEY);
}
}
}
}
if(num==whechan1)
{
if(str==up )
{
if(totalbase>=0)
{
whebase+=1;
totalbase-=1;
llMessageLinked(N+7,whegraph,(string)whebase,NULL_KEY);
}
}
else
{
if(whebase<=0)
{
llSay(0,"already at 0");
}
else
{
if(totalbase<=100)
{
whebase-=1;
totalbase+=1;
llMessageLinked(N+7,whegraph,(string)whebase,NULL_KEY);
}
}
}
}
if(num==daychan)
{
if(str==up )
{
if(totalday>=1)
{
days+=1;
totalday-=1;
llMessageLinked(N+8,daygraph,(string)days,NULL_KEY);
}
}
else
{
if(days<=1)
{
llSay(0,"lowest is day 1");
}
else
{
if(totalday<=100)
{
days-=1;
totalday+=1;
llMessageLinked(N+8,daygraph,(string)days,NULL_KEY);
}
}
}
}