CrazeeTastee Gupte
Registered User
Join date: 13 Nov 2005
Posts: 13
|
11-20-2005 00:07
Hello. I'm creating a series of scripts to relay data (mostly chat messages) from SecondLife to an e-mail address. I have a Perl script on my end check the e-mail and forward any messages to me on AOL Instant Messenger. I'm using this to chat with people in SecondLife when I'm at school (or somewhere else where I am unable to install the SecondLife client).. I have the whole Perl thing set up to relay things from the e-mail inbox to AIM, but.. here's the problem:
There's a 20-second script delay on llEmail. People say much more than one message every 20 seconds.. so this is going to be tricky to handle, I think. My first attempt was to create 20 objects on top of each other and then have one main object. The main object tells each of the smaller objects to send emails.. the first email is sent by object 0, the next by object 1, object 2, etc... so that I'm almost guarenteed to not have a delay because I'm using so many objects.
This is a huge pain, though. I have a script rezzing these 20 objects but I feel that this way of handling the situtation is not effective. I'm sure it's causing a fair amount of lag, and every time I need to add a new command (which is going to be fairly often.. gonna expand on this project so that I can rez an object with a script so that I can edit the scale, color, etc. of an object through AIM), I have to edit all the little objects, which just takes FOREVER.
Anybody else have any thoughts on the subject?
|
Jokey Domela
Registered User
Join date: 27 Jul 2005
Posts: 83
|
11-20-2005 04:51
You can put 20 scripts into 1 prim. Have one master script that keeps a pointer with a value that loops from 1 to 20. Use something like: llMessageLinked(integer LINK_ALL_OTHERS, integer THE_POINTER, string YOUR_EMAIL, NULL_KEY) Each subscript in it's linked message event will check if the link message is directed to it, just change the number in the if clause: link_message(integer sender_num, integer num, string str, key id) { if (num == 1) { send email; } }
|
Copper Surface
Wandering Carroteer
Join date: 6 Jul 2005
Posts: 157
|
11-20-2005 06:23
I have a scripted 'remote' that allows you to a) speak to and hear people, b) scan for avatars to make sure there's actually someone there to talk to, and c) travel across the grid to find someone to talk to.
It uses XML-RPC, which has a rather shorter delay then e-mail, and the interface is through a PHP-enabled webpage. The site is only configured for my private use at the moment but let me know if you're interested. I'm quite satisfied with it as I can't even use AIM or ICQ2GO from my office but since you can, I imagine it would be less of a hassle than going through a webpage.
|
CrazeeTastee Gupte
Registered User
Join date: 13 Nov 2005
Posts: 13
|
11-20-2005 16:27
From: Jokey Domela You can put 20 scripts into 1 prim.
Have one master script that keeps a pointer with a value that loops from 1 to 20.
[/code] Ugh! I took this suggestion, but something got totally screwed up. I was recieving emails 30 minutes later than I should have.. SL lag may? I don't know.. it wasn't the mail server.. tested it out without using SL and I instantly recieved email. Really weird..
|
Haravikk Mistral
Registered User
Join date: 8 Oct 2005
Posts: 2,482
|
11-21-2005 06:10
Sounds like you're only using one child script rather than talking to them individually. Here's an example: Parent Script: childCount = 0; childMax = 20;
default { state_entry() { llListen(0,"",NULL_KEY,""); } listen(integer channel, string name, key id, string msg) { ++childCount; if (childCount >= childMax) childCount = 0; // loop round llMessageLinked(LINK_THIS, childCount, msg, id); } } 'Child' Script (these are named as numbers from 0 to 20!!): default { link_message(integer linkNum, integer num, string msg, key id) { if (num == (integer)llGetScriptName()) { // Do stuff } } }
|