i would like a way to stop somebody use my object when timer is finish.
Is there a simple method to "stop" all scripts?
Or have i to use a "non permission" after timer ends.
(sorry for bad english)
These forums are CLOSED. Please visit the new forums HERE
a timer question |
|
|
Yuli Orman
Registered User
Join date: 4 May 2006
Posts: 20
|
11-11-2006 09:01
i would like a way to stop somebody use my object when timer is finish.
Is there a simple method to "stop" all scripts? Or have i to use a "non permission" after timer ends. (sorry for bad english) |
|
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
|
11-11-2006 09:09
i would like a way to stop somebody use my object when timer is finish. You could call llSetScriptState("ScriptName", FALSE) on the relevant scripts (substituting their name for "ScriptName", of course). However, who will be the owner of this object, you or them? |
|
Yuli Orman
Registered User
Join date: 4 May 2006
Posts: 20
|
11-11-2006 09:35
Thank you
I am the owner but i cant find in the object's script the STOP function. and i dont know how to all desactive. i have to see if they are maybe owners too when they pay. |
|
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
|
11-11-2006 15:10
Perhaps it would help to describe why you want the scripts to stop.
|
|
Yuli Orman
Registered User
Join date: 4 May 2006
Posts: 20
|
11-11-2006 15:21
it's very hard for me to speak english.
But i have an object wich content diffferent scripts for make poses animations with a menu. And i want to add a timer wich stop the object when time is out. So where do i put the time event and which script have i to call with the llsetscriptstate.? |
|
Raeyan Aldrich
Registered User
Join date: 14 Oct 2006
Posts: 44
|
11-11-2006 19:08
CODE
be aware that the person with your object does have the ability to reset the script and re-enable it, using the tools menu. to completely disable the script, you should delete it from the object's inventory instead. |
|
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
|
11-11-2006 20:36
I`m unclear here, but attempting to read around the original poster`s broken english [Yes, I know why it is broken], I think that
Yuli, would you be willing to post your existing script here, where everyone can see it? We can help better when we can see what you`re doing already. _____________________
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
11-12-2006 03:21
Sounds like a pay per play type arrangement?
I suggest that you switch states when the user pays to the running state then in the new state entry activate the amination (or what ever) and start the timer. The timer event then forces a swicth back to the idle / waiting for payment state? CODE
|
|
Yuli Orman
Registered User
Join date: 4 May 2006
Posts: 20
|
11-12-2006 13:54
Thank you for all your help. That script seems almoast ready.
Newgate there is an error after EndGame(?), between thz" )"In that object i have a lot of scripts (run, menu, pose...) and i dont realy know where may i have to put my money and timer events. |
|
Yuli Orman
Registered User
Join date: 4 May 2006
Posts: 20
|
11-12-2006 14:01
This is the original script. It's not mine. I hope creator will dont angry.
the RUN MENU //MLP MULTI-LOVE-POSE V1.2 - Copyright (c) 2006, by Miffy Fluffy (BSD License) //To donate, go to my profile (Search - People - Miffy Fluffy) and use the "Pay..." button, thanks! //You can also find the link to the latest version here. // DESCRIPTION OF THE SCRIPTS // // ~run: // Default: sets other scripts to not running. // When the object is touched it will start all scrips. // // ~memory: // Here the positions are stored permanently. Information is still kept when the script is // not running or when everything is placed in inventory. The information will be lost only // when the ~memory script is reset. // A backup can be made on the .POSITIONS notecard, when the memory is empty, it will start // reading the .POSITIONS notecard automatically. // // ~menu: // 1.loading: reads the .MENUITEMS notecard and builds the menu. // When it reads a "POSE": - the animations are stored in ~pose // - their matching positions are looked up in ~memory and stored // in ~pos. // 2.ready: // When the object is touched: - shows the main menu // - listens for menu selections. // // When a submenu is selected: - shows the submenu // - when balls are defined for this submenu it will rez // balls (if not already there) and set their colors. // // When a pose is selected: - ~pose will send the animations to ~pose1 and ~pose2, // they will set the animations to the avatars // - ~pos wil send the matching positions to each ball. // // When a position is saved: - ~pose will ask the balls for their position // - the positions are saved in ~memory ("permanent" ![]() // - the positions are updated in ~pos // // When "STOP" is selected: - will hide the balls // - will stop the pose // When "STOP" is selected again (or if no pose is started yet): // - will remove the balls (derez/die) // // ~pos: // - loads the positions from ~memory and stores them (until shutdown/restart) // - sends positions for the selected pose to the balls // // ~pose: // - loads the animations from the .MENUITEMS notecard and stores them (until shutdown/restart) // - sends animations for the selected pose to ~pose1 and ~pose2 // - when saving a position: will ask balls for their position and sends it to ~pos and ~memory // (~pos would be a more logical place to handle this, but ~pose has more free memory). // // ~pose1 & pose2: // - will ask permission to animate the avatar on ball 1&2 // - will set the animations to avatar 1&2 // // ~ball // - when balls are defined for a submenu (in .MENUITEMS), ~menu will rez two copies of ~ball // - ball 1&2 will receive a unique communication channel from ~menu // - the color for ball 1&2 is set by ~menu // - the position of ball 1&2 is set by ~pos // - when an avatar selects to sit on a ball, the avatar info is sent to ~pose1 or ~pose2, they // will ask permission and set the animation directly to the avatar (not via the ball) // - balls will commit suicide when they don't hear a "LIVE" message each minute (from ~menu). // // have fun! //Note: if you make a revised version, please mention something like this: //"MLP - alternative version by ... .... - Revision 1 (based on MLP V1.2 by Miffy Fluffy) setRunning(integer st) { llSetScriptState("~menu", st); llSetScriptState("~pos", st); llSetScriptState("~pose", st); llSetScriptState("~pose1", st); llSetScriptState("~pose2", st); llResetOtherScript("~menu" ;llSetScriptState("~memory", TRUE); } default { state_entry() { llOwnerSay("OFF (touch to switch on)" ;setRunning(FALSE); } touch_start(integer i) { if (llDetectedKey(0) == llGetOwner()) state run; } } state run { state_entry() { llOwnerSay("MULTI-LOVE-POSE (version 1.2)" ;setRunning(TRUE); } } The MENU //MLP MULTI-LOVE-POSE V1.2 - Copyright (c) 2006, by Miffy Fluffy (BSD License) integer PINK1 = 1; //0001 binary integer BLUE1 = 2; //0010 binary integer PINK2 = 4; //0100 binary integer BLUE2 = 8; //1000 binary integer a; integer alive; integer b; integer b0; integer ballusers; integer c; integer ch; integer chat = 1; integer group; integer hear; integer i; integer line; integer menu; integer menuusers; integer redo = 1; integer rez; integer swap; integer visible; float alpha; string cmd; string pose; string pose0; key owner; key user; key user0; list buttons; list buttonindex; list commands; list menus; list balls; list users; //menu partly based on Menu Engine by Zonax Delorean (BSD License) //llDialog(user, menuname, buttons(from index to nextindex-1), channel) doMenu() { b0 = llList2Integer(buttonindex, menu); //position of first button for this (sub)menu b = llList2Integer(buttonindex, menu+1); //position of first button for next (sub)menu llDialog(user, llList2String(menus,menu), llList2List(buttons, b0, b - 1), ch - 1); c = llList2Integer(balls,menu); //ballcolors if (c) { //if submenu includes ballcolor(s): if (!rez) rezBalls(); //if no balls present: create balls llSay(ch,(string)(c & 3)); //ball1color: mask with 3 = 0011 binary llSay(ch+1,(string)(c >> 2)); //ball2color: shift 2 bits to the right if (ballusers) setBalls("GROUP" ; //if group access only} llResetTime(); //if (user != llGetOwner()) llOwnerSay(" "+llKey2Name(user)+" selects "+llList2String(menus,menu)+" " ; //owner will receive info} say(string str) { if (menuusers) llWhisper(0,str); else llOwnerSay(str); } setBalls(string cmd) { llSay(ch,cmd); //msg to balls llSay(ch+1,cmd); } rezBalls() { setBalls("DIE" ;llRezObject("~ball",llGetPos(),ZERO_VECTOR,ZERO_ROTATION,ch); llRezObject("~ball",llGetPos(),ZERO_VECTOR,ZERO_ROTATION,ch+1); llMessageLinked(LINK_THIS,0,"REPOS",NULL_KEY); //msg to pos llMessageLinked(LINK_THIS,0,"POSE","0" ; //msg to pos/poserez = 1; alive = 2; pose = pose0; llSetTimerEvent(60); if (chat) say("Balls ready" ;} default { state_entry() { //llSetScriptState("~run", TRUE); llResetOtherScript("~pos" ;llResetOtherScript("~pose" ;llResetOtherScript("~pose1" ;llResetOtherScript("~pose2" ;ch = (integer)("0x"+llGetSubString((string)llGetKey(),-4,-1)); //fixed channel for prim setBalls("DIE" ;alpha = llGetAlpha(0); //store object transparancy (alpha) if (alpha < 0.1) alpha = 0.5; else visible = 1; //if invisible store a visible alpha llMessageLinked(LINK_THIS,1,"OK?",NULL_KEY); //msg to memory: ask if ready } link_message(integer from, integer num, string str, key id) { if (num == 2) { if (str == "OK" state load; //memory ready} } } state load { state_entry() { llGetNotecardLine(".MENUITEMS",0); //read first line of menuitems notecard } dataserver(key query_id, string data) { if (data == EOF) state on; i = llSubStringIndex(data,"//" ; //remove commentsif (i != -1) { if (i == 0) data = ""; else data = llGetSubString(data, 0, i - 1); } while (llGetSubString(data, -1, -1) == " " data = llDeleteSubString(data, -1, -1); //remove spaces from endif (data != "" {i = llSubStringIndex(data," " ;cmd = data; if (i != -1) { //split command from data cmd = llGetSubString(data, 0, i - 1); data = llGetSubString(data, i+1, -1); } list ldata = llParseString2List(data,[" | "," | "," | "," | "," |","| ","|"],[]); data = llList2String(ldata, 0); if (cmd == "MENU" {if (a < 2) { llOwnerSay("warning: first item in .MENUITEMS must be: POSE stand" ;llOwnerSay("warning: second item in .MENUITEMS must be: POSE default" ;} llOwnerSay("loading data for '"+data+"'" ; if (llList2String(ldata, 1) == "GROUP" menu = 1; //access to submenuselse if (llList2String(ldata, 1) != "OWNER" menu = 2; //0=owner 1=group 2=allpose = llList2String(ldata, 2); if (pose == "PINK" rez = PINK1;else if (pose == "BLUE" rez = BLUE1;pose = llList2String(ldata, 3); if (pose == "PINK" rez += PINK2;else if (pose == "BLUE" rez += BLUE2;menus += [ data ]; balls += [ rez ]; buttonindex += [ b ]; users += [ menu ]; rez = 0; b0 = 0; menu = 0; } else if (b0 < 12) { //maximum 12 buttons per menu if (cmd == "POSE" {llMessageLinked(LINK_THIS,1,data,(string)a); //msg to memory llMessageLinked(LINK_THIS,9+a,llList2String(ldata, 1),llList2String(ldata, 2)); //msg to pose if (!a) pose0 = data; cmd = (string)a; ++a; } else if (cmd == "REDO" {if (llList2String(ldata, 1) != "OFF" redo = 1;} else if (cmd == "CHAT" {if (llList2String(ldata, 1) != "OFF" chat = 1;} else if (cmd == "BALLUSERS" {if (llList2String(ldata, 1) == "GROUP" ballusers = 1;} else if (cmd == "MENUUSERS" {if (llList2String(ldata, 1) == "GROUP" menuusers = 1;else if (llList2String(ldata, 1) != "OWNER" menuusers = 2;} commands += [ cmd ]; buttons += [ data ]; ++b; ++b0; } } ++line; llGetNotecardLine(".MENUITEMS",line); //read next line of menuitems notecard } state_exit() { buttonindex += [ b ]; //enter last buttonindex commands += [ "" ]; //empty command for undefined buttons (-1) llOwnerSay("READY" ;llOwnerSay((string)b+" menuitems loaded ("+llGetScriptName()+": "+(string)llGetFreeMemory()+" bytes free)" ;llMessageLinked(LINK_THIS,1,"LOADED",(string)a); //msg to memory llMessageLinked(LINK_THIS,9+a,"LOADED",NULL_KEY); //msg to pose } } state on { state_entry() { owner = llGetOwner(); llSetTimerEvent(0); llListenRemove(hear); hear = llListen(ch - 1, "", NULL_KEY, "" ; //listen for pressed buttons} touch_start(integer i) { user0 = llDetectedKey(0); if (user0 == owner || (menuusers == 1 && llDetectedGroup(0)) || menuusers == 2) { //0=owner 1=group 2=all if (user0 != user) { if (llGetTime() < 60) { llDialog(user0, "\n"+llKey2Name(user)+" has just selected the menu, do you want to continue?", ["Yes","Cancel"], ch - 1); return; } user = user0; group = llDetectedGroup(0); } menu = 0; doMenu(); //mainmenu } } listen(integer channel, string name, key user0, string button) { if (user0 != user) { if (button == "Yes" {user = user0; group = llSameGroup(user0); menu = 0; doMenu(); } else if (button != "Cancel" {llDialog(user0, "\nSelection cancelled because "+llKey2Name(user)+" has just selected the menu, do you want to operate the menu again?", ["Yes","Cancel"], ch - 1); } return; } b = llListFindList(buttons,[ button ]); //find position of cmd string cmd = llList2String(commands,b); //get command //llSay(0,button+" "+cmd); //debug if (cmd == "TOMENU" { menu = llListFindList(menus,[ button ]); //find submenu if (menu == -1) return; i = llList2Integer(users, menu); if (user == owner || (i == 1 && group) || i == 2) { //0=owner 1=group 2=all doMenu(); return; } if (i == 1) llDialog(user0, "\n"+button+" menu deactivated\n(access by group only)", ["OK"], ch - 1); else llDialog(user0, "\n"+button+" menu deactivated\n(access by owner only)", ["OK"], ch - 1); menu = 0; return; } else if (cmd == "BACK" {menu = 0; doMenu(); //mainmenu return; } else if ((integer)cmd > 0) { //POSE llMessageLinked(LINK_THIS,0,"POSE",cmd); //msg to pos/pose if (chat) say(button); pose = button; } else if (cmd == "SWAP" {llMessageLinked(LINK_THIS,0,"SWAP",NULL_KEY); //msg to pos/pose swap = !swap; } else if (cmd == "STAND" {llMessageLinked(LINK_THIS,0,"POSE","0" ; //STAND msg to pos/poseif (chat) say(button); menu = 0; pose = pose0; } else if (cmd == "STOP" {llMessageLinked(LINK_THIS,0,"POSE","0" ; //STAND msg to pos/poseif (chat) say(button); setBalls("DIE" ;if (chat && rez) say("Balls removed" ;rez = 0; llSetTimerEvent(0); return; } else if (cmd == "ADJUST" {setBalls("ADJUST" ;} else if (cmd == "HIDE" {setBalls("0" ;} else if (cmd == "SHOW" {setBalls("SHOW" ;} else if (cmd == "DUMP" {llMessageLinked(LINK_THIS,1,"DUMP",NULL_KEY); } else if (cmd == "INVISIBLE" {visible = !visible; llSetAlpha((float)visible*alpha, ALL_SIDES); } else if (cmd == "REDO" {redo = !redo; if (redo) say(button+" ON" ; else say(button+" OFF" ;} else if (cmd == "CHAT" {chat = !chat; if (chat) say(button+" ON" ; else say(button+" OFF" ;} else if (cmd == "BALLUSERS" {ballusers = !ballusers; if (ballusers) { llOwnerSay(button+" GROUP" ;setBalls("GROUP" ;} else { llOwnerSay(button+" ALL" ;setBalls("ALL" ;} } else if (cmd == "MENUUSERS" {if (user == owner) { if (!menuusers) { menuusers = 1; llOwnerSay(button+" GROUP" ;} else if (menuusers == 1) { menuusers = 2; llOwnerSay(button+" ALL" ;} else if (menuusers == 2) { menuusers = 0; llOwnerSay(button+" OWNER" ;} } else llWhisper(0,button+" (can be switched by owner only)" ;} else if (cmd == "RESET" {llMessageLinked(LINK_THIS,0,"POSE","0" ; //STAND msg to pos/posesetBalls("DIE" ;//llSleep(0.5); if (chat) say(button); llResetScript(); } else if (cmd == "OFF" {llMessageLinked(LINK_THIS,0,"POSE","0" ; //STAND msg to pos/posesetBalls("DIE" ;//llSleep(0.5); if (user == owner) { llOwnerSay(button); llResetOtherScript("~run" ;llResetScript(); } llDialog(user0, "\n"+button+" button deactivated\n(access by owner only)", ["OK"], -1); return; } else if (llGetSubString(cmd, 0, 0) == "Z" || (cmd == "SAVE" ) { //SAVE //Z-adjustllMessageLinked(LINK_THIS,0,cmd,pose); //msg to pos/pose doMenu(); return; } if (redo) doMenu(); } link_message(integer from, integer num, string str, key id) { if (num != 2) return; if (str == "ALIVE" {++alive; } else if (str == "DIE" { //suicide msg from ballsetBalls("DIE" ;menu = 0; rez = 0; llSetTimerEvent(0); } } on_rez(integer r) { if (owner != llGetOwner()) llResetScript(); } timer() { if (alive > 1) { alive = 0; llSay(ch,"LIVE" ; //msg to balls: stay alivellSay(ch+1,"LIVE" ; } else { //balls not rezzed properly anymore rezBalls(); llSay(ch,(string)(c & 3)); //ball1color: mask with 3 = 0011 binary llSay(ch+1,(string)(c >> 2)); //ball2color: shift 2 bits to the right if (ballusers) setBalls("GROUP" ; //if group access only} } } and there are others but i dont think you need it. So i want add money envent, timer event to stop the use of the object. |
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
11-12-2006 14:25
Thank you for all your help. That script seems almoast ready. Newgate there is an error after EndGame(?), between thz" )"In that object i have a lot of scripts (run, menu, pose...) and i dont realy know where may i have to put my money and timer events. I apologise, Waves at Llauren, this was not intended as a full script, but rather to demonstrate what was required. EndGame was thee only to demonstrate where I was calling things. |
|
Yuli Orman
Registered User
Join date: 4 May 2006
Posts: 20
|
11-12-2006 14:30
Smiles.. I understood just after my reply...
Difficult for a french girl to surviive in an english world. i try many solutions with all your helps. |
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
11-12-2006 15:07
Smiles.. I understood just after my reply... Difficult for a french girl to surviive in an english world. i try many solutions with all your helps. No Problem, Most people have difficulty understanding Newgy-esse ![]() You are using the MLP by Miffy Fluffy. Its quite a complex set of scripts. May be best to speak with her about the mods, but here are a few ideas To add pay per use support will require modifying so that the menu isnt available until after they have paid. You will also then need to start an independant timer script so that it will 'deactivate' the menu system when the time is up and kill the pose balls. |
|
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
|
11-12-2006 15:35
You are using the MLP by Miffy Fluffy. Its quite a complex set of scripts. May be best to speak with her about the mods, but here are a few ideas To add pay per use support will require modifying so that the menu isnt available until after they have paid. You will also then need to start an independant timer script so that it will 'deactivate' the menu system when the time is up and kill the pose balls. I apologise, Waves at Llauren ![]() Smiles.. I understood just after my reply... Difficult for a french girl to surviive in an english world. i try many solutions with all your helps. _____________________
|
|
Yuli Orman
Registered User
Join date: 4 May 2006
Posts: 20
|
11-13-2006 01:54
I have to ask her yes.
It almoast run, but i cant reset the loading of the menu after time out. after the time out the script run again so the user can play again. |
|
Yuli Orman
Registered User
Join date: 4 May 2006
Posts: 20
|
11-13-2006 09:04
Very big kisses to all of you. I have win that script.
I have to do other things but the better is done. Thank you very much |
|
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
|
11-13-2006 11:18
Very big kisses to all of you.I prefer hugs. May I have a hug instead?
I have win that script.Does this mean that you have it working the way you want it to?I have to do other things but the better is done.Thank you very muchYou`re welcome. ::hugs:: _____________________
|