Thread: Autobank?

Results 1 to 5 of 5
  1. #1 Autobank? 
    Boy Wonder


    Join Date
    Mar 2012
    Posts
    849
    Thanks given
    139
    Thanks received
    80
    Rep Power
    99
    Code:
    public void bankItemWithouthReq(int itemId, int amount) {
    		int toBankSlot = 0;
    		boolean alreadyInBank = false;
    		for (int i=700; i<Config.BANK_SIZE; i++) {
    			if (c.bankItems[i] == itemId + 1) {
    				alreadyInBank = true;
    				toBankSlot = i;
    				i=Config.BANK_SIZE+1;
    			}
    		}
    		while (amount > 0) {
    			if (alreadyInBank) {
    				c.bankItemsN[toBankSlot] += 1;
    				amount--;
    			} else {
    				c.bankItems[toBankSlot] = itemId + 1;
    				c.bankItemsN[toBankSlot] += 1;
    				amount--;
    			}	
    		}
    		resetTempItems();
    		resetBank();
    	}
    this is a method to automatically bank an item given but the problem is that it replaces and item in the slot i set it for. how can i make it so it automatically goes to the next available slot in the bank?
    Reply With Quote  
     

  2. #2  
    need java lessons
    Eclipse's Avatar
    Join Date
    Aug 2012
    Posts
    4,436
    Thanks given
    686
    Thanks received
    898
    Rep Power
    490
    Code:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    public void addItemToBank(int itemId, int amount) {
            for (int i = 0; i < Config.BANK_SIZE; i++) {
                if (c.bankItems[i] <= 0 || c.bankItems[i] == itemId + 1
                        && c.bankItemsN[i] + amount < Integer.MAX_VALUE) {
                    c.bankItems[i] = itemId + 1;
                    c.bankItemsN[i] += amount;
                    resetBank();
                    return;
                }
            }
        }

    Quote Originally Posted by jerryrocks317 View Post
    i am 14 and have my own laptop im on almost 24/7 currently creating rsps lol so please get off my thread lol
    Reply With Quote  
     

  3. #3  
    Boy Wonder


    Join Date
    Mar 2012
    Posts
    849
    Thanks given
    139
    Thanks received
    80
    Rep Power
    99
    Quote Originally Posted by Ninth Legion View Post
    Code:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    public void addItemToBank(int itemId, int amount) {
            for (int i = 0; i < Config.BANK_SIZE; i++) {
                if (c.bankItems[i] <= 0 || c.bankItems[i] == itemId + 1
                        && c.bankItemsN[i] + amount < Integer.MAX_VALUE) {
                    c.bankItems[i] = itemId + 1;
                    c.bankItemsN[i] += amount;
                    resetBank();
                    return;
                }
            }
        }
    can you please explain to me how this works? thanks btw it worked
    Reply With Quote  
     

  4. #4  
    need java lessons
    Eclipse's Avatar
    Join Date
    Aug 2012
    Posts
    4,436
    Thanks given
    686
    Thanks received
    898
    Rep Power
    490
    It adds the item to your bank with the ID you put by using the c.bankItrms method.

    Quote Originally Posted by jerryrocks317 View Post
    i am 14 and have my own laptop im on almost 24/7 currently creating rsps lol so please get off my thread lol
    Reply With Quote  
     

  5. #5  
    Boy Wonder


    Join Date
    Mar 2012
    Posts
    849
    Thanks given
    139
    Thanks received
    80
    Rep Power
    99
    oh i think i get it now thanks man
    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

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •