|
InuYasha Meiji
Half Demon
Join date: 14 Mar 2005
Posts: 127
|
02-17-2006 20:15
what would be the best way to get an object that takes voice commands not care about the case of the command.
As an example, If I make a light turn on by typing the command: Ignite, ignite, IgNite, or even IGNITE, I would like it to know to light up. How would I convert any or all caps combinations to spell ignite and convert the whole thing to IGNITE or ignite so the object would know what to do?
would somebody be willing to make a quick all caps conversion script or function?
-InuYasha
P.S. Sorry if it is something obvious. I do have eye trouble, I might have missed it.
|
|
Padraig Stygian
The thin mick
Join date: 15 Aug 2004
Posts: 111
|
02-17-2006 20:34
llToLower default { state_entry() { llListen(0, "",llGetOwner(),""); } listen(integer channel, string name, key id, string msg) { string message = llToLower(msg); if (message == "ignite") { //do stuff here } } }
|
|
Folco Boffin
Mad Moo Cow Cultist
Join date: 27 Feb 2005
Posts: 66
|
02-17-2006 20:52
Or the inverse, llToUpper() default { state_entry() { llListen(0, "",llGetOwner(),""); } listen(integer channel, string name, key id, string msg) { string message = llToUpper(msg); if (message == "IGNITE") { //do stuff here } } }
_____________________
^-^
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.
|
|
Nepenthes Ixchel
Broadly Offended.
Join date: 6 Dec 2005
Posts: 696
|
02-18-2006 05:19
From: Folco Boffin Or the inverse, llToUpper() Lower case looks nicer in the code, and lets thing in all caps (like my global constants) stand out. A minor thing, but enough to make me use lower case instead of upper.
|
|
InuYasha Meiji
Half Demon
Join date: 14 Mar 2005
Posts: 127
|
Thank
02-18-2006 05:40
From: Nepenthes Ixchel Lower case looks nicer in the code, and lets thing in all caps (like my global constants) stand out.
A minor thing, but enough to make me use lower case instead of upper. I do things like that too. I like to keep things neat. Thanks for taking the time to help me out. I might have found it in the Wiki myself, but had no clue what to even look under. You know what I mean. What would I have entered in the search engine in order to get that command? I just couldn't think of anything. So I thank you, you couldn't have made it any more clear. -Inu
|
|
Candide LeMay
Registered User
Join date: 30 Dec 2004
Posts: 538
|
02-18-2006 06:15
From: InuYasha Meiji I might have found it in the Wiki myself, but had no clue what to even look under. You know what I mean. What would I have entered in the search engine in order to get that command? I just couldn't think of anything. I would read the section about the datatype String, which happens to have listed functions for string manipulation.
_____________________
"If Mel Gibson and other cyberspace writers are right, one day the entire internet will be like Second Life." -- geldonyetich
|