All pastes #270750 Raw Edit

Anonymous

public java v1 · immutable
·published 2006-12-07 18:07 UTC
rendered paste body
    /**     * By Miss Silabsoft     *      * @param invSlot     *            A inventory slot 1-28;     * @return Number of items in the stack     */    public int getInventoryStackSize(int invSlot) {        if (itemExist(invSlot)) {            Rectangle stackSlot = Info.getInventoryStackRectangle(invSlot);            String ocr = getTextInBounds(getColorArray2d(), stackSlot,                    new RGB(255, 255, 0), "CharsTrade", 1, 1, 1);            try {                if (ocr.length() > 0) {                    int size = Integer.parseInt(ocr);                    if (size > 0) {                        return size;                    }                }            } catch (ParseException e) {                exception(e);            }            return 1;        }        return 0;    }