Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llInstantMessage help

raven Blair
Registered User
Join date: 2 Feb 2004
Posts: 39
11-03-2009 21:19
ok lol I know I just posted the other day for help and I don't often post this often for help but now I am working on something that will IM me and some friends when someone ports onto our land and the way I have it set up works but its slow and if more then one person ports there at a time or within a short amount of time between each other it well takes to long to finish and reset so it only tells me the one person, and the more people I put in the script for it to IM the longer it takes thanks to the 2 second delay LL added a wile back. So what I want is for this script to get the names of the people to IM off the notecard, I tried to merge the door script I got help with the other day with this one and I failed so hard lol so what I need is for this script to get the list of names from the notecard and hope it helps it run faster :D

thanks in advanced.

default
{
collision_start(integer num_detected)
{
if (llDetectedType(0) & AGENT)
{
llInstantMessage("", llDetectedName(0) + " Is on your land.";);
llInstantMessage("", llDetectedName(0) + " Is on your land.";);
//llInstantMessage("", llDetectedName(0) + " Is on your land.";);
//llInstantMessage("", llDetectedName(0) + " Is on your land.";);
//llInstantMessage("", llDetectedName(0) + " Is on your land.";);
//llInstantMessage("", llDetectedName(0) + " Is on your land.";);
//llInstantMessage("", llDetectedName(0) + " Is on your land.";);
//llInstantMessage("", llDetectedName(0) + " Is on your land.";);
//llInstantMessage("", llDetectedName(0) + " Is on your land.";);
}
}
collision_end(integer num_detected)
{
if (llDetectedType(0) & AGENT)
{
llResetScript();
}

}
}

note: yeah see all the llInstantMessages in there, its a 2 second delay between each one :(
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
11-03-2009 21:39
llInstantMessage needs to know where to send the message. So,

llInstantMessage("", llDetectedName(0) + " Is on your land.";);

might become:

llInstantMessage(llGetOwner(), llDetectedName(0) + " Is on your land.";);

... or you could get the key some other way, as a variable or whatever. There is no default, so the "" dutifully sends the message to nowhere.


To deal with the delay, a common workaround is to add a second script that only sends instant messages. You would use llMessageLinked to tell the IM sender (or senders, if you have a lot of messages) to say.
raven Blair
Registered User
Join date: 2 Feb 2004
Posts: 39
11-03-2009 21:40
right but im not the only one it needs to send the message to
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
11-03-2009 21:42
From: raven Blair
right but im not the only one it needs to send the message to

That's no problem, you can use a list of keys and loop through. But see the thing about using a helper script, you probably do want to do that with a visitor detector.
raven Blair
Registered User
Join date: 2 Feb 2004
Posts: 39
11-03-2009 22:06
na a visitor detector isn't really what I want, I need it to IM me and other people as soon as someone ports to our land, I don't want it to keep a list, I don't want a sensor cause that's a bit more lag then a collide event I think.
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
11-03-2009 22:16
From: raven Blair
na a visitor detector isn't really what I want, I need it to IM me and other people as soon as someone ports to our land, I don't want it to keep a list, I don't want a sensor cause that's a bit more lag then a collide event I think.


So in other words, you want to make a visitor detector. It's the same thing, even if you use collisions and don't keep a history =) A small history might still be a good idea, so you don't get spammed to death when a one or a few people walk around a bit on the prim.
Knight Nootan
Registered User
Join date: 26 May 2008
Posts: 73
11-03-2009 22:30
Try sending the detected key to a second script via llMessageLinked like this:

llMessageLinked(LINK_SET, 0, llDetectedName(0), "";);

and in the second script have it

link_message(integer sender_num, integer num, string msg, key id) {

llInstantMessage("", msg + " Is on your land.";);
llInstantMessage("", msg + " Is on your land.";);
llInstantMessage("", msg + " Is on your land.";);
llInstantMessage("", msg + " Is on your land.";);
llInstantMessage("", msg + " Is on your land.";);

or you can have it so each instant message is its own script using the same method as above, this will speed up the message but increase your scripts.