Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //moneyLimit = 500
- //Set that in the onload script!
- if(pinv.getItemInSlot(35) != null)
- {
- if(pinv.getItemInSlot(35).getItemID() != 353)
- {
- for(i=0;i<35;i++)
- {
- if(pinv.getItemInSlot(i) == null)
- {
- var pitem = pinv.getItemInSlot(35).copy();
- pinv.emptySlot(35);
- pinv.setSlot(i, item);
- }
- }
- }
- }
- if (pinv.getSlotContainingItem(353) != -1)
- {
- if (pinv.getSlotContainingItem(353) != 35)
- {
- try
- {
- var count = pinv.getItemInSlot(35).getQuantity();
- }
- catch(e) { var count = 0; }
- var item = pinv.getItemInSlot(pinv.getSlotContainingItem(353)).copy();
- pinv.emptySlot(pinv.getSlotContainingItem(353));
- if (count < limit)
- {
- if (item.getQuantity() + count <= moneyLimit)
- {
- item.setQuantity(item.getQuantity() + count);
- }
- else
- {
- item.setQuantity(moneyLimit);
- }
- }
- else
- {
- item.setQuantity(moneyLimit);
- }
- pinv.setSlot(35, item);
- }
- pinv.getItemInSlot(35).setDamage(pinv.getItemInSlot(35).getQuantity());
- }
Add Comment
Please, Sign In to add comment