Created
July 10, 2011 22:40
-
-
Save Pwootage/1075053 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment