Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Not getting enough things in my list

Zeta Eizenstark
Registered User
Join date: 20 Aug 2008
Posts: 79
01-28-2010 12:45
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
Ultralite Soleil
Registered User
Join date: 31 Aug 2006
Posts: 108
01-28-2010 15:49
llSay is limited to 1024 characters and the rest is not printed.

http://wiki.secondlife.com/wiki/LlSay
Zeta Eizenstark
Registered User
Join date: 20 Aug 2008
Posts: 79
01-29-2010 07:39
Is there a better functions for objects to be able to communicate much larger msgs or should I just send the string in two halves?
Twisted Pharaoh
if ("hello") {"hey hey";}
Join date: 24 Mar 2007
Posts: 315
01-29-2010 08:58
Email is better.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-29-2010 09:33
I wouldn't say "much" better, but it is a quite a bit larger... 4k, minus space for headers, so around 3.5k.

but if you need the data inworld, then yes, you'll have to split it up into chunks of 1023 bytes or less...

CODE

bigstring = "stuff";
do{
llOwnerSay( llGetSubString( bigstring, 0, 1022 ) );
bigstring = llDeleteSubString( bigstring, 0, 1022 );
}while (bigstring);
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Twisted Pharaoh
if ("hello") {"hey hey";}
Join date: 24 Mar 2007
Posts: 315
01-29-2010 10:16
You can stash a little more bytes in the subject field.
Zeta Eizenstark
Registered User
Join date: 20 Aug 2008
Posts: 79
02-02-2010 10:20
Thank you all. The problem is solved (for the moment). This was an interesting learning experience.