Jump to content

0IInoaII0

Resident
  • Posts

    4
  • Joined

  • Last visited

Posts posted by 0IInoaII0

  1. I tried doing this way but it was behaving weird, like calling enterAgainMenu() twice and also always executing the failure condition. I think link_message event of 1st script was listening it's own llMessageLinked(). So i had to add one more if condition in link_message that compares the key in order to avoid link_message of same script listen its own messageLinked.

    now after some hit and trial finally everything is sorted and it's working how i wanted. high5 KT  \*.*

    • Like 1
    • Thanks 1
  2. 48 minutes ago, KT Kingsley said:

    If you're using the number parameter in the link messages from the second script to return the converted integer, and the value returned is only zero when there's been an error, have the main script check the return value, and if it's zero, pop up the error dialog there. So the link_message and listen events in the main script would look something like this:

    
    link_message (integer sender, integer number, string message, key id)
    {
    	if (number == 0)
    	{
    		llDialog (user, "Invalid integer.", ["Enter again"], channel);
    	}
    	else
    	{
    		//do whatever you're going to do with the valid integer
    	}
    }
    
    listen (integer channel, string name, key id, string message)
    {
    	if (message == "Enter again")
    	{
    		//do the text box thing again
    	}
    	//all the other listen stuff
    }

     

    Thank you KT. 

    Assume the llDialog() menu some more buttons too. So once user enter the number it has to do all that functions what I explained above and then it has to return back the main menu again. Something like this...

     

    listen(......., string message)

    {

         If( pointer == 0)   //listening main menu buttons

         {

              if(message == "enter number")

              {

                    llTextbox...

                    Pointer = 1;

                    button = 1;

              }

              else if( message == "enter string")

              .......

             else if(message =="enter float")

             ......

            else     // this equivalent to if(message=="enter again")

                  lltextbox....

          }

          else       //when pointer=1;

          {

               if(button==1)

              {

                   llMssageLinked(.....,messag);

                   ? ? ? // Here I wanna do something 

                   ???

                   If(not integer)

                   {

                        Pointer = 0;

                        enterAgainMenu();    //it gives menu with button ["enter again"];

                    }

                    else

                           llOwnerSay("number = "+message);

                   

                    pointer = 0;

                   mainMenu(); // it gives back the main menu again

               }

               else if(button == 2)

                ...........

               else if........

              ...........

              }

         }

    }

    link_message(.....)

    {

         ???

    }

     

    In this case how do I handle it.

    (If I will apply the logic you gave it will popup main menu and also the textbox at a same time I guess...?)

  3. #LearningLSL

    Suppose :

    (Both scripts are in single prim)

    1. user is in llDialog() menu where she pressed "enter number" button.

    2. User entered a number in text box llTextbox(). 

    3. Got the messag through listen() and I have to convert as well as check if the given string is integer. To do so, my function is placed in another script within same object.

    4. I send message through llMessageLinked containing the entered string and I will send an integer too (that is 1);

    5.if the second script's link_message() will recived integer 1 with that message then it will call the function toInteger(message);

    6. toInteger() will return 0 if the given string contains anything except numbers, else it will return the converted integer num. It send result through llMessageLinked() back to main script.

    7. the link_message() event of main script recieve that integer sent by toInteger().

    -----------------------------------------

    Now how I should proceed further to get this integer back to where I sent it first time through llMessageLinked() in another script to get converted(referring to step 4) . If it is not integer then I wanna pop up llDialog() again which say "Enter Again". my all llDialog() menus are in one script and all functions are in another.

    (Ps : Firstly, thanks for patient reading. Secondly, I am just learning so please don't suggested how to do it within same script or use a predefined function to check or convert etc etc...)

×
×
  • Create New...