CODE
integer gIntMinute = 60; //-- 1 minute in seconds
integer gIntHour = 3600; //-- 1 hour in seconds
integer gInt12Hr = 43200; //-- 12hrs in seconds
integer gIntDay = 86400; //-- 1 day in seconds
integer vIntMinutes; //-- Minutes
integer vIntMinutes1; //-- Minute checks
integer vIntHours; //-- Hours
string vStrReturn; //-- Final time
float zVelhh; //-- Velocity for the half-hour
float zVelh; //-- Velocity for the hour
integer steps; //-- Checks to see if steps was turned on
integer stepsc; //-- Steps counter
integer led; //-- Checks to see if led was turned on
string name; //-- Stores the name
integer w; //-- Set to 1 after intilized
integer x; //-- Used so that changes in half-hour and hour are only posted once
integer y = 0; //-- Increases by 1 every minute and checks against z to gather info
integer z = 179; //-- Used to limit y on how may seconds will be used to gather info
string vel = ""; //-- A string made to hold the velocity of that certain minute
string time = ""; //-- A string made to hold the time of that ceratin minute
string fStrGMTwOffset( integer vIntLocalOffset ){
//-- get the correct time in seconds for the given offset
integer vIntBaseTime = ((integer)llGetGMTclock() + gIntDay + vIntLocalOffset * gIntHour) % gIntDay;
vStrReturn;
//-- store morning or night and reduce to 12hour format if needed
if (vIntBaseTime < gInt12Hr)
{
vStrReturn = " AM";
}
else
{
vStrReturn = " PM";
vIntBaseTime = vIntBaseTime % gInt12Hr;
}
//-- get and format minutes
vIntMinutes = (vIntBaseTime % gIntHour) / gIntMinute;
vStrReturn = (string)vIntMinutes + vStrReturn;
//llSay(0, "Minutes: " + (string)vIntMinutes);
if (10 > vIntMinutes)
{
vStrReturn = "0" + vStrReturn;
}
//-- add in the correct hour, force 0 to 12
if (vIntBaseTime < gIntHour)
{
vStrReturn = "12:" + vStrReturn;
vIntHours = 12;
//llSay(0, "1Hours: " + (string)vIntHours);
}
else
{
vIntHours = (vIntBaseTime / gIntHour);
//llSay(0, "2Hours: " + (string)vIntHours);
vStrReturn = (string)(vIntBaseTime / gIntHour) + ":" + vStrReturn;
}
return vStrReturn;
}
default
{
state_entry()
{
llListen(-98,"","","");
llListen(-99,"","","");
llListen(-97,"","","");
llListen(-93,"","","");
}
touch_start( integer vIntTouched)
{
//llSay(0, "Vel list: " + vel);
//llSay(0, "Time list: " + time);
llSay( 0, "The time is now " + fStrGMTwOffset(-6) );
llSetText(llGetDate(), <1,1,1>, 1);
llSay(0, name + " owns this device currently.");
}
timer()
{
if(y != z)
{
fStrGMTwOffset(-6);
if( y == 0 )
{
time = (time + vStrReturn + ",");
}
zVelhh = llVecMag(llGetVel()) + zVelhh;
zVelh = llVecMag(llGetVel()) + zVelh;
if(llVecMag(llGetVel()) < 15.5)
{
vel = (vel + (string)llVecMag(llGetVel()) + ",");
}
else
{
vel = (vel + (string)0 + ",");
}
y++;
if(vIntMinutes > vIntMinutes1 && vIntMinutes != 0 )
{
//zVelhh = llVecMag(llGetVel()) + zVelhh;
//zVelh = llVecMag(llGetVel()) + zVelh;
llSay(0, "Minute has changed");
vIntMinutes1 = vIntMinutes;
x = 0;
}
}
else if(y == z)
{
time = (time + vStrReturn + ",");
if(llVecMag(llGetVel()) < 15.5)
{
vel = (vel + (string)llVecMag(llGetVel()) + ",");
}
else
{
vel = (vel + (string)0 + ",");
}
llSay(0, "END!!");
llSetTimerEvent(0);
}
}
listen(integer chnl, string s, key k, string msg)
{
if(w == 0 && chnl == -99)
{
//llSay(0, msg);
list var = llParseString2List(msg,[","],[]);
steps = llList2Integer(var, 0);
led = llList2Integer(var,1);
name = llList2String(var,2);
llSetTimerEvent(1);
llSay(0, "START!");
}
else if(chnl == -98)
{
llSay(0, "reset");
llResetScript();
}
else if(chnl == -93 && msg == "Graph")
{
llSay(-96, (time + "," + vel));
}
}
}
This is my script...it has been edited a lot and I'm not using all of the variables I have above. The problem is that I have a timer set up for 1sec, I think, and increases to take 180secs worth of data and puts it in one long string. Then I send it to device to graph the info but the show far less than that. I have gotten the list length to be 112, 114, 124, 128 by changing the timer time and y. Why isn't it giving me 182 things worth of data(2 times and 180 llGetMag(llGetVel())? Is it a string limit or a list limit or that it takes too long to execute the program for the timer? Thanks for any help