Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Need Help with Updater

shenanigan Oh
Registered User
Join date: 28 Apr 2007
Posts: 13
11-20-2008 13:55
Got it to work!!!

Thanks for looking thought!


Server
string password = "";
string version = "2.0";
string Inventory = "NEW";
string item = "Mp5";
string Same = "SAME";
string NEW = "NEW";
default
{
state_entry()
{
llSetTimerEvent(3);
llSay(0,(string)llGetKey());
}
email(string time, string address, string subj,string message,integer num_left)
{
string message = llDeleteSubString(message,0,llSubStringIndex(message, "\n\n";) + 1);
list messagelist = llCSV2List(message);
if(llList2String(messagelist,0) == password && llList2String(messagelist,2) != version)
{
key id;
llSay(0,"Password OK, Updating for "+address);
llEmail(address,"update!",password);
llGiveInventory(id, Inventory);
llSay(0,"UPDATED!!!";);
llEmail(address,"",NEW);
}
else
{
llEmail(address,"",Same);
}





}

timer()
{
llGetNextEmail("","update?";);
}
}

////////////////////////////////////////////////////////////////////////////////

update.client

key server = "a899ebc5-62e4-7b78-faf2-945cce966e3c";
string password = "666";
string version = "2.0";
string Same = "SAME";
string NEW = "NEW";
goupdate()
{
llOwnerSay("looking for update stand by";);
llEmail((string)server+"@lsl.secondlife.com","update?",password +","+(string)llGetOwner()+","+version);
llSetTimerEvent(5);
llGetNextEmail("","";);
}

default
{
attach(key id)
{
if(id != NULL_KEY)
{
goupdate();
}
}
link_message(integer sender_num,integer num,string str,key id)
{
if(str == "lookforupdate";)
{
goupdate();
}
}
email(string time,string address,string subj,string message,integer num_left)
{
list messagelist;
message = llDeleteSubString(message, 0, llSubStringIndex(message,"\n\n";) + 1);
messagelist = llCSV2List(message);
if(llList2String(messagelist,0) == password)
{
llOwnerSay("Update found, deattaching...";);
//llRequestPermissions(llGetOwner(),PERMISSION_TRIGGER_ANIMATION | PERMISSION_TAKE_CONTROLS | PERMISSION_ATTACH);
//llTakeControls(CONTROL_ML_LBUTTON | CONTROL_FWD | CONTROL_BACK | CONTROL_LEFT | CONTROL_RIGHT,TRUE,TRUE);
//llDetachFromAvatar();

}

if(llList2String(messagelist,0) == Same)
{
llSetTimerEvent(0);
llOwnerSay("Your Version is up to date v. "+version);
}
messagelist = llCSV2List(message);
if(llList2String(messagelist,0) == NEW)
{
llSetTimerEvent(0);
llOwnerSay("You Got a new version";);
}
if(num_left > 0)
{
llGetNextEmail("","";);

}
}
timer()
{
llGetNextEmail("","";);
}
}
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-20-2008 15:21
From: shenanigan Oh
Hello

I been working on a updater that sends a Email to a server sending version/serverId/password, I got it down that where the Avatars Key is right but I'm having trouble trying to send a new update through Email to the right Avatar and not the Severs Owner. Can someone help me out

We would be glad to help you out but would actually need to see the code to spot the problem.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Klug Kuhn
Registered User
Join date: 7 Sep 2007
Posts: 126
11-20-2008 15:22
Not sure if you could send update (e.g. a boxed object) via email to your customers. I'd always use llGiveInventory() since as you mentioned you got the customers key already.

Could try using either PHP to link to out-world database or manually copy and paste the customer names after each purchase. When update required in the latter case, simply to use a name2key auto updater to send all update.

Also i don't quite understand of the server owner. Does the server to be sent to your customers too?
shenanigan Oh
Registered User
Join date: 28 Apr 2007
Posts: 13
11-20-2008 15:26
When I mean by the owner I mean the owner of the updater, not customer, also I try using the llGiveInventory but it like it reads it and all but it just won't give out the item I want it to




Scripted ADDED :)
Klug Kuhn
Registered User
Join date: 7 Sep 2007
Posts: 126
11-20-2008 15:40
mm.. there shouldn't be only 1 script. The logic to go would be something like this:

1) Having a rezzed server inworld somewhere. It runs llGetNextEmail() in say every 30 sec.

2) Each and every of the item will have a current version script. This script will trigger to send an llEmail() to the server key, probably in a on_rez() or timer() in every week or so - attached with the current owner key (your customer key).

3) When the server receives email, it checks for the version (possible with password etc.). Then if it's a lower version, send update using llGivenInventory() to the customer key.

So there should be a script in the server, and a same script in each of the item.

Note: the inworld server has to be the same, i.e. not to re-rez etc. as its key will be altered thereafter.

Hope that helps :)
shenanigan Oh
Registered User
Join date: 28 Apr 2007
Posts: 13
11-20-2008 15:44
From: Klug Kuhn
mm.. there shouldn't be only 1 script. The logic to go would be something like this:

1) Having a rezzed server inworld somewhere. It runs llGetNextEmail() in say every 30 sec.

2) Each and every of the item will have a current version script. This script will trigger to send an llEmail() to the server key, probably in a on_rez() or timer() in every week or so - attached with the current owner key (your customer key).

3) When the server receives email, it checks for the version (possible with password etc.). Then if it's a lower version, send update using llGivenInventory() to the customer key.

So there should be a script in the server, and a same script in each of the item.

Note: the inworld server has to be the same, i.e. not to re-rez etc. as its key will be altered thereafter.

Hope that helps :)


Yea I got the second script up :)
Klug Kuhn
Registered User
Join date: 7 Sep 2007
Posts: 126
11-20-2008 15:53
Right, from a quick scan:

1) The server script should only receive email, i.e. running llGetNextEmail() in 30 sec and trigger email() event thereafter, and

2) The client (item) script should only send email, i.e. using only llEmail() on rez etc..

There is no need to send/receive on both. If you would like to have some notifier, you could use llInstantMessage() or llOwnerSay() etc.. :)
shenanigan Oh
Registered User
Join date: 28 Apr 2007
Posts: 13
11-20-2008 15:58
From: Klug Kuhn
Right, from a quick scan:

1) The server script should only receive email, i.e. running llGetNextEmail() in 30 sec and trigger email() event thereafter, and

2) The client (item) script should only send email, i.e. using only llEmail() on rez etc..

There is no need to send/receive on both. If you would like to have some notifier, you could use llInstantMessage() or llOwnerSay() etc.. :)


Your right about the Sending/Receiving. I got it to work!!! woot!!

Thanks for help!