Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $${
- // Open chest
- key(use);
- wait(500ms);
- // Log contents
- for(#forsearch,0,53);
- // look in slot
- getslotitem(%#forsearch%,&founditem,#cstacksize,#cmeta);
- // if item found...
- if(%&founditem% != "air");
- // If potion, get name from damage value
- if(%&founditem% = "potion");
- @#getpotionnamemetadata = %#cmeta%
- exec(getpotionname.txt,"getpotionname");
- wait(300ms);
- do;
- wait(10ms);
- while(@getpotionname);
- &founditem = %@&gotpotionname%
- endif;
- // check array for current item
- foreach(&chestlogarray,&carrayitem);
- // If item found in array...
- ifmatches(%&carrayitem%,"^\d (%&founditem%)$");
- set(founditeminarray);
- // Find item pos in array
- IndexOf(&chestlogarray,#index,%&carrayitem%)
- // Split current array var
- #arrayrecall[] = split(" ",%&chestlogarray[%#index%]%);
- // Add item stack to array
- #putstacksize = (%#arrayrecall[0]%) + (%#cstacksize%)
- // Set array var to new stack size
- &chestlogarray[%#index%] = "%#putstacksize% %&founditem%"
- endif;
- next;
- // If array contains item, add, else put new item in array
- if(founditeminarray);
- unset(founditeminarray);
- else;
- put(&chestlogarray,"%#cstacksize% %&founditem%");
- endif;
- endif;
- next;
- // Clear array
- foreach(&chestlogarray,&carrayitem);
- pop(&chestlogarray,&cpop);
- logto(chestlog.txt,"%&cpop%");
- next;
- gui();
- stop();
- }$$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement