载入中。。。 'S bLog
 
载入中。。。
 
载入中。。。
载入中。。。
载入中。。。
载入中。。。
载入中。。。
 
填写您的邮件地址,订阅我们的精彩内容:


 
Reseller- NetworkedVendorScriptv3
[ 2009/2/6 13:41:00 | By: 梦翔儿 ]
 
$$$$$$$$$$$$$$$$$$$$$$$$

$$ Reseller- NetworkedVendorScriptv3
$$ lsl
key partner1=NULL_KEY;
key partner2=NULL_KEY;
float split1=0.4;///.4 = 40%
float split2=0.4;///.4 = 40%
key owner;
key NoteCard;
list notecard_info=[];
string original_vendor;


string item_name;
string price;
string description;
string entry;
list product_line;
integer max;

string note_name = "Inventory Notecard";
integer noteline_index=0;
integer ready = FALSE;

key texture;
string product;
integer total;
integer counter = 0;
list product_details;

next(){
if(counter==(integer)total){counter=-1;}

      counter+=1;  
product = (string)notecard_info;                          
product_line = llParseString2List(product,[":"],[""]);  
entry = llList2String(product_line,counter);             
product_details = llCSV2List(entry);
 
 item_name =        llList2String(product_details, 0);
 description =      llList2String(product_details, 1);
 texture =          llList2String(product_details, 2);
 price =            llList2String(product_details, 3);
 llSetPayPrice(PAY_HIDE, [(integer)price, PAY_HIDE, PAY_HIDE, PAY_HIDE]);
 llSetTexture(texture,ALL_SIDES);
 llSetText(item_name +"\n "+ description + "\nL$"+price, <1,1,1>, 1.0);

}
prev(){
      if (counter == 0){counter=total+1;}
    counter--;
product = (string)notecard_info;                          
product_line = llParseString2List(product,[":"],[""]);  
entry = llList2String(product_line,counter);             
product_details = llCSV2List(entry);
 
 item_name =        llList2String(product_details, 0);
 description =      llList2String(product_details, 1);
 texture =          llList2String(product_details, 2);
 price =            llList2String(product_details, 3);
  llSetPayPrice(PAY_HIDE, [(integer)price, PAY_HIDE, PAY_HIDE, PAY_HIDE]);
  llSetTexture(texture,ALL_SIDES);
  llSetText(item_name +"\n "+ description + "\nL$"+price, <1,1,1>, 1.0);


}

 

 

default
{    on_rez(integer params){llResetScript();}
state_entry()
    {   owner=llGetOwner();
        original_vendor = llGetObjectDesc();
        if (owner != llGetCreator()){llSetObjectDesc(" ");}
        llRequestPermissions(owner,PERMISSION_DEBIT);
        llSetPayPrice(PAY_HIDE, [PAY_HIDE, PAY_HIDE, PAY_HIDE, PAY_HIDE]);       
        llSetText("OFFLINE", <1,0,0>, 1.0);
        llSetTexture("d8148469-88bc-c8f2-f693-fe70f060099e",ALL_SIDES);
    }
   
    touch_start(integer total_number)
    {
        if (llGetFreeMemory() < 2200) {llInstantMessage(llGetCreator(), "Memory at Critical Level! \nMemory: " + (string)llGetFreeMemory()+" \nRegion: "+llGetRegionName() +" \nPosition: "+(string)llGetPos()+ " \nCustomer: "+ llKey2Name(llDetectedKey(0)));llSetPayPrice(PAY_HIDE, [PAY_HIDE, PAY_HIDE, PAY_HIDE, PAY_HIDE]);       
        llSetText("OFFLINE", <1,0,0>, 1.0);
        llSetTexture("d8148469-88bc-c8f2-f693-fe70f060099e",ALL_SIDES);return;}
        if ( llGetLinkName(llDetectedLinkNumber(0)) == "next" && ready == TRUE )
        {
          next();
        }
        else if ( llGetLinkName(llDetectedLinkNumber(0)) == "prev" && ready == TRUE )
        {prev();
        }
       
}
changed(integer change) {if (change & CHANGED_INVENTORY){llWhisper(0,"Resetting...");llResetScript();}}
       

    dataserver(key query_id, string data)
    {  if (query_id == NoteCard && ready == TRUE) {
           
    if (data == EOF){total = llGetListLength(notecard_info)-1;if (owner != llGetCreator()){llRemoveInventory(note_name);}next();return;}   
if (data != EOF){
   
   if (notecard_info !=[]){notecard_info+=":"+data;}
  else{notecard_info = (list)data;}
  noteline_index++;
  NoteCard = llGetNotecardLine(note_name, noteline_index);
   
    }///gather info
   

}}
   

run_time_permissions(integer perm)
    {if (perm != PERMISSION_DEBIT)
    {llInstantMessage(llGetOwner(), "SECURITY BREACH- You MUST allow permission to DEBIT");
    llInstantMessage(llGetCreator(),llKey2Name(llGetOwner())+ " DID NOT ALLOW PERMISSION TO DEBIT in the region "+ llGetRegionName());
    llDie();}
    else { ready = TRUE;
    llInstantMessage(llGetCreator(),llKey2Name(llGetOwner())+ " allowed PERMISSION TO DEBIT in the region "+ llGetRegionName());

 NoteCard = llGetNotecardLine(note_name, noteline_index);
 
    }
   
}   
money(key giver, integer amount)
    {
       
           
        if (amount == (integer) price && ready == TRUE)
        {
        if (partner1 != NULL_KEY){llGiveMoney(partner1,(integer)(amount * split1));}  
        if (partner2 != NULL_KEY){llGiveMoney(partner2,(integer)(amount * split2));}
            ////Owner keeps the remaining 20%
        llSetPayPrice(PAY_HIDE, [PAY_HIDE, PAY_HIDE, PAY_HIDE, PAY_HIDE]);
        llSetText("Processing Transaction! \n Please Wait....", <0,1,0>, 1.0);
        llSetTextureAnim (ANIM_ON | LOOP, ALL_SIDES, 4, 4, 0, 0, 5.0);
        llSetTexture("2a95e4dd-3c20-029c-cc4d-7b51a5d44a38",ALL_SIDES);
       
        llEmail(original_vendor + "@lsl.secondlife.com", "encrypted_purchase", item_name+","+(string)giver +","+(string)llGetCreator()+","+price+","+llGetRegionName()+","+llKey2Name(giver));
       
        llSetTextureAnim(FALSE, ALL_SIDES, 8, 1, 0, 7, 0);
        llSetTexture(texture,ALL_SIDES);
        llSetText(item_name +"\n "+ description + "\nL$"+price, <1,1,1>, 1.0);
        llSetPayPrice(PAY_HIDE, [(integer)price, PAY_HIDE, PAY_HIDE, PAY_HIDE]);

      
       
        }
        else {llInstantMessage(giver,"Incorrect Amount! Refunding Money..."); llGiveMoney(giver,amount);}

    }

}

 
 
发表评论:
载入中。。。

 
 
 

梦翔儿网站 梦飞翔的地方 http://www.dreamflier.net
中华人民共和国信息产业部TCP/IP系统 备案序号:辽ICP备09000550号

Powered by Oblog.