Advertisement
Sanwi

GetItem

Aug 17th, 2014
450
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. $${
  2.  
  3. // Looks in a chest for a specified item
  4. // It will prompt you for the item you're looking for, open the chest, and shift-click all of that item it finds into your inventory
  5.  
  6. set(@getitem);
  7.  
  8. #wait = 500
  9.  
  10. #newslot = %@#startlooking%
  11.  
  12. //Find a stack of of @&citem
  13. do;
  14. getslot("%@&citem%",@#citemslot,%#newslot%);
  15. getslotitem(%@#citemslot%,&cgotitem,#cstacksize);
  16. #newslot = (%@#citemslot%) + (1)
  17.  
  18. // If no item found
  19. if(%&cgotitem% != %@&citem%);
  20. set(@gotitemfail);
  21. unset(@getitem);
  22. stop();
  23. endif;
  24.  
  25. if(%@&stackrequired% = "false");
  26. break();
  27. endif;
  28. until(%#cstacksize% = %@#stacksize%);
  29.  
  30. //Place stack of @&citem in @#craftslot
  31. slotclick(%@#citemslot%);
  32. wait(%#wait%ms);
  33. slotclick(%@#craftslot%);
  34. wait(%#wait%ms);
  35.  
  36. unset(@getitem);
  37.  
  38. stop();
  39. }$$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement