Jump to content

Darkie Minotaur

Resident
  • Posts

    1,663
  • Joined

  • Last visited

Everything posted by Darkie Minotaur

  1. Great - I would change the listener to: llListen(9, "",llGetOwner(), "" ); so it only listens to the owner - especially if you have several people wearing the same stuff. Is there a problem or a specific question you have?
  2. This is a forum where users discuss - your message will most likely not get read by LL employees here.
  3. I just love his posts - and I die laughing when he goes on about The Help People. So: Long live Waisted.
  4. You can take a look at the ZHAO script - they do what you want to do - they use flying for swimming when under water. If i remember correctly, you don't need physics - just as with flying in the air.
  5. IM me inworld if you need more interviewees
  6. *grins* I haven't gone through the complete code - there could be other 'not so nice' things in it - but it compiles and runs in the aspect that the OP asked.
  7. You don't set the price anywhere. Add the line llSetPayPrice(PAY_HIDE, [(integer)rentalCost, 2 * (integer)rentalCost, 3 * (integer)rentalCost, 4 * (integer)rentalCost] ); to the state_entry events of the states idle and rented and it should work. //Options vector rentalOffset = <0,0,10>; float updateInterval = 60.0; //seconds string infoNotecard = ""; //Variables string tierName; float rentalCost; integer primCount; key renterID; string renterName; float rentalTime; integer listenQueryID; vector initPos; vector initScale; integer count; integer lineCount; key readKey; string rentalGrade; integer primAllotment; //Constants float ONE_WEEK = 604800.0; float ONE_DAY = 86400.0; float ONE_HOUR = 3600.0; dispString(string value) { llSetText(value, <1,1,1>, 1); } sendReminder(string message) { llInstantMessage(renterID, "Your lease located in " + llGetRegionName() + " (" + (string)initPos.x + "," + (string)initPos.y + "," + (string)initPos.z + ") will expire " + message); } saveData() { list saveData; vector storageVector; saveData += renterID; saveData += renterName; saveData += llRound(rentalTime); storageVector = initPos * 1000; saveData += "<" + (string)llRound(storageVector.x) + "," + (string)llRound(storageVector.y) + "," + (string)llRound(storageVector.z) + ">"; storageVector = initScale * 1000; saveData += "<" + (string)llRound(storageVector.x) + "," + (string)llRound(storageVector.y) + "," + (string)llRound(storageVector.z) + ">"; llSetObjectDesc(llDumpList2String(saveData, "|")); } string getTimeString(integer time) { integer days; integer hours; integer minutes; integer seconds; days = llRound(time / 86400); time = time % 86400; hours = (time / 3600); time = time % 3600; minutes = time / 60; time = time % 60; seconds = time; return (string)days + " days, " + (string)hours + " hours, " + (string)minutes + " minutes"; // + ":" + (string)seconds; } integer setupDialogListen() { integer chatChannel = (integer)llFrand(2000000); llListenRemove(listenQueryID); listenQueryID = llListen(chatChannel, "", NULL_KEY, ""); return chatChannel; } updateTimeDisp() { dispString("Left click for prim count\nLeased by: " + renterName + "\nTime Remaining: " + getTimeString(llRound(rentalTime))); } dispData() { llSay(0, "========================"); llSay(0, "Rental Space Information"); llSay(0, "========================"); llSay(0, "This space is currently leased by " + renterName); llSay(0, "The current rental price is L$" + (string)((integer)rentalCost) + " per week."); llSay(0, "This space will be open for lease in " + getTimeString(llRound(rentalTime)) + "."); llSay(0, "Memory Free: " + (string)llGetFreeMemory()); } default { state_entry() { state initialize; } } state initialize { state_entry() { llSetTimerEvent(300); llOwnerSay("Waiting to obtain Debit Permissions."); llRequestPermissions(llGetOwner(), PERMISSION_DEBIT); } run_time_permissions(integer permissions) { //Only wait for payment if the owner agreed to pay out money if (permissions & PERMISSION_DEBIT) { state loadSettings; } } on_rez(integer start_param) { llResetScript(); } timer() { llRequestPermissions(llGetOwner(), PERMISSION_DEBIT); } touch_start(integer total_number) { integer x; for (x = 0; x < total_number; x += 1) { if (llDetectedKey(x) == llGetOwner()) { llResetScript(); } } llSay(0, "Waiting to obtain Debit Permissions from Owner."); } state_exit() { llSetTimerEvent(0); llSay(0, "Initialized."); } } state loadSettings { state_entry() { integer found = FALSE; integer x; count = 0; lineCount = 0; list savedList = llCSV2List(llGetObjectDesc()); if (llGetListLength(savedList) == 4) { rentalGrade = llList2String(savedList, 0); } else { rentalGrade = llGetObjectDesc(); } for (x = 0; x < llGetInventoryNumber(INVENTORY_NOTECARD); x += 1) { if (llGetInventoryName(INVENTORY_NOTECARD, x) == "Settings") { found = TRUE; } } if (found) { llOwnerSay("Reading Settings Notecard..."); readKey = llGetNotecardLine("Settings", lineCount); } else { llOwnerSay("Settings Notecard Not Found."); llResetScript(); } } dataserver(key requested, string data) { integer integerData; float floatData; if (requested == readKey) { if (data != EOF) { if ((llSubStringIndex(data, "#") != 0) && (data != "") && (data != " ")) { integerData = (integer)data; floatData = (float)data; if (count == 0) { tierName = data; } else if (count == 1) { if (integerData >= 0) { rentalCost = integerData; } else { rentalCost = 0; } } else if (count == 2) { if (integerData >= 1) { primCount = integerData; } else { primCount = 1; } } else if (count == 3) { rentalOffset = (vector)data; } else if (count == 4) { infoNotecard = data; } count += 1; } lineCount += 1; readKey = llGetNotecardLine("Settings", lineCount); } else { llOwnerSay("==============="); llOwnerSay("Settings Loaded"); llOwnerSay("==============="); llOwnerSay("Space Name: " + tierName); llOwnerSay("Rental Cost: L$" + (string)llRound(rentalCost)); llOwnerSay("Prims allowed: " + (string)primCount); llOwnerSay("==============="); llOwnerSay("Ready for Service!"); list savedList = llParseString2List(llGetObjectDesc(), ["|"], []); if (llGetListLength(savedList) == 5) { renterID = llList2Key(savedList, 01); renterName = llList2String(savedList, 1); rentalTime = llList2Integer(savedList, 2); initPos = (vector)llList2String(savedList, 3) / 1000; initScale = (vector)llList2String(savedList, 4) / 1000; state rented; } else { renterID = NULL_KEY; renterName = "Nobody"; rentalTime = 0; initPos = llGetPos(); initScale = llGetScale(); state idle; } } } } } state idle { state_entry() { llSetObjectDesc(""); llSetTexture("rentthisspace", ALL_SIDES); llSetScale(initScale); llSetPos(initPos); llSetTimerEvent(updateInterval); llOwnerSay((string)rentalCost); dispString(tierName + "\nLease this space for L$" + (string)llRound(rentalCost) + " per week.\n"+ (string)primCount + " prims\nPay this Box to begin your lease."); } moving_end() { initPos = llGetPos(); } changed(integer change) { if (change & CHANGED_SCALE) { initScale = llGetScale(); } } touch_start(integer num_detected) { integer x; integer chatChannel; for (x = 0; x < num_detected; x += 1) { if (llDetectedKey(x) == llGetOwner()) { llDialog(llGetOwner(), "Owner Options. Select one of the options below...", ["Info", "Reset"], setupDialogListen()); return; } } llSay(0, "Lease this space for L$" + (string)llRound(rentalCost) + " per week. " + (string)primCount + " prims. Pay this Sign to begin your lease."); for (x = 0; x < num_detected; x += 1) { llGiveInventory(llDetectedKey(x), infoNotecard); } } listen(integer channel, string name, key id, string message) { if (message == "Reset") { llResetScript(); } else if (message == "Info") { llListenRemove(listenQueryID); dispData(); llSay(0, "Lease this space for L$" + (string)llRound(rentalCost) + " per week. "+ (string)primCount + " prims. Pay this Sign to begin your lease."); llGiveInventory(id, infoNotecard); } } money(key id, integer amount) { if (amount >= rentalCost) { renterID = id; renterName = llKey2Name(renterID); rentalTime = ONE_WEEK * amount / rentalCost; saveData(); llSay(0, "Thank you " + renterName + " for leasing! Your lease will expire in " + getTimeString((integer)rentalTime) + "."); state rented; } else { llSay(0, "This space costs L$" + (string)rentalCost + " to rent."); llGiveMoney(id, amount); } } } state rented { state_entry() { llSetTexture("rented", ALL_SIDES); llSetScale(<0.5, 0.5, 0.5>); llSetPos(initPos + rentalOffset); updateTimeDisp(); llResetTime(); llSetTimerEvent(updateInterval); } touch_start(integer num_detected) { integer x; key detectedKey; for (x = 0; x < num_detected; x += 1) { detectedKey = llDetectedKey(x); if (detectedKey == llGetOwner()) { llDialog(detectedKey, "Lease Options. Select one of the options below...", ["Info", "Release", "Reset"], setupDialogListen()); } else if (detectedKey == renterID) { llDialog(detectedKey, "Click for info or click Release to end your Lease", ["Info", "Release"], setupDialogListen()); } else { dispData(); llGiveInventory(detectedKey, infoNotecard); } } } money(key id, integer amount) { if ((id == renterID)||(id == llGetOwner())) { float addTime; addTime = ONE_WEEK*amount/rentalCost; rentalTime += addTime; llInstantMessage(id, "Adding " + getTimeString(llRound(addTime)) + " to your lease. Lease Time is Now: " + getTimeString(llRound(rentalTime)) + "."); saveData(); updateTimeDisp(); } else { llGiveMoney(id, amount); llInstantMessage(id, "Left click for prim count\nThis space is currently leased by " + renterName + ". This space will be open for lease in " + getTimeString(llRound(rentalTime)) + "."); } } listen(integer channel, string name, key id, string message) { integer refundAmount; llListenRemove(listenQueryID); if (message == "Info") { dispData(); llGiveInventory(id, infoNotecard); } else if (message == "Release") { llDialog(id, "Are you sure you want to TERMINATE this rent?", ["Yes", "No"], setupDialogListen()); } else if (message == "Yes") { llInstantMessage(llGetOwner(), "LEASE TERMINATED: leased by " + renterName + " located in " + llGetRegionName() + " (" + (string)initPos.x + "," + (string)initPos.y + "," + (string)initPos.z + ") has ended."); state idle; } else if (message == "Reset") { llResetScript(); } } timer() { float timeElapsed = llGetAndResetTime(); if (timeElapsed > (updateInterval * 4)) { timeElapsed = updateInterval; } rentalTime -= timeElapsed; saveData(); updateTimeDisp(); //Process Reminders if (rentalTime <= 0) { llInstantMessage(llGetOwner(), "LEASE EXPIRED: leased by " + renterName + " located in " + llGetRegionName() + " (" + (string)initPos.x + "," + (string)initPos.y + "," + (string)initPos.z + ") has expired."); state idle; } if ((rentalTime <= ONE_DAY)&&(rentalTime >= ONE_DAY - (updateInterval*2))) { sendReminder("in one day."); } else if ((rentalTime <= ONE_HOUR*12)&&(rentalTime >= ONE_HOUR*12 - (updateInterval*2))) { sendReminder("in 12 hours."); } else if ((rentalTime <= ONE_HOUR)&&(rentalTime >= ONE_HOUR - (updateInterval*2))) { sendReminder("in one hour."); } }}
  8. It's difficult to tell what exactly goes wrong if you can't s the script - you should post it.
  9. It's far from being nice, but I wouldn't call it a head ache (in most cases, at least) - I usually include a resizing function customers can use.
  10. This wiki entry explains how the setting of an position with HUDs pretty well. And the answer to you second question is: no.
  11. Da du dir die Mühe einer solch ausfühlichen Antwort gegeben hast, will ich dir auch gerne eine Replik geben: Ich führe hier keinen philosophichen Diskurs - sorry - dafür ist dein Posting nun wirklich nicht angetan. Auf dieser Ebene werde ich mich hier auch nicht bewegen. Ich glaube nicht, dass du dich auf mein Posting beziehst - sonst würdest du die ironische Überhöhung erkannt haben. Aber da du Probleme mit rhetorischen Figuren zu haben scheinst, hier die Übersetzung/Erläuterung: Du hinterfragst mit deinem "Muß ich sowas dann dulden ?" ob die deiner Meinung nach einseitige Darstellung so erlaubt sein sollte. Nun ist also der Erschaffer dieser Sim nicht - im Gegensatz zu dir - dass man eine Beschreibung der Funktion eines AKW auch mit den Risiken anreichern müsste - das ist seine Meinung - und du fragst ob du diese dulden musst? q.e.d.
  12. Wow, Bon, das ist lupenreiner Faschismus, den du hier ausüben willst. Bon mag Befürworter von Atomkraft nicht - weg mit ihnen. Klsse - so macht SL Spaß.
  13. Have yoi tried asking in the in world LSL Plus Users group?
  14. Rolig is right - your script is a pain to read - next time you should format it more readable. Since, however, it could be changed without having to read most of it (at least I hope I managed to do just that) and mostly by adding some lines, here is a version that should look for an NC named Config which should contain lines formatted like: UUID, percentageUUID, percentage string gsCardName = "Config";key gkQuery;integer giLine;key owner;integer stp;key req;integer done=0;//list of partners add avi key in the commas the number is persentage of split this can be changed//list partners;list garbage=[];list finaldata=[];//Function Handlers//Next step to check in partners listnext(){stp+=2;llSetTimerEvent(0.1);}//Return the string for the current stepstring l2s(){return llList2String(partners,stp);}//Request debit permissions for split profitreqq(){llRequestPermissions(llGetOwner(),PERMISSION_DEBIT);}//Return the amt to give to the partnerinteger cut(integer percent, integer amt){return (integer)(((float)percent/100)*amt);}//Add data to be removed to the garbage list.discard(string tmp){llOwnerSay("Discarding "+tmp+" due to invalid name/key.");garbage+=tmp;}//Verify the list to see it is a UUID. If not, then//do an HTTP Request to acquire the person's UUID.listcheck(){ if(stp>=(llGetListLength(partners)-1)){ dump();return; } string tmp=l2s(); if(tmp==""){llOwnerSay("Error: There are blank entries in the script. Please enter data the data necessary.");return;} if((key)tmp!=NULL_KEY && llStringLength(tmp)==36){ finaldata+=[tmp,llList2Integer(partners,stp+1)]; next();return; } else{ if(llGetListLength(llParseString2List(tmp,[" "],[]))!=2){ discard(tmp);next();return; } else{ req=llHTTPRequest("http://w-hat.com/name2key?terse=1&name="+llEscapeURL(tmp),[],""); } }}//Dump the invalid datadump(){ partners=[];garbage=[]; done=1;llSetTimerEvent(0.25);}//Pay out to the partners based on each of their sharespayout(integer amt){ integer a=0; integer b=llGetListLength(finaldata); for(;a<b;a++){ if(a%2==0){ if(llList2Integer(finaldata,a+1)!=0) llGiveMoney(llList2Key(finaldata,a),cut(llList2Integer(finaldata,a+1),amt)); } } }default{ on_rez(integer parm){llResetScript();} state_entry(){ owner=llGetOwner(); llOwnerSay("Reading configuration."); giLine = 0; gkQuery = llGetNotecardLine(gsCardName, 0); //llOwnerSay("/me requires Debit Permissions to split profits. Please accept."); //reqq(); } dataserver(key queryid, string data) { if (gkQuery == queryid) { if (data == EOF) { llOwnerSay("/me requires Debit Permissions to split profits. Please accept."); reqq(); } else { list lidata = llParseStringKeepNulls(data, [","], []); if (llGetListLength(lidata) == 2) { partners += llStringTrim(llList2String(lidata, 0), STRING_TRIM); partners += (integer)llStringTrim(llList2String(lidata, 1), STRING_TRIM); } gkQuery = llGetNotecardLine(gsCardName, ++giLine); } } } http_response(key rid, integer stat, list metadata, string body){ if(req==rid){ string tmp=l2s(); if((key)body==NULL_KEY){ discard(tmp);next();return; } else{ garbage+=tmp;finaldata+=body;finaldata+=llList2Integer(partners,stp+1);next(); } } } run_time_permissions(integer perm){ if(perm&PERMISSION_DEBIT){ llOwnerSay("Please provide a moment to verify the list of profit holders."); stp=0;listcheck(); } } timer(){ llSetTimerEvent(0.0); if(!done)listcheck(); else state ready2pay; }}state ready2pay{ on_rez(integer parm){llResetScript();} state_entry(){llOwnerSay("List has been verified. Split profit is now enabled for all on the partner list.");} money(key who, integer amt){ if(llGetListLength(finaldata)<=1) return; payout(amt); }}
  15. Here is a simple example of what I wrote about earlier: list glStandings;default{ collision_start(integer num_detected) { integer i = 0; for (; i < num_detected; ++i) { glStandings += llDetectedName(i); if(llGetListLength(glStandings) > 1) { llOwnerSay("The winner is " + llList2String(glStandings, 0)); llOwnerSay("The second best is " + llList2String(glStandings, 1)); glStandings = []; return; } } }} I hope I didn't make any typos. Your problem could be connected to the collision event - which one are you using? In theory, it should all be fine with the collision_start event. You could - to make it save - check in the same manner as you did if the person is in the event already - here is the example list glStandings;default{ collision_start(integer num_detected) { integer i = 0; for (; i < num_detected; ++i) { if(llListFindList(glStandings, [llDetectedName(i)]) == -1) { glStandings += llDetectedName(i); if(llGetListLength(glStandings) > 1) { llOwnerSay("The winner is " + llList2String(glStandings, 0)); llOwnerSay("The second best is " + llList2String(glStandings, 1)); glStandings = []; return; } } } }}
  16. He's a dead funny troll, after all.
  17. Your solution will work if the two contestants in 1st and 2nd place cause 2 events (which is by far the most likely case) - it won't however work, if the 2 are caught by the same event. To make sure you cover both cases, you can use a list to store the two relevant contestants - the first one in position 0 and the 2nd one in pos 2. As the collision occurs, you check if the number of objects in the cillision is bigger than 1 - if it is, you have you're two contestants, if it's just one, you store it in your list and wait for the next collision to get the 2nd.
  18. The example above is just to demonstrate the basic idea - it just sets the glow to 1; color to <0,0,0> and alpha to 1.0. You could introduce a global integer, e.g. giVisible - on attaching you can set the prims to visible (the function also requires you to set the color) and giVisible to 1. This example extends the first one in that it switsches the "states" integer giVisible = 1;switchVisible(vector col, float glow, float alpha) { integer i; for(i = 1; i <= llGetNumberOfPrims(); ++i) { if (llSubStringIndex(llList2String(llGetLinkPrimitiveParams(i, [PRIM_NAME]), 0), "glow") > -1) { llSetLinkPrimitiveParams(i, [PRIM_GLOW, -1, glow, PRIM_COLOR, -1,col, alpha]); } }}default { touch_end(integer num_detected) { if(giVisible == 0) { switchVisible(<0, 0, 0>, 1.0, 1.0); } else { switchVisible(<1, 0, 0>, 0.15, 0.0); } giVisible = !giVisible; } attach(key id) { switchVisible(<0, 0, 0>, 1.0, 1.0); giVisible = 1; }}
  19. If yopu wanted to, you could use the function llSetPrimitivParameter if the script is in the prim you want the parameters for or llSetLinkPrimitiveParams or prim(s) other the one that contains the script. If you know the link number (this can be tricky, since the link number can change) you simply call the function several times for each prim. I prefer to identify the prims in question by names or part of their names. Let's say all prims that have to have changing glow and alpha parameters are named: glow1, glow2, glow3 ..., you could use something like: default { touch_end(integer num_detected) { integer i; for(i = 1; i <= llGetNumberOfPrims(); ++i) { if (llSubStringIndex(llList2String(llGetLinkPrimitiveParams(i, [PRIM_NAME]), 0), "glow") > -1) { llSetLinkPrimitiveParams(i, [PRIM_GLOW, -1, 1.0, PRIM_COLOR, -1, <0,0,0>, 1.0]); } } }}
  20. Well, on the editor level there are edotors which let you include code - like Eclipse and I think LSL Editor. But that's not what the OP asked for, if I got it right.
  21. The only way to do that is to use the usual means of communication - which in this case would most likely be llSay (or llWhisper, or llShout ..) if the scripts are in different objects or llMessageLinked of they are im one. I'm afraid, that's abourt all.
  22. Well, if they are randomly generated, it should be enough (not Fort Knox, maybe) - if you really, really, really want to make sure, you would have to check them against each other.
  23. There should be several ways to do this. It should be pretty simple to construct a channel integer based on the key which is formed of hexidecimal characters. If you work with a database, you could also generate a unique random integer that gets stored in the dartabase for each player when they first register. Just two thoughts that popped up in my mind.
  24. Just to make sure I got you right: You got a reset script that reports to the db and then resets? Right?
×
×
  • Create New...