dustty Posted June 1, 2011 Share Posted June 1, 2011 What is wrong with this sc ript? default{ state_entry() { llSensorRepeat ("", NULL_KEY, SCRIPTED, RadarRange, PI, ScanRate); } sensor(integer total) { integer i; for(i=0;i<total;++i) { list z=llListen(-456733,"", NULL_KEY, ""); list stats=llParseString2List(llList2String(z,2),[":"],[":"]); if(llList2String(stats,1)==[key]) { { llSay(0,"cat"); } Link to comment Share on other sites More sharing options...
Cinnamon Lohner Posted June 1, 2011 Share Posted June 1, 2011 Just a wild guess based on limited scripting knowledge but it appears you have more open braces { than you do close braces } --Cinn Link to comment Share on other sites More sharing options...
Darkie Minotaur Posted June 1, 2011 Share Posted June 1, 2011 there are quite a few things syntacticaly wrong - some braces are, some varialble declarations missing - but you completely got the usage of lListen wrong - you better read up here Link to comment Share on other sites More sharing options...
Imnotgoing Sideways Posted June 1, 2011 Share Posted June 1, 2011 Hm? Dunno if it does what you want, but, it has a chance of compiling. () float RadarRange = //insert range constant here; float ScanRate = //insert rate constant here; key ExpectedKey = //insert key constant here; default { state_entry() { llSensorRepeat("",NULL_KEY,SCRIPTED,RadarRange,PI,ScanRate); } sensor(integer detected) { integer loop_iterator = 0; for(;loop_iterator<detected;loop_iterator++) { if(llGetDetectedKey(loop_iterator) == ExpectedKey ) { llSay(0,"cat"); } } } } Link to comment Share on other sites More sharing options...
dustty Posted June 1, 2011 Author Share Posted June 1, 2011 ok in this i get a syntax error on the list z= line default { state_entry() { llListen(-456733, NULL_KEY ,"", ""); } listen(integer channel, string name, key id, string message) { list z=(string); list stats=llParseString2List(llList2String(z,2),[":"],[":"]); if(llList2String(stats,1)=="Settings info") { llSay(0,"cat"); } } } Link to comment Share on other sites More sharing options...
Rolig Loon Posted June 2, 2011 Share Posted June 2, 2011 That's because list z =(string) doesn't mean anything. My guess is that you meant to grab the message and create a list with it as the sole element. If so , then what you really meant was list z = [message]; I don't understand what you are trying to do with it after it's in list z, though. It looks as if you expect the message to consist of a set of values separated by colons. If so, you don't need this list z business at all. You already almost have it in the next line ......... list stats = llParseString2List(message,[":"],[]); Then you can go ahead and ask if (llList2String(stats,1) == "Settings info")....blah blah blah.... Incidentally, you know that stats,1 is the second element in the list, right? stats,0 is the first one. Link to comment Share on other sites More sharing options...
Innula Zenovka Posted June 2, 2011 Share Posted June 2, 2011 It might be easier if you explain what you want the script to do, because it's a bit hard to figure that out from the code as it is. You're scanning for scripted objects -- pets, maybe? -- and it looks as if, when you find one, you're trying to find out something about it. But I can't really get much further and, to my mind, it's better if you explain what it's supposed to do rather than us take guesses. Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now