Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Pager help needed

Doggie Jigsaw
New Mexico, Arizona 1860s
Join date: 19 Nov 2008
Posts: 52
07-24-2009 17:01
Hoping someone can help us out, I have this script which works well with a couple of mods I did and does what I want, but lacks one small detail that's really needed.

Placed in an object and turned on, when clicked on by someone it sends me an IM
It shows when I'm on or off line and changes color to red, otherwise it's white as I have a photo on the object and dont want a green colored photo.

The object when clicked by me can be shut off or on, but when it's in the OFF mode and someone clicks on it, it does not display a whisper or anything to that person that it is OFF, they get nothing. When ON they get a whispered confirmation an IM was sent.

I need to duplicate the object to use as a pager board for some volunteers to use in a sim, but want them to be able to turn their pager on/off when "off duty" or "on duty" which is what they can do with this script, but when set "OFF" it doesnt indicate to people needing help that it's OFF and the volunteer is on-line but OFF DUTY.

Can someone paste the lines needed and indicate where they go in this script, which would whisper when its in the OFF mode, something like;

Whisper: sorry that volunteer is off duty, try another

The script cant be pasted here or attahced with out a 404 error from the forum server geez
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
07-24-2009 17:08
You need to put a space after the leading "<" of any "< vectors or rotations >" in your code.

It's some dumb-ass exploit protection code.
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Doggie Jigsaw
New Mexico, Arizona 1860s
Join date: 19 Nov 2008
Posts: 52
07-24-2009 17:25
Thanks Argent, its affecting other posts I tried to make, I get errors about the php files not being found on the server, 404 for /newpost.php and /editpost.php etc

NOW it works... even trying to attach it as a .txt file i got earlier this error;

---------------
There seems to have been a slight problem with the SL Forums database.
Please try again by pressing the refresh button in your browser.

An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

We apologise for any inconvenience.
---------

Here's the script with the space changes you suggested;


// From the book:
//
// Scripting Recipes for Second Life
// by Jeff Heaton (Encog Dod in SL)
// ISBN: 160439000X
// Copyright 2007 by Heaton Research, Inc.
//
// This script may be freely copied and modified so long as this header
// remains unmodified.
//
// For more information about this book visit the following web site:
//
// http://www.heatonresearch.com/articles/series/22/

string name = "";
string last_online = "";
key nameKey = NULL_KEY;
integer isAvailable = TRUE;
integer isOnline = FALSE;

list MONTHS = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];

string get_date()
{
integer t = llRound(llGetWallclock());

integer hours = t / 3600;
integer minutes = (t % 3600) / 60;
integer seconds = t % 60;

string time = (string)hours + ":";
if(minutes < 10) time += "0" + (string)minutes + ":";
else time += (string)minutes + ":";
if(seconds < 10) time += "0" + (string)seconds;
else time += (string)seconds;

string DateToday = "";
string DateUTC = llGetDate();
list DateList = llParseString2List(DateUTC, ["-", "-"], []);
integer year = llList2Integer(DateList, 0);
integer month = llList2Integer(DateList, 1);
integer day = llList2Integer(DateList, 2);
month = month - 1;
if(day < 10) DateToday = "0";
DateToday += (string)day + "-";

DateToday += llList2String(MONTHS,month);
DateToday += " ";
DateToday += (string)year;

time = time + " " + DateToday;
return time;
}


default
{
on_rez(integer p)
{
llResetScript();
}

state_entry()
{
llSetText("Online Detector\nTouch to Claim",< 1,1,1 >,1);
}

touch_start(integer total_number)
{
if(name == "";)
{
nameKey = llDetectedKey(0);
name = llDetectedName(0);
llSetText(name + "\nSetting up...",< 1,1,1 >,1);
llSetTimerEvent(4.0);
return;
}

if(llDetectedName(0) == name)
{
if(isAvailable == FALSE)
{
isAvailable = TRUE;
llWhisper(0, "IM's WILL BE sent to you.";);
return;
}
else
{
isAvailable = FALSE;
llWhisper(0, "IM's will NOT be sent to you.";);
return;
}

}
else
{
if(isAvailable && isOnline)
{
llInstantMessage(nameKey, llDetectedName(0) + " is paging you from " + llGetRegionName());
llWhisper(0,"A message has been sent to " + name);
}
}
}


timer()
{
if(nameKey)
{
llRequestAgentData(nameKey,DATA_ONLINE);
}
}

dataserver(key query, string data)
{
string text = "";

if((integer)data == 1)
{
isOnline = TRUE;
llSetColor(< 255,255,255 >,ALL_SIDES);
text = name + "";
if(isAvailable) text += "\n";
llSetText(text, < 0.25,1.0,0.25 >,1);
last_online = "";
}
else
{
isOnline = FALSE;
llSetColor(< 1,0,0 >,ALL_SIDES);
text = name + " is OFFLINE";

if(last_online == "";) last_online = get_date();
text += "\nLast Online: " + last_online;
llSetText(text, < 1.0,0.25,0.25 >,1);
}
}
}
Ron Khondji
Entirely unlike.
Join date: 6 Jan 2007
Posts: 224
07-24-2009 23:01
I think this little addition will do it.

From: Doggie Jigsaw

< snip >

else
{
if(isAvailable && isOnline)
{
llInstantMessage(nameKey, llDetectedName(0) + " is paging you from " + llGetRegionName());
llWhisper(0,"A message has been sent to " + name);
} else if (!isAvailable) llWhisper (0, "sorry that volunteer is off duty, try another";);

}
}


< snip >
Doggie Jigsaw
New Mexico, Arizona 1860s
Join date: 19 Nov 2008
Posts: 52
07-25-2009 00:31
Thank you Ron, I will try and tinker with that and post the results soon as I can.

EDIT, Thanks Ron, that did the trick after I removed one of the curly braces out of the 3 that were in the script. Tested fine, kudos!