Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
archiv:opensim:downloads:scripts:texture_dropper [2024/01/24 16:39] – Externe Bearbeitung 127.0.0.1 | archiv:opensim:downloads:scripts:texture_dropper [Unbekanntes Datum] (aktuell) – Externe Bearbeitung (Unbekanntes Datum) 127.0.0.1 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ===== Texture Dropper ===== | ||
+ | |||
+ | < | ||
+ | // **** Texture Dropper Screen v1.11, by Mircea Kitsune & Sm0key **** | ||
+ | |||
+ | // -------- Settings: -------- | ||
+ | // Modify these to adjust the properties of your screen. Unless a specific value is required, use TRUE or FALSE. | ||
+ | |||
+ | integer face = 0; //Primitive face to be used as screen. | ||
+ | integer text = 2; //0 means no text, 1 displays lock status, 2 displays lock status and image + creator names. Selecting 2 clears the image between script restarts. | ||
+ | integer notices = TRUE; //Echo information such as locking / unlocking of the screen and error messages in-world. | ||
+ | |||
+ | integer lockdefault = FALSE; //Set to TRUE if the screen is to be locked by default. Relevant in the case of script restarts and when using the " | ||
+ | integer lockonpost = FALSE; //If TRUE the screen is locked once someone posts the first picture in it, useful for 'find and claim' screens. | ||
+ | integer creatorlock = TRUE; //When lockonpost is also TRUE, this allows the creator of the displayed image to lock / unlock or clear the screen. | ||
+ | |||
+ | string screenname = " | ||
+ | string sound = ""; | ||
+ | float soundvol = 1; //Volume of the sound specified above, can be anything between 0 and 1. | ||
+ | |||
+ | // -------- Script: -------- | ||
+ | // Modify anything below if you are a scripter and want to change something else in the script. | ||
+ | |||
+ | string ScriptName; | ||
+ | string InvName; | ||
+ | string InvCreator; | ||
+ | string Toucher; | ||
+ | |||
+ | string Blank = " | ||
+ | integer CmdChan = 9945; //System channel for llDialog. | ||
+ | |||
+ | default | ||
+ | { | ||
+ | state_entry() | ||
+ | { | ||
+ | ScriptName = llGetScriptName(); | ||
+ | llPreloadSound(sound); | ||
+ | if(text == 2) //Set texture to blank when names are used to avoid images with no names between script restarts. | ||
+ | { | ||
+ | llSetTexture(Blank, | ||
+ | llPlaySound(sound, | ||
+ | } | ||
+ | else if(text != 1 | text != 2) | ||
+ | { | ||
+ | llSetText("", | ||
+ | } | ||
+ | |||
+ | if(lockdefault == TRUE) | ||
+ | { | ||
+ | state locked; | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | state unlocked; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | state locked | ||
+ | { | ||
+ | state_entry() | ||
+ | { | ||
+ | llAllowInventoryDrop(0); | ||
+ | llListen(CmdChan, | ||
+ | if(notices == 1) | ||
+ | { | ||
+ | llSay(0, "The " + screenname + " is now locked." | ||
+ | } | ||
+ | |||
+ | if(text == 2 & InvName != "" | ||
+ | { | ||
+ | llSetText(" | ||
+ | } | ||
+ | else if(text == 1 | text == 2 & InvName == "" | ||
+ | { | ||
+ | llSetText(" | ||
+ | } | ||
+ | } | ||
+ | |||
+ | touch_start(integer avatar) | ||
+ | { | ||
+ | Toucher = llDetectedKey(0); | ||
+ | llSetTimerEvent(15); | ||
+ | if (Toucher == llGetOwner()) | ||
+ | { | ||
+ | llDialog(llDetectedKey(0) , "You are the owner of this screen. What do you wish to do?", [" | ||
+ | } | ||
+ | else if(lockonpost == TRUE & creatorlock == TRUE & llKey2Name(Toucher) == InvCreator) | ||
+ | { | ||
+ | llDialog(llDetectedKey(0) , "You have been identified as the creator of the currently posted image. What do you wish to do?", [" | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | llSay(0, "The " + screenname + " is locked. The owner must first unlock it before you can display new pictures." | ||
+ | } | ||
+ | } | ||
+ | |||
+ | listen(integer channel, string name, key id, string message) | ||
+ | { | ||
+ | if(Toucher == llGetOwner() | lockonpost == TRUE & creatorlock == TRUE & llKey2Name(Toucher) == InvCreator) | ||
+ | { | ||
+ | Toucher = ""; | ||
+ | if(llToLower(message) == " | ||
+ | { | ||
+ | state unlocked; | ||
+ | } | ||
+ | if(llToLower(message) == " | ||
+ | { | ||
+ | llSetTexture(Blank, | ||
+ | llPlaySound(sound, | ||
+ | InvName = ""; | ||
+ | InvCreator = ""; | ||
+ | if(lockdefault == TRUE) | ||
+ | { | ||
+ | llSetText(" | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | state unlocked; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | timer() | ||
+ | { | ||
+ | Toucher = ""; | ||
+ | llSetTimerEvent(0); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | state unlocked | ||
+ | { | ||
+ | state_entry() | ||
+ | { | ||
+ | llAllowInventoryDrop(1); | ||
+ | llListen(CmdChan, | ||
+ | if(notices == 1) | ||
+ | { | ||
+ | llSay(0, "The " + screenname + " is now unlocked." | ||
+ | } | ||
+ | |||
+ | if(text == 2 & InvName != "" | ||
+ | { | ||
+ | llSetText(" | ||
+ | } | ||
+ | else if(text == 1 | text == 2 & InvName == "" | ||
+ | { | ||
+ | llSetText(" | ||
+ | } | ||
+ | } | ||
+ | |||
+ | changed(integer mask) | ||
+ | { | ||
+ | if(mask & (CHANGED_ALLOWED_DROP | CHANGED_INVENTORY)) | ||
+ | { | ||
+ | if(llGetInventoryNumber(0)) //Texture dropped | ||
+ | { | ||
+ | InvName = llGetInventoryName(INVENTORY_TEXTURE, | ||
+ | key InvKey = llGetInventoryKey(InvName); | ||
+ | InvCreator = llKey2Name(llGetInventoryCreator(InvName)); | ||
+ | llRemoveInventory(InvName); | ||
+ | llSetTexture(InvKey, | ||
+ | llPlaySound(sound, | ||
+ | if(lockonpost == TRUE) | ||
+ | { | ||
+ | state locked; | ||
+ | } | ||
+ | else if(text == 2) | ||
+ | { | ||
+ | llSetText(" | ||
+ | } | ||
+ | } | ||
+ | else //Something else dropped | ||
+ | { | ||
+ | integer Items = llGetInventoryNumber(-1); | ||
+ | do | ||
+ | { | ||
+ | string InvName = llGetInventoryName(INVENTORY_ALL, | ||
+ | if (InvName != ScriptName & InvName != sound) | ||
+ | { | ||
+ | llRemoveInventory(InvName); | ||
+ | if(notices == 1) | ||
+ | { | ||
+ | llSay(0, "Error - Only textures may be dropped inside the " + screenname + " | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | while(Items); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | touch_start(integer avatar) | ||
+ | { | ||
+ | Toucher = llDetectedKey(0); | ||
+ | llSetTimerEvent(15); | ||
+ | if (Toucher == llGetOwner()) | ||
+ | { | ||
+ | llDialog(llDetectedKey(0) , "You are the owner of this screen. What do you wish to do?", [" | ||
+ | } | ||
+ | else if(lockonpost == TRUE & creatorlock == TRUE & llKey2Name(Toucher) == InvCreator) | ||
+ | { | ||
+ | llDialog(llDetectedKey(0) , "You have been identified as the creator of the currently posted image. What do you wish to do?", [" | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | llSay(0, "The " + screenname + " is unlocked. Control + drag textures onto it to display them." | ||
+ | } | ||
+ | } | ||
+ | |||
+ | listen(integer channel, string name, key id, string message) | ||
+ | { | ||
+ | if(Toucher == llGetOwner() | lockonpost == TRUE & creatorlock == TRUE & llKey2Name(Toucher) == InvCreator) | ||
+ | { | ||
+ | Toucher = ""; | ||
+ | if(llToLower(message) == " | ||
+ | { | ||
+ | state locked; | ||
+ | } | ||
+ | if(llToLower(message) == " | ||
+ | { | ||
+ | llSetTexture(Blank, | ||
+ | llPlaySound(sound, | ||
+ | InvName = ""; | ||
+ | InvCreator = ""; | ||
+ | if(lockdefault == TRUE) | ||
+ | { | ||
+ | state locked; | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | llSetText(" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | timer() | ||
+ | { | ||
+ | Toucher = ""; | ||
+ | llSetTimerEvent(0); | ||
+ | } | ||
+ | } | ||
+ | </ | ||