Guest User

Untitled

a guest
Feb 18th, 2018
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. //moneyLimit = 500
  2. //Set that in the onload script!
  3.  
  4. if(pinv.getItemInSlot(35) != null)
  5. {
  6. if(pinv.getItemInSlot(35).getItemID() != 353)
  7. {
  8. for(i=0;i<35;i++)
  9. {
  10. if(pinv.getItemInSlot(i) == null)
  11. {
  12. var pitem = pinv.getItemInSlot(35).copy();
  13. pinv.emptySlot(35);
  14. pinv.setSlot(i, item);
  15. }
  16. }
  17. }
  18. }
  19. if (pinv.getSlotContainingItem(353) != -1)
  20. {
  21. if (pinv.getSlotContainingItem(353) != 35)
  22. {
  23. try
  24. {
  25. var count = pinv.getItemInSlot(35).getQuantity();
  26. }
  27. catch(e) { var count = 0; }
  28. var item = pinv.getItemInSlot(pinv.getSlotContainingItem(353)).copy();
  29. pinv.emptySlot(pinv.getSlotContainingItem(353));
  30. if (count < limit)
  31. {
  32. if (item.getQuantity() + count <= moneyLimit)
  33. {
  34. item.setQuantity(item.getQuantity() + count);
  35. }
  36. else
  37. {
  38. item.setQuantity(moneyLimit);
  39. }
  40. }
  41. else
  42. {
  43. item.setQuantity(moneyLimit);
  44. }
  45. pinv.setSlot(35, item);
  46. }
  47. pinv.getItemInSlot(35).setDamage(pinv.getItemInSlot(35).getQuantity());
  48. }
Add Comment
Please, Sign In to add comment