Jump to content

Shymus Roffo

Resident
  • Posts

    118
  • Joined

  • Last visited

Everything posted by Shymus Roffo

  1. ok but what if the object is sappopsed to follow the owner?
  2. i am having trouble trying to get a HUD to rezz something, there is no errors in the script its just not rezzing what its told to in the world.
  3. it says there is a name previously declared in scope but i cannot find it string vendorname = "Roffo's Vendor"; vector White = <1,1,1>; vector Red = <1,0,0>; float Alpha = 2.0; integer price = 10; string Product = "Product"; string Mail = "foxfoot999@yahoo.com"; string Error = "Delivery Error"; string Success = "Product Delivered"; string Info = "InfoCard"; string version = "1"; string type = "Product"; string serverkey = "5a643a04-f35d-cffd-2ada-3b2ee600d69e"; integer channel = 1560; list buttons = ["Info","Gift","Exit"]; list owner = ["Offline","Reset"]; list online = ["Online"]; llInvetoryMax() { if(llGetInventoryNumber(INVENTORY_NOTECARD)>1) { llInstantMessage(llGetOwner(), (string)vendorname+" can only hold one NoteCard"); llInstantMessage(llGetOwner(), "Reseting Vendor to prevent Errors"); llResetScript(); } } default { state_entry() { llSetClickAction(CLICK_ACTION_TOUCH); llSetPayPrice(PAY_HIDE, [PAY_HIDE ,PAY_HIDE, PAY_HIDE, PAY_HIDE]); llSetText("Waiting for Debit Permmisions", Red, Alpha); llRequestPermissions(llGetOwner(), PERMISSION_DEBIT); llAllowInventoryDrop(FALSE); } run_time_permissions(integer perm) { if(perm & PERMISSION_DEBIT) state online; } } state online { state_entry() { llSetPayPrice(price, [price, PAY_HIDE, PAY_HIDE, PAY_HIDE]); llSetText("\n ============ \n Product Price is: "+(string)price+" \n ============ \n" ,White, Alpha); llSetClickAction(CLICK_ACTION_PAY); llSetObjectName(vendorname); llInvetoryMax(); llListen(channel,"", "",""); } money(key id, integer amount) { if(amount != price) { llGiveMoney(id, amount); llInstantMessage(id, "You Payed: "+(string)amount); llInstantMessage(id, "The Price is: "+(string)price); llInstantMessage(id, "Please Pay the Correct Price"); } else if(amount == price) { llInstantMessage(id, "Sending Object"); llInstantMessage(id, "Please Wait"); llSleep(1); llEmail((string)serverkey+"@lsl.secondlife.com", version, (string)id + "," +type + "," +(string)id); llEmail(Mail, Success, "Product "+(string)Product+" Was delivered to "+(string)llKey2Name(id)+", They Payed "+(string)amount); } } changed(integer change) { if(change & CHANGED_INVENTORY); { llInstantMessage(llGetOwner(), "Inventory Changed"); llInstantMessage(llGetOwner(), "Reseting "+(string)vendorname+ " to Avoid Errors"); llResetScript(); } if(change & CHANGED_OWNER); { string Script = "VendorScript"; llSetScriptState(Script, FALSE); } } touch_start(integer total_number) { key dk = llDetectedKey(0); if(dk == llGetOwner()) { llDialog(llDetectedKey(0), "Please Pick an option", owner, channel); } else { llDialog(llDetectedKey(0), "Please Pick an option", buttons, channel); } } listen(integer channel, string name, key id, string message) { key dk = llDetectedKey(0); if(message == "Offline") { llInstantMessage(llGetOwner(), "Setting Vendor Offline"); llSleep(5); state offline; } if(message == "Info") { if(llGetInventoryNumber(INVENTORY_NOTECARD)!=1) { llInstantMessage(id, "No InfoCard to Offer"); return; } else { llInstantMessage(id, "Sending InfoCard"); llGiveInventory(id, Info); } } if(message == "Gift") { llTextBox(id, "Please type the name of the receiver", channel); llInstantMessage(id, "Gift option Offline"); } } } state offline { state_entry() { llInstantMessage(llGetOwner(), "Vendor Offline"); llSetText("Vendor Offline", White, Alpha); llListen(channel, "", "",""); } touch_start(integer total_number) { key tc = llDetectedKey(0); if(tc == llGetOwner()) { llDialog(llDetectedKey(0), "Please Pick an Option", online, channel); } } listen(integer channel2, string name2, key id2, string message2) { if(message2 == "Online") { llInstantMessage(id2, "Settings Vendor Online"); llSleep(5); state online; } } }
  4. so i've been trying to make a vendor this is try number two and i just started i've never been good at making things communicate with notecard and i'm trying to make it so you can put the settings like "Price" and "Product" vector Color = <1,1,1>; float Alpha = 2.0; integer Line = 0; string Note = "Settings"; integer price = 10; default { state_entry() { llSetPayPrice(PAY_HIDE, [PAY_HIDE ,PAY_HIDE, PAY_HIDE, PAY_HIDE]); llRequestPermissions(llGetOwner(), PERMISSION_DEBIT); llSetText("Waiting for Permmision Debit", Color, Alpha); } run_time_permissions(integer perm) { if(perm & PERMISSION_DEBIT) state cash; } } state cash { state_entry() { llSetPayPrice(price, [price, PAY_HIDE, PAY_HIDE, PAY_HIDE]); llSetText("The Price is: " +(string)price ,Color, Alpha); llSetClickAction(CLICK_ACTION_PAY); } money(key id, integer amount) { if(amount != price) { llGiveMoney(id, amount); llInstantMessage(id, "This Item Costs " +(string)amount); llInstantMessage(id, "The Price is: " +(string)price); } else { llInstantMessage(id, "Vending Object"); llInstantMessage(id, "Please Wait"); llSleep(3); llGiveInventory(id, llGetNotecardLine(Note, Line)); } } }
  5. Where can i find an extrenal editor? cause i'm not a big fan of the one we have on second life
  6. What do you mean by extrenal editor?
  7. i'm having trouble finding the bug in this script :/ key ownerkey; string vendorname = "HiroVendor"; list currentitemlist; list currentpricelist; list recentsales; integer defaultprice=9999999; integer numberitems = 0; integer selected = 1; integer recordsales = 1; integer percentshare = 0; integer owed = 0; integer storelisten = 0; float r=1.0; float g=1.0; float b=1.0; updatetext() { if(r==-1) llSetText("",<0,0,0>,100); else llSetText(llList2String(currentitemlist,(selected - 1))+ "\n$"+llList2String(currentpricelist,(selected - 1))+"L" +"\nItem "+(string)selected+" of "+(string)numberitems,<r,g,b>, 1.5); } listsaleitems() { integer c = llGetListLength(currentitemlist); llSay(0,"There are currently "+(string)c+" items for sale invendor "+vendorname+"."); integer d; for(d = 0;d<c;++d) { llSay(0,"Item "+((string)(d+1))+":"+llList2String(currentitemlist,d)+ ", price: "+llList2String(currentpricelist,d)); } } Init() { ownerkey = llGetOwner(); llSay(0,llGetScriptName()+" has been placed in object:"+llGetObjectName()+"."); llSay(0, "The 'Instructions for Hiro's Super Vendor' notecardwill walk you through the process of getting your vendor ready forsales!"); llRequestPermissions(ownerkey,PERMISSION_DEBIT); llSetText("Hiro Pendragon's\nSuper Vendor Software\nType thefollowing to start:\nHiroVendor:updateitems",<1,1,1>,100); } default { state_entry() { Init(); state listenmode; } on_rez(integer param) { Init(); state listenmode; } } state listenmode { state_entry() { llListenRemove(storelisten); storelisten = llListen(0,"",ownerkey,""); } on_rez(integer param) { Init(); llListenRemove(storelisten); storelisten = llListen(0,"",ownerkey,""); } listen(integer channel, string name, key id, string msg) { list command = llParseString2List(msg,[":"],[]); if (llList2String(command,0)==vendorname); { string whichcommand=llList2String(command,1); if(whichcommand=="setname") { string newname=llList2String(command,2); if(newname!="") { llSay(0,"Vendor '"+vendorname+"' has been renamed:'"+newname+"'."); vendorname=newname; } else { llSay(0,"Sorry, you must enter a name for your vendor. Please try again."); } } else if(whichcommand=="updateitems") { integer numitems=0; numitems += llGetInventoryNumber(INVENTORY_OBJECT); llSay(0,(string)numitems+" items found in this vendor:"); numberitems = numitems; list itemlist; integer c; integer listlength=llGetListLength(currentitemlist); if (listlength > 20) { llSay(0,"Warning! Items for sale exceeds recommended maximum."); } currentpricelist = llDeleteSubList(currentpricelist,0,(listlength - 1)); for(c=0;c<numitems;++c) { itemlist += llGetInventoryName(INVENTORY_OBJECT,c); llSay(0,((string)(c+1))+":"+llList2String(itemlist,c)); currentpricelist=currentpricelist+(string)defaultprice; } currentitemlist=itemlist; selected = 1; updatetext(); llSay(0,"You now need to update all of the prices."); } else if(whichcommand=="listitems") { listsaleitems(); } else if(whichcommand=="setprice") { if(llList2String(command,2)=="all") { list newpricelist=llParseString2List(llList2String(command,3),[","],[]); integer newlength = llGetListLength(newpricelist); integer oldlength = llGetListLength(currentpricelist); if(newlength!=oldlength) { llSay(0,"Error! The list of prices you entered ("+((string)newlength) +") does not have the same number as already exists! (" +((string)oldlength)+")"); } else { integer c; integer valid = 1; for(c=0;c<newlength;++c) { integer newprice = (integer)llList2String(newpricelist,c); if(newprice<0) { valid=valid - 1; } } if(valid<1) { llSay(0,"Error! "+((string)(1 - valid))+"prices were less than 0."); } else { llSay(0,"Prices being updated."); currentpricelist = newpricelist; updatetext(); } } } else if(llList2String(command,2)!="") { integer whichitem = (integer)llList2String(command,2); if(whichitem>llGetListLength(currentpricelist)) { llSay(0,"Error! Item index is greater than the actual number of items!"); } else { whichitem--; integer newprice = (integer)llList2String(command,3); if(newprice<0) { llSay(0,"Error! Must enter a non-negative price!"); } else { integer pricelistlength = llGetListLength(currentpricelist); integer c; list newpricelist; for(c=0;c<pricelistlength;++c) { if(c==whichitem) { newpricelist = newpricelist + (string)newprice; } else { newpricelist = newpricelist + llList2String(currentpricelist,c); } } llSay(0,"Prices being updated."); currentpricelist = newpricelist; updatetext(); } } } } else if(whichcommand == "setcolor") { list colors = llParseString2List(llList2String(command,2),[","],[]); r = (float)(llList2String(colors,0)); g = (float)(llList2String(colors,1)); b = (float)(llList2String(colors,2)); updatetext(); } else if(whichcommand == "resetscript") { llResetScript(); else if(whichcommand == "listsales")//<--------Bugged----- { integer howmany = (integer)llList2String(command,2); integer c; integer leng = llGetListLength(recentsales); if (howmany == -1) { if(recordsales ==1) { llSay(0,"Disabling sales tracking for vendor: "+vendorname); recordsales = 0; recentsales = llDeleteSubList(recentsales,0,(llGetListLength( recentsales ) - 1)); } else { llSay(0,"Re-enabling sales tracking for vendor: "+vendorname); recordsales = 1; } } else if(recordsales == 1) { if ((howmany < 1)||(howmany > leng)) howmany = leng; llSay(0,"Listing "+(string)howmany+" items that have sold recently:"); for(c=1;c<=howmany;c++) { llSay(0,llList2String(recentsales,(leng - c))); } } } else if(whichcommand == "clearsales") { recentsales = llDeleteSubList(recentsales,0,(llGetListLength( recentsales ) - 1)); llSay(0,"Clearing sales list."); } else if(whichcommand == "getfreemem") { llSay(0,(string)llGetFreeMemory()); } else if(whichcommand == "share") { string whattodo = llList2String(command,2); if(whattodo == "set") { integer newpercent = (integer)llList2String(command,3); if((newpercent<0)||(newpercent>100)) llSay(0,"Error! Sharing percentage must be 0-100%"); else { percentshare = newpercent; llSay(0,"New percentage shared is "+(string)percentshare); } } else if(whattodo == "show") { if(owed>0) llSay(0,"You currently owe "+(string)owed+"L to whom you are sharing."); } else if(whattodo == "clear") { llSay(0,"Setting amount owed from "+(string)owed+"L to 0L."); owed = 0; } } } else if(llList2String(command,0)=="GetHiroVendorName") { llSay(0,"My name is: "+vendorname); } } link_message( integer sender_num, integer num, string str, key id) { llSay(0,"changing"); if(str=="forward") { selected++; if (selected > numberitems) selected = selected - numberitems; llSetTexture(llList2String(currentitemlist, (selected - 1) )+"PIC",ALL_SIDES); updatetext(); } if(str=="backward") { selected = selected - 1; if (selected < 1) selected = selected + numberitems; llSetTexture(llList2String(currentitemlist, (selected - 1) )+"PIC",ALL_SIDES); updatetext(); } } touch( integer n) { llSay(0,"changing"); selected++; if (selected > numberitems) selected = selected - numberitems; llSetTexture(llList2String(currentitemlist, (selected - 1) )+"PIC",ALL_SIDES); updatetext(); } money( key giver, integer amount ) { integer price = (integer)llList2String(currentpricelist, (selected - 1) ); string object = llList2String(currentitemlist, (selected - 1) ); if ( amount < price ) { llSay( 0, "This item costs L$" + (string) price ); llSay( 0, "You only paid "+(string)amount); llGiveMoney( giver, amount ); } else { llSay( 0, "Enjoy your " + object ); llGiveInventory( giver, object ); if(llGetListLength(recentsales)>=30) llDeleteSubList(recentsales,0,0); if(recordsales==1) recentsales = recentsales + (llGetDate()+":"+object+":"+(string)price); if (amount > price) { llGiveMoney(giver, amount - price); } if(percentshare > 0) { owed += ((price * percentshare)/100); } } } }
  8. A simple leash script add the scripts to one prim then copy and wear it and you have a leash integer lockon = FALSE; float rope_length = 5.0; // Obviously, the length of the simulated rope. (It will stretch slightly longer than this, though) float dampening = 0.04; // This dampens a fraction of the object's velocity every 0.1 seconds, if the rope is stretched. float bouncing = 0.4; // How much the object "bounces" back after stretching the rope to the limit of its length. float constant = 16.0; // The force constant of the rope. key target; vector ropecolor; list rope_effect = []; default { state_entry() { llListen(12345,"","","TEST123"); llSetTimerEvent(5.0); } timer() { if ( !lockon ) { llWhisper(12345,"TEST123"); } } listen(integer chan, string name, key id, string msg) { if (!lockon) { lockon = TRUE; llWhisper(12345,"TEST123"); llSetTimerEvent(0.0); target = id; llSensorRepeat("", target, SCRIPTED, 20.0, PI, 0.1); rope_effect = [ PSYS_PART_FLAGS, PSYS_PART_FOLLOW_SRC_MASK | PSYS_PART_FOLLOW_VELOCITY_MASK | PSYS_PART_TARGET_LINEAR_MASK | PSYS_PART_TARGET_POS_MASK, PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_DROP, PSYS_SRC_TARGET_KEY, target, PSYS_PART_START_COLOR, ropecolor, PSYS_PART_END_COLOR, ropecolor, PSYS_PART_START_ALPHA, 1.0, PSYS_PART_END_ALPHA, 1.0, PSYS_PART_START_SCALE, <0.05,1.0,1.0>, PSYS_PART_END_SCALE, <0.05,1.0,1.0>, PSYS_SRC_TEXTURE, "", PSYS_PART_MAX_AGE, 0.5, PSYS_SRC_BURST_RATE, 0.001, PSYS_SRC_BURST_PART_COUNT, 1 ]; llParticleSystem(rope_effect); } } sensor(integer num_detected) { vector i_pos = llGetPos(); vector u_pos = llDetectedPos(0); if (llVecMag(u_pos-i_pos)>rope_length) { llSetForce(constant*llGetMass()*llVecNorm(u_pos-i_pos)*(llVecMag(u_pos-i_pos) - rope_length),FALSE); llApplyImpulse( llGetMass() * llGetVel() * dampening * -1.0 , FALSE ); vector wrongway = llVecNorm(i_pos - u_pos); float wrongmag = ( llGetVel() - llDetectedVel(0) ) * wrongway; if ( wrongmag > 0.0 ) { llApplyImpulse( llGetMass() * ( ( -1.0 - bouncing ) * ( wrongway * wrongmag ) ) , FALSE ); } } else { llSetForce( ZERO_VECTOR, FALSE ); } } no_sensor() { llSetForce( ZERO_VECTOR, FALSE ); } }
  9. ok its working better but i need it to give a notecard?
  10. i am having trouble with "IF" and "ELSE" here is the script i made please tell me what is wrong. default { state_entry() { llResetScript(); } touch_start(integer total_number) { key UUID = "60f68ce2-0efe-4772-beef-823547416e6d"; if (UUID == llDetectedKey()) { llGiveInventory(UUID, llGetScriptName()); } else(llDetectedKey(0) == UUID) { return; } } }
  11. i've been working on making a titler and i've been trying to think of a way to make the text color change and this is what i have and its not working. string TEXT = "\n ╔════════╗ \n ║DJ Ninja║ \n ╚════════╝ \n"; float TEXT_ALPHA = 2.0; default { state_entry() { @script float r = llFrand(1)//<----Error here float g = llFrand(1) float b = llFrand(1) llSetText(TEXT, <r,g,b>, TEXT_ALPHA); jump script; } on_rez(integer start_param) { llResetScript(); } }
×
×
  • Create New...