Portal    Foro    Buscar    FAQ    Registrarse    Conectarse
Publicar Nuevo Tema  Responder al Tema  Mensaje de Gracias Página 1 de 1
 
Menú Para Elegir Notecards
Autor Mensaje
Responder Citando  
Mensaje Menú Para Elegir Notecards 
 
como no tengo ni ida de LSL cuando me hace falta un script acudo a amigos o al GranAmigoGoogle.

he visto un script que cuando tocas el opbjeto te ofrece un menú para que elijas qué notecard quieres. no lo he probado aún (problemas con mi ordenador grrrrr) pero me parece útil y supongo que si tiene algún error alguien sabrá detectarlo con sólo leerlo.

la fuente es 3greeneggs

y este el script:

Cita:
//  Notecard Selector
//  by Ann Enigma
//  This script presents users with a list of notecards in a dialog box, and allows them to select one
//  Note: The names of the notecards must be less than 24 characters long

// This script is licenced under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
// http://creativecommons.org/licenses/by-nc-sa/3.0/us/

// configurable options
string message = “Which notecard would you like to read?”; // the message on the dialog box
integer command_channel = 616; // the channel on which to listen for commands (you probably won’t need to change this)

// the script
list notecards;

default
{
    state_entry()
    {
                integer i = 0;
              
                // read the title of each notecard into a list
                for(i=0;i<llGetInventoryNumber(INVENTORY_NOTECARD);i++) {
                        notecards = (notecards=[]) + notecards + [llGetInventoryName(INVENTORY_NOTECARD,i)];
                }
              
                llListen(command_channel, “”, “”, “”); // listen for a dialog button press
    }

    touch_start(integer total_number)
    {
        llDialog(llDetectedKey(0), message, notecards, command_channel); // present the dialog
    }

        listen(integer channel, string name, key id, string message) {
                if (llListFindList(notecards, (list)message) != -1) { // this is a valid notecard
                        llGiveInventory(id, message); // give the user the notecard
                }
        }
      
        changed(integer changed_bitfield) {
                // if the object’s inventory changes, reset the script
                if (changed_bitfield == CHANGED_INVENTORY) {
                        llResetScript();
                }
        }
}

  



Desconectado Ver perfil del usuario Enviar Mensaje Privado
Descargar Mensaje Volver arriba Página Inferior
Responder Citando  
Mensaje Re: Menú Para Elegir Notecards 
 
El script de arriba da error porque usa unas comillas raras, basta cambiarlas.
El correcto sería así:

Cita:
//  Notecard Selector
//  by Ann Enigma
//  This script presents users with a list of notecards in a dialog box, and allows them to select one
//  Note: The names of the notecards must be less than 24 characters long

// This script is licenced under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
// http://creativecommons.org/licenses/by-nc-sa/3.0/us/

// configurable options
string message = "Which notecard would you like to read?"; // the message on the dialog box
integer command_channel = 616; // the channel on which to listen for commands (you probably won’t need to change this)

// the script
list notecards;

default
{
    state_entry()
    {
                integer i = 0;
              
                // read the title of each notecard into a list
                for(i=0;i<llGetInventoryNumber(INVENTORY_NOTECARD);i++) {
                        notecards = (notecards=[]) + notecards + [llGetInventoryName(INVENTORY_NOTECARD,i)];
                }
              
                llListen(command_channel, "", "", ""); // listen for a dialog button press
    }

    touch_start(integer total_number)
    {
        llDialog(llDetectedKey(0), message, notecards, command_channel); // present the dialog
    }

        listen(integer channel, string name, key id, string message) {
                if (llListFindList(notecards, (list)message) != -1) { // this is a valid notecard
                        llGiveInventory(id, message); // give the user the notecard
                }
        }
      
        changed(integer changed_bitfield) {
                // if the object’s inventory changes, reset the script
                if (changed_bitfield == CHANGED_INVENTORY) {
                        llResetScript();
                }
        }
}


(gracias señor Anti Landers por el donativos que me ha dado por probarlo, siempre es una ayuda para preparar el largo invierno en la calle  Crying or Very sad )
  




____________
¿Menor de edad? Según se mire.
Desconectado Ver perfil del usuario Enviar Mensaje Privado
Descargar Mensaje Volver arriba Página Inferior
Responder Citando  
Mensaje Re: Menú Para Elegir Notecards 
 
De nada, Menos18, yo me he ahorrado un trabajo y gracias al tuyo se ha visto que había un error, todos ganamos con ese donativo..... aunque sigo pensando que tu y tu banda de arrapiezos os estáis haciendo los más ricos de caledon, avilion y demas jajajaa
  



Desconectado Ver perfil del usuario Enviar Mensaje Privado
Descargar Mensaje Volver arriba Página Inferior
Mostrar mensajes anteriores:
Publicar Nuevo Tema  Responder al Tema  Mensaje de Gracias  Página 1 de 1
 

Usuarios navegando en este Tema: 0 Registrados, 0 Ocultos y 0 Invitados
Usuarios Registrados conectados: Ninguno


 
Lista de Permisos
No puede crear mensajes
No puede responder temas
No puede editar sus mensajes
No puede borrar sus mensajes
No puede votar en encuestas
Puede enviar eventos al Calendario