Advertisement
salahzar

Simple Slide show for craft

Oct 30th, 2012
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // see https://www.youtube.com/watch?v=WSYoEe6ctWM for usage
  2. //           DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
  3. //                    Version 2, December 2004
  4. //
  5. // Copyright (C) 2017 Salahzar Stenvaag <[email protected]>
  6. //
  7. // Everyone is permitted to copy and distribute verbatim or modified
  8. // copies of this license document, and changing it is allowed as long
  9. // as the name is changed.
  10. //
  11. //            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
  12. //   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  13. //
  14. //  0. You just DO WHAT THE FUCK YOU WANT TO.
  15.  
  16. integer index;
  17.  
  18.  
  19. show()
  20. {
  21.     string t=llGetInventoryName(INVENTORY_TEXTURE,index);
  22.     llSetTexture(t, ALL_SIDES);
  23.     llSetText(t+"\n"+(string)(index+1)+" / "+(string)llGetInventoryNumber(INVENTORY_TEXTURE),<1,1,1>,1);
  24. }
  25.  
  26. default
  27. {
  28.    
  29.     state_entry()
  30.      
  31.    {
  32.        index=0;
  33.        show();
  34.     }    
  35.    
  36.     on_rez(integer Param) {
  37.         llResetScript();
  38.     }    
  39.    
  40.        
  41.    
  42.     touch_start(integer total_number)  {
  43.         if(llDetectedKey(0)!=llGetOwner()) return;
  44.         vector s=llDetectedTouchST(0);
  45.         if(s.x>0.5) index+=1; else index-=1;
  46.         integer number=llGetInventoryNumber(INVENTORY_TEXTURE);
  47.         if(index<0) index=number-1;
  48.         if(index>=number) index=0;
  49.         show();
  50.        
  51.     }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement