Jump to content
  • 0

What's wrong with this script?


Void Singer
 Share

You are about to reply to a thread that has been inactive for 5191 days.

Please take a moment to consider if this thread is worth bumping.

Question

I already know, this is just a test post to check various methods of posting code.
But feel free to speak up if you know the answer

integer  Range     = 40;
float    Arc       = 2 * PI;
float    Frequency = 10.0;
list     Previous;
integer  Search;
string   Target;

default{
     state_entry(){
          llSensorRepeat( "", "", AGENT, Range, Arc, Frequency );
     }
     
     sensor( integer Sensed ){
          do{
               Target = llDetectedKey( --Sensed );
               Search = llListFindList( Previous, Target );
               if (Search = -1){
                    Previous = Target + llList2List( Previous, 0, 78 ); llDialog( Target, "Message ", [], -42 );
               }
          }while (Sensed)
     }
}
Link to comment
Share on other sites

Recommended Posts

  • 0

Ricky.Yates wrote:

PS: How do I generate these indented script boxes without pasting them?

LL turned on source code formatting so we would scream less! It is the >> button in the edit tool bar.  It is still the most easy if you paste code from a text editor but Shift+Enter can give a line break instead of a new paragraph if you want to enter code inline.

P.S. Void I am pleasantly surprised to see you here! I hope this place can work for you!

  • Like 1
Link to comment
Share on other sites

  • 0

Ricky gets a cookie, but not the prize, it should indeed be "==" instead of "=" there... good eye , but there's still more wrong here

 

ETA: @Cherise:

actually I've been here awhile in disguise, compiling a list of all the things that really need fixing... to make it actually useful... now I'm in "me" mode for reasons of documentation. PS you deserve a cookie to as spotting the code highlighting being enabled greatly ups the tolerability of this place.

Link to comment
Share on other sites

  • 0

Actually that part is valid, although some software writers would cry bad form depending on their style guide.


you can also get away with

llDetectedKey( Sensed -= Sensed );

or even

llDetectedKey( Sensed = Sensed - 1 );

but I say why waste compile space =)

although to give it a subtle error I could have gone with

llDetectedKey( Sensed-- );

 

part of the experiment of this post is to see how much attention it recieves, how quickly, and at what level of expertise. it's not perfect though, since some will obviously ignore since I said I know...

Link to comment
Share on other sites

  • 0

Void.Singer wrote:

part of the experiment of this post is to see how much attention it recieves, how quickly, and at what level of expertise. it's not perfect though, since some will obviously ignore since I said I know...

I only found this by accident because it happened to be at the top of the recent posts. I wouldn't have seen it otherwise. But I'm very glad you're here.

Link to comment
Share on other sites

  • 0

heh, guess I shouldn't be so nice as to keep posting and putting it back on top... but I have another related REAL question... at what point does a question get marked "possibly answered" ? is that in other peoples reply feedback, a matter of having awarded points for helpful, or is it just a matter of number of replies?

 

ETA:
well I know that posting back with not answered definitely changes it back... does any post to it push it into the "possibly" category? that seems kind stupid if you ask me...

Link to comment
Share on other sites

  • 0

If you post a question it goes to the 'not answered' column... if someone/anyone replies it goes to 'possibly answered'... if you mark it as correct it goes to 'recently answered'... and i believe you always have the option of putting it back in the 'not answered' column as you so desire based on the replies you get.

Yes, anyone replying puts it to being 'possibly answered', it's up to you if that is indeed the case and even as 'possibly answered' it doesn't stop others from continuing to reply if they have further to add.  Same with answered, they can get replied to forever too - barring the thread being locked by a moderator.

Link to comment
Share on other sites

  • 0
part of the experiment of this post is to see how much attention it recieves, how quickly, and at what level of expertise. it's not perfect though, since some will obviously ignore since I said I know...

/me nuked it because I saw this and have also wondered about such things.

Link to comment
Share on other sites

  • 0

integer  Range     = 40;

float    Arc       = 2 * PI;

float    Frequency = 10.0;

list     Previous;

key      Target;

 

default

{     state_entry()

     {          llSensorRepeat( "", "", AGENT, Range, Arc, Frequency );     }     sensor( integer Sensed )

     {          do

          {

               Target = llDetectedKey( --Sensed );

               if (llListFindList(Previous, Target) == -1){

                    Previous += ;

                    llDialog( Target, "Message ", [], -42 );               }          }while (Sensed)     }}

 

That's what I found to change.  I havn't tried it in a compiler so no clue if it'd work But it looks fine to me.

Personally I would do the sensor event differently to begin with but that's just a matter of style as was the change I made of removing the need for the "Search" integer.

Link to comment
Share on other sites

  • 0

check on the float (it won't prevent compile, compiler inserts a cast int the sensor repeat event)

though actually you can use an empty button list, and the viewer will insert an "OK" button.

still doesn't compile...

"oh won't someone please help newbie me fix this script?"


Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 5191 days.

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
 Share

×
×
  • Create New...