Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

A log script (maybe Suggestion)

Bagel Gable
Registered User
Join date: 16 Feb 2006
Posts: 3
03-03-2006 00:00
Hey Everyone, i started this game past month, and now i am used to this game. Once i finshed all getting used to the game i wanted to gma einto development, sort of conquered clotheing and tattoos, no bulding yet, but have gotten the basincs and some advanced stuff in scripting.

--now tht the intro is over--

Now that i knew scripting,(well Basics) i decided to make scripts tht cant be found in Sl much. Now here is the thing, one of the scripts i am wokring on, i need it to log certian thigns. Like how many times was it touched or payed u know. And i want to log the event tht are done to the opject. Then i want a log sent to the new owner of the file.

Now i was wondering if there was a way to do this, with a SL command.

i dont want the script to im the owner, tht would create too much of a hassel.

So just wondering is there a command that logs actions and events that are done to it.
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
03-03-2006 11:35
Welcome to SL :D

Is this what youre looking for:
CODE

integer numTouched;
default {
touch_start(integer tn) {
if (llDetectedKey(0) == llGetOwner()) {
llOwnerSay("I've been touched " + (string)numTouched + " times.");
} else {
++numTouched;
}
}
}


This will report how many times the script has been touched by others to the owner when he/she touches it.

We don't yet have the ability to write to notecards (create text files) via LSL, sorry dude. We can send emails though.
==Chris
_____________________
October 3rd is the Day Against DRM (Digital Restrictions Management), learn more at http://www.defectivebydesign.org/what_is_drm
Adman Drake
Registered User
Join date: 9 Feb 2006
Posts: 96
03-03-2006 13:43
With regard to logging information... when, exactly, are global variables wiped out or reset? It seems pretty sketchy to store stuff in variables in the code... Not saying it can't work, but if the object is picked up, copied, rezed, whatever, when do those variables reset?

I'm surprised we can't write to notecards. That would be really handy.

Thanks!
Adman
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
03-03-2006 14:12
From: Adman Drake
I'm surprised we can't write to notecards. That would be really handy.


Yes, it would be, but also equally unlikely. This is a mutilated horse that's been beaten to death throughout the forums. If you're in the mood for it, search for "notecard saving". Basically, the asset server is pretty fiddly as it is and allowing scripts to write notecards would put a lot of load on it. That's what I got, anyways.

Personally, when I need to log things, I set up a gmail account (blahlogs@gmail.com) or some other free service, and then I have it use llEmail to send me the logs periodically. How often you send the log depends on usage-- if it's a vendor that's used many times every day, perhaps send the log only every few hours, or when it becomes full (4096 characters). llOwnerSay only works if you're in the same sim, and llInstantMessage is moderately annoying. Emails are the best solution.

EDIT: Thanks sky Honey
Sky Honey
Coder
Join date: 16 May 2005
Posts: 105
03-03-2006 20:37
The 1023 character limit is for the email event on incoming messages (actually the wiki says 1000). Outgoing llEmail messages can be longer:
From: someone
The length of the entire email is limited to 4096 characters, including the subject, message, and other headers (such as address), as well as CR + LF and the prepended lines to the body.
_____________________
Bagel Gable
Registered User
Join date: 16 Feb 2006
Posts: 3
thx
03-04-2006 02:02
i see, i might use the script u suggested, just one newb question. instead of get owner can the script have say my name Bagel Gable. so if i am letting someone vendor on my property but the have to use my script, can i have it like instead getowner Bagel Gable, or even better the Parcel Owner

Also i might use the Email as a back up though.

i can have it so if a AV touches the object then thats logged rigth then it send teh Email at a certain time. right?

just one question dose it reset the count, or i can have it reset the count.

sorry i am new, i am not a Java or C++ programer i am VB.net programmer and its sort of diffrent