|
Folco Boffin
Mad Moo Cow Cultist
Join date: 27 Feb 2005
Posts: 66
|
02-20-2006 15:12
Just wondering if this is the most efficiant way to do handle this. I'm using dialogs that operate on a random channel each time and time out after 20 seconds. If anything needs clarified let me know. And do I really need a noReply check? listen(integer channel, string name, key id, string message) { llSetTimerEvent(0.0); llListenRemove(g_listen); noReply = FALSE; if (message == "Exit") { inUse = FALSE; } else if (message == "Back") { mainBox(); } else if (message == "Reset") { resetBox(); } else if (message == "No") { inUse = FALSE; } else if (message == "Yes") { reset(); } else if (message == "Color") { colorBox(); } else if (message == "Name") { nameBox(); } else if (message == "Score") { scoreBox(); } else { list a = [message]; integer b = llListFindList(colorList, a); llMessageLinked(LINK_THIS, 37, llList2String(colorVectors, b - 2), ""); } } timer() { llSetTimerEvent(0.0); if (noReply) { llListenRemove(g_listen); inUse = FALSE; noReply = FALSE; llInstantMessage(user, "Dialog has timed out."); } }
_____________________
^-^
Signed, Gorgarath, Whom in this game called Second Life, plays the avatar Folco Boffin, and in this game called First Life, plays the avatar John McDonnell.
|
|
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
|
02-21-2006 11:47
In your script snippets, I don't see how noReply will ever be TRUE, in which case your timer() event will not remove the listen.
If you are setting it prior to the llDialog (which you don't show) then I think it's superfluous as your listen immediately cancels the timer. In which case your timer() event will only ever occur when noRely is TRUE.
There is also a chance that any time-out will leave the user with a menu that will no longer be 'heard' by the script. With 'exotic' channels (randomly generated and away from the more common lower channel numbers), I tend to only set them on-rez as there's very little chance of conflicts.
|