Advertisement
Dorex

Untitled

Jan 17th, 2024
1,354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. list previousItems = [
  3.                         "Name1","Name2","Name3"
  4.                     ];
  5.  
  6. list currentItems =  [
  7.                         "Name1","Name3","Name4", "Name5"
  8.                     ];                
  9. default
  10. {
  11.  
  12.     touch_start(integer total_number)
  13.     {
  14.         list addedItems;
  15.         list removedItems;
  16.  
  17.         integer index;
  18.         for (; index < llGetListLength(currentItems); ++index){
  19.             if (!~llListFindList(previousItems, (list)llList2String(currentItems, index))){
  20.                 addedItems += llList2String(currentItems, index);
  21.             }
  22.         }
  23.         llOwnerSay("Items added: " + llDumpList2String(addedItems, ","));
  24.  
  25.         index = 0;
  26.         for (; index < llGetListLength(previousItems); ++index){
  27.             if (!~llListFindList(currentItems, (list)llList2String(previousItems, index))){
  28.                 removedItems += llList2String(previousItems, index);
  29.             }
  30.         }
  31.  
  32.         llOwnerSay("Items removed: " + llDumpList2String(removedItems, ","));
  33.  
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement