Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

online indicator and tip jar in one

qudex Coronet
Registered User
Join date: 13 Mar 2007
Posts: 36
02-08-2008 15:07
i know this is probably a stupid question but does anyone know where i can find (or if you can make) a script which shows the online status of the owner and also the usual tipjar info (total donated etc)

i have tried adding a user online indicator and my usual tip jar script into an object but only the user online hover script shows, i need both to show or the user online to be indicated by red or green particle effects and the tip info visible

if you can help please let me know

thanks in advance

Q
Sho Iuga
Registered User
Join date: 6 Jun 2007
Posts: 35
02-15-2008 11:16
If I get it right you tried to put 2 scripts in your tip jar, that both try to update the floating text. Problem here is: the floating text is a property of the prim/object not the scripts. So only the last llSetText call will be displayed. So putting 2 scripts in your object does you no good as only the latest text update will show.
You have to merge them two scripts into one that sets the floating text. Here is my attempt at such a script:

[script]

float updateeverynsec = 30.0;
string owneronline;
key owner;
key query;
integer tippedsofar = 0;
string date;
string biggesttipper;
integer biggesttip = 0;


updatetext()
{
string text = llKey2Name(llGetOwner()) + " is "+ owneronline ;
text += ".\nTipped since " + date + "\n ";
text += (string)tippedsofar + " Linden";
text += "\nbiggest tipper: "+ biggesttipper + " donated "+ (string)biggesttip;

llSetText (text,<1.0,0.0,0.0>, 1.0);
}


default
{
state_entry()
{
date = llGetDate();
llSetTimerEvent(updateeverynsec);
owner = llGetOwner();
updatetext();
}
timer()
{
key query = llRequestAgentData(owner, DATA_ONLINE);
}
changed(integer change)
{
if( change & CHANGED_OWNER ) llResetScript();
}
dataserver(key requested, string data)
{
if ( "1" == data )
{
owneronline = "online";
}
else
{
owneronline = "offline";
}
updatetext();
}
money(key giver, integer amount)
{
tippedsofar += amount;
if( amount > biggesttip )
{
biggesttip = amount;
biggesttipper = llKey2Name(giver);
}
llSay(0, "Thank you "+ llKey2Name(giver) + " for your donation.";);
updatetext();
}
}

[end script]

and you may want to set the left-click to "pay object" for a tip jar (found on the lower edge of the edit window of your object).
qudex Coronet
Registered User
Join date: 13 Mar 2007
Posts: 36
02-15-2008 12:24
thanks alot i really appreciate it