Jump to content

Please help with my script


Raiden Faxel
 Share

You are about to reply to a thread that has been inactive for 3346 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hey Guys. I have a script connecting to a database outside SL. It goes to the database, gets the stats of the player and then returns the stats to the HUD. The stats are returns like this.

ALLGOOD:GET STATS:NONE:HYBRI:11:-3:100:UNKNOWN:BelindaHanson Resident:5:1:Hybrid Lust:9:9:0:1:0:NONE:10:5:10:0:0:1:0:0:0:0:0:0:None:4:1437694980:1

Now this script reads the the return like this...

            llOwnerSay(body);
            list results = llParseString2List( body,[":"], [""]);
            llOwnerSay(llList2String(results, 0));
            if(llList2String(results, 0) == "ALLGOOD")
            {
                llOwnerSay(llList2String(results, 1));
                //==================================================
                //======== Returned from hud getting stats =========
                //==================================================
                if(llList2String(results, 1) == "GET STATS")
                {
                    llOwnerSay("Getting");
                    llSetText("", <255, 255, 255>, 1);
                    lstPlayerDetails = llList2List(results, 3,-1);
                    //Check if out of date
                    string newHUDVersion = llList2String(results, 2);
                    //newHUDVersion = "OUT OF DATE";
                    llOwnerSay("Yes");

This of course is not the whole script but for some reason its not making it down to the llOwnerSay("Yes"); line. Sometimes it makes it to llOwnerSay("Getting") other times it only gets to llOwnerSay(llList2String(results, 0));

Other Info

  1. The script is running in Mono
  2. The script is using approx 62000bytes
  3. The script has 1052 lines of code.

If you can see the fault please reply D:

EDIT: Trying to save the script with Mono unticked fails with Out Of Memory. Saving in Mono saves fine

Link to comment
Share on other sites

It looks like you're running out of memory.  A Mono-compiled script can only use 64K of memory and your script is already pushing that before you start reading data and building internal lists.  It would probably be a good idea to split the script into two or more linked scripts with different functions.  Or go back and start chopping out inefficient or unnecessary code.  Or both.

  • Like 1
Link to comment
Share on other sites

You say that "for some reason its not making it down to the llOwnerSay("Yes"); line. Sometimes it makes it to llOwnerSay("Getting") other times it only gets to llOwnerSay(llList2String(results, 0));" but what happens (or doesn't happen) next?  Doex it hang or does it fetch the next result or what?

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3346 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...