Thread: Bank Inventory Turns Bank Gray

Results 1 to 9 of 9
  1. #1 Bank Inventory Turns Bank Gray 
    Registered Member
    Grant_'s Avatar
    Join Date
    Aug 2014
    Posts
    495
    Thanks given
    96
    Thanks received
    109
    Rep Power
    136
    Hello r-s community. I seem to be having issues with my bank inventory button. Its only now started acting up but I'm not sure what i did to make it like this.

    Basically when you click the button it puts the items in the bank and then show it as being empty at the end. When you reopen the bank your items from your inventory are banked and its like nothing was wrong.

    Here's a gif:


    Will rep if able to fix! Thanks - Grant
    Attached image
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Jun 2015
    Posts
    45
    Thanks given
    2
    Thanks received
    5
    Rep Power
    10
    I guess interface or items isnt being updated. In ClickingButtons (Assuming your using PI lol) look for case for button Id and make it update items. theres a method for that i believe
    Reply With Quote  
     

  3. #3  
    Donator
    Darkness's Avatar
    Join Date
    Nov 2012
    Age
    26
    Posts
    876
    Thanks given
    121
    Thanks received
    75
    Rep Power
    47
    Code:
    		case 82020: // Deposit Inventory
    			for (int i = 0; i < c.playerItems.length; i++) {
    				c.getItems().bankItem(c.playerItems[i], i, c.playerItemsN[i]);
    			}
    			break;
    Works for me, but post yours, in clickingbuttons, maybe we can help
    Attached image
    Reply With Quote  
     

  4. #4  
    Registered Member
    Grant_'s Avatar
    Join Date
    Aug 2014
    Posts
    495
    Thanks given
    96
    Thanks received
    109
    Rep Power
    136
    Quote Originally Posted by Robin H View Post
    Code:
    		case 82020: // Deposit Inventory
    			for (int i = 0; i < c.playerItems.length; i++) {
    				c.getItems().bankItem(c.playerItems[i], i, c.playerItemsN[i]);
    			}
    			break;
    Works for me, but post yours, in clickingbuttons, maybe we can help
    Should of posted the code to begin with my bad

    Code:
    case 89223: //Deposit Inventory
    for(int i = 0; i < c.playerItems.length; i++) {
    	c.getItems().bankItem(c.playerItems[i], i,c.playerItemsN[i]);
    }
    		break;
    Attached image
    Reply With Quote  
     

  5. #5  
    Donator
    Darkness's Avatar
    Join Date
    Nov 2012
    Age
    26
    Posts
    876
    Thanks given
    121
    Thanks received
    75
    Rep Power
    47
    Quote Originally Posted by Grant_ View Post
    Should of posted the code to begin with my bad

    Code:
    case 89223: //Deposit Inventory
    for(int i = 0; i < c.playerItems.length; i++) {
    	c.getItems().bankItem(c.playerItems[i], i,c.playerItemsN[i]);
    }
    		break;
    Considering we have the same code it'd be good to check your bankItem, I guess
    Attached image
    Reply With Quote  
     

  6. #6  
    48 0x69

    Pax M's Avatar
    Join Date
    Oct 2013
    Posts
    2,008
    Thanks given
    36
    Thanks received
    488
    Rep Power
    2270
    Update the bank .
    Reply With Quote  
     

  7. #7  
    Donator

    Join Date
    Dec 2014
    Posts
    289
    Thanks given
    160
    Thanks received
    56
    Rep Power
    37
    Post your bankitem method.
    Reply With Quote  
     

  8. #8  
    Rune-Server Affiliate N0VA's Avatar
    Join Date
    Feb 2015
    Posts
    645
    Thanks given
    102
    Thanks received
    144
    Rep Power
    9
    Post the method you have for it.
    Reply With Quote  
     

  9. #9  
    Registered Member
    Grant_'s Avatar
    Join Date
    Aug 2014
    Posts
    495
    Thanks given
    96
    Thanks received
    109
    Rep Power
    136
    Quote Originally Posted by xNova View Post
    Post the method you have for it.
    Quote Originally Posted by mikey96 View Post
    Post your bankitem method.
    Code:
    public boolean bankItem(int itemID, int fromSlot, int amount, int[] array,
    			int[] arrayN) {
    		if (c.inTrade) {
    			c.sendMessage("You can't store items while trading!");
    			return false;
    		}
    		if (c.playerItems[fromSlot] <= 0 || c.playerItemsN[fromSlot] <= 0) {
    			return false;
    		}
    		if (!Item.itemIsNote[c.playerItems[fromSlot] - 1]) {
    			if (c.playerItems[fromSlot] <= 0) {
    				return false;
    			}
    			if (Item.itemStackable[c.playerItems[fromSlot] - 1]
    					|| c.playerItemsN[fromSlot] > 1) {
    				int toBankSlot = 0;
    				boolean alreadyInBank = false;
    				for (int i = 0; i < Config.BANK_SIZE; i++) {
    					if (array[i] == c.playerItems[fromSlot]) {
    						if (c.playerItemsN[fromSlot] < amount)
    							amount = c.playerItemsN[fromSlot];
    						alreadyInBank = true;
    						toBankSlot = i;
    						i = Config.BANK_SIZE + 1;
    					}
    				}
    
    				if (!alreadyInBank && freeBankSlots() > 0) {
    					for (int i = 0; i < Config.BANK_SIZE; i++) {
    						if (array[i] <= 0) {
    							toBankSlot = i;
    							i = Config.BANK_SIZE + 1;
    						}
    					}
    					array[toBankSlot] = c.playerItems[fromSlot];
    					if (c.playerItemsN[fromSlot] < amount) {
    						amount = c.playerItemsN[fromSlot];
    					}
    					if ((arrayN[toBankSlot] + amount) <= Config.MAXITEM_AMOUNT
    							&& (arrayN[toBankSlot] + amount) > -1) {
    						arrayN[toBankSlot] += amount;
    					} else {
    						c.sendMessage("Bank full!");
    						return false;
    					}
    					deleteItem((c.playerItems[fromSlot] - 1), fromSlot, amount);
    					resetBank();
    					return true;
    				} else if (alreadyInBank) {
    					if ((arrayN[toBankSlot] + amount) <= Config.MAXITEM_AMOUNT
    							&& (arrayN[toBankSlot] + amount) > -1) {
    						arrayN[toBankSlot] += amount;
    					} else {
    						c.sendMessage("Bank full!");
    						return false;
    					}
    					deleteItem((c.playerItems[fromSlot] - 1), fromSlot, amount);
    					resetBank();
    					return true;
    				} else {
    					c.sendMessage("Bank full!");
    					return false;
    				}
    			} else {
    				itemID = c.playerItems[fromSlot];
    				int toBankSlot = 0;
    				boolean alreadyInBank = false;
    				for (int i = 0; i < Config.BANK_SIZE; i++) {
    					if (array[i] == c.playerItems[fromSlot]) {
    						alreadyInBank = true;
    						toBankSlot = i;
    						i = Config.BANK_SIZE + 1;
    					}
    				}
    				if (!alreadyInBank && freeBankSlots() > 0) {
    					for (int i = 0; i < Config.BANK_SIZE; i++) {
    						if (array[i] <= 0) {
    							toBankSlot = i;
    							i = Config.BANK_SIZE + 1;
    						}
    					}
    					int firstPossibleSlot = 0;
    					boolean itemExists = false;
    					while (amount > 0) {
    						itemExists = false;
    						for (int i = firstPossibleSlot; i < c.playerItems.length; i++) {
    							if ((c.playerItems[i]) == itemID) {
    								firstPossibleSlot = i;
    								itemExists = true;
    								i = 30;
    							}
    						}
    						if (itemExists) {
    							array[toBankSlot] = c.playerItems[firstPossibleSlot];
    							arrayN[toBankSlot] += 1;
    							deleteItem((c.playerItems[firstPossibleSlot] - 1),
    									firstPossibleSlot, 1);
    							amount--;
    						} else {
    							amount = 0;
    						}
    					}
    					resetBank();
    					return true;
    				} else if (alreadyInBank) {
    					int firstPossibleSlot = 0;
    					boolean itemExists = false;
    					while (amount > 0) {
    						itemExists = false;
    						for (int i = firstPossibleSlot; i < c.playerItems.length; i++) {
    							if ((c.playerItems[i]) == itemID) {
    								firstPossibleSlot = i;
    								itemExists = true;
    								i = 30;
    							}
    						}
    						if (itemExists) {
    							arrayN[toBankSlot] += 1;
    							deleteItem((c.playerItems[firstPossibleSlot] - 1),
    									firstPossibleSlot, 1);
    							amount--;
    						} else {
    							amount = 0;
    						}
    					}
    					resetBank();
    					return true;
    				} else {
    					c.sendMessage("Bank full!");
    					return false;
    				}
    			}
    		} else if (Item.itemIsNote[c.playerItems[fromSlot] - 1]
    				&& !Item.itemIsNote[c.playerItems[fromSlot] - 2]) {
    			if (c.playerItems[fromSlot] <= 0) {
    				return false;
    			}
    			if (Item.itemStackable[c.playerItems[fromSlot] - 1]
    					|| c.playerItemsN[fromSlot] > 1) {
    				int toBankSlot = 0;
    				boolean alreadyInBank = false;
    				for (int i = 0; i < Config.BANK_SIZE; i++) {
    					if (array[i] == (c.playerItems[fromSlot] - 1)) {
    						if (c.playerItemsN[fromSlot] < amount)
    							amount = c.playerItemsN[fromSlot];
    						alreadyInBank = true;
    						toBankSlot = i;
    						i = Config.BANK_SIZE + 1;
    					}
    				}
    
    				if (!alreadyInBank && freeBankSlots() > 0) {
    					for (int i = 0; i < Config.BANK_SIZE; i++) {
    						if (array[i] <= 0) {
    							toBankSlot = i;
    							i = Config.BANK_SIZE + 1;
    						}
    					}
    					array[toBankSlot] = (c.playerItems[fromSlot] - 1);
    					if (c.playerItemsN[fromSlot] < amount) {
    						amount = c.playerItemsN[fromSlot];
    					}
    					if ((arrayN[toBankSlot] + amount) <= Config.MAXITEM_AMOUNT
    							&& (arrayN[toBankSlot] + amount) > -1) {
    						arrayN[toBankSlot] += amount;
    					} else {
    						return false;
    					}
    					deleteItem((c.playerItems[fromSlot] - 1), fromSlot, amount);
    					resetBank();
    					return true;
    				} else if (alreadyInBank) {
    					if ((arrayN[toBankSlot] + amount) <= Config.MAXITEM_AMOUNT
    							&& (arrayN[toBankSlot] + amount) > -1) {
    						arrayN[toBankSlot] += amount;
    					} else {
    						return false;
    					}
    					deleteItem((c.playerItems[fromSlot] - 1), fromSlot, amount);
    					resetBank();
    					return true;
    				} else {
    					c.sendMessage("Bank full!");
    					return false;
    				}
    			} else {
    				itemID = c.playerItems[fromSlot];
    				int toBankSlot = 0;
    				boolean alreadyInBank = false;
    				for (int i = 0; i < Config.BANK_SIZE; i++) {
    					if (array[i] == (c.playerItems[fromSlot] - 1)) {
    						alreadyInBank = true;
    						toBankSlot = i;
    						i = Config.BANK_SIZE + 1;
    					}
    				}
    				if (!alreadyInBank && freeBankSlots() > 0) {
    					for (int i = 0; i < Config.BANK_SIZE; i++) {
    						if (array[i] <= 0) {
    							toBankSlot = i;
    							i = Config.BANK_SIZE + 1;
    						}
    					}
    					int firstPossibleSlot = 0;
    					boolean itemExists = false;
    					while (amount > 0) {
    						itemExists = false;
    						for (int i = firstPossibleSlot; i < c.playerItems.length; i++) {
    							if ((c.playerItems[i]) == itemID) {
    								firstPossibleSlot = i;
    								itemExists = true;
    								i = 30;
    							}
    						}
    						if (itemExists) {
    							array[toBankSlot] = (c.playerItems[firstPossibleSlot] - 1);
    							arrayN[toBankSlot] += 1;
    							deleteItem((c.playerItems[firstPossibleSlot] - 1),
    									firstPossibleSlot, 1);
    							amount--;
    						} else {
    							amount = 0;
    						}
    					}
    					resetTempItems();
    					resetBank();
    					return true;
    				} else if (alreadyInBank) {
    					int firstPossibleSlot = 0;
    					boolean itemExists = false;
    					while (amount > 0) {
    						itemExists = false;
    						for (int i = firstPossibleSlot; i < c.playerItems.length; i++) {
    							if ((c.playerItems[i]) == itemID) {
    								firstPossibleSlot = i;
    								itemExists = true;
    								i = 30;
    							}
    						}
    						if (itemExists) {
    							arrayN[toBankSlot] += 1;
    							deleteItem((c.playerItems[firstPossibleSlot] - 1),
    									firstPossibleSlot, 1);
    							amount--;
    						} else {
    							amount = 0;
    						}
    					}
    					resetTempItems();
    					resetBank();
    					return true;
    				} else {
    					c.sendMessage("Bank full!");
    					return false;
    				}
    			}
    		} else {
    			c.sendMessage("Item not supported " + (c.playerItems[fromSlot] - 1));
    			return false;
    		}
    	}
    Sorry for the wait ive been busy. Idk if this helps. I might just need an updateBank() method.
    Attached image
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [PI] Bank Inventory Method
    By Hoodlum in forum Requests
    Replies: 3
    Last Post: 05-21-2011, 09:41 AM
  2. Replies: 7
    Last Post: 12-02-2010, 03:39 AM
  3. Inventory, and Bank Items don't save.
    By DestriX in forum Help
    Replies: 0
    Last Post: 09-28-2010, 07:36 AM
  4. Replies: 1
    Last Post: 08-19-2010, 12:36 AM
  5. Bank & Inventory Problems.
    By AndyJay in forum Help
    Replies: 5
    Last Post: 01-19-2009, 12:33 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •