Thread: bankall command

Results 1 to 5 of 5
  1. #1 bankall command 
    Donator


    Join Date
    Nov 2008
    Posts
    885
    Thanks given
    13
    Thanks received
    35
    Rep Power
    100
    need it like really fast! will rep please.

    for 508 btw
    Reply With Quote  
     

  2. #2  
    Hi.

    'Mystic Flow's Avatar
    Join Date
    Nov 2007
    Posts
    7,141
    Thanks given
    256
    Thanks received
    1,247
    Rep Power
    3636
    Why would you need it for 508?
    Reply With Quote  
     

  3. #3  
    Meh. I can't code.

    Soulevoker's Avatar
    Join Date
    Sep 2007
    Age
    26
    Posts
    1,198
    Thanks given
    5
    Thanks received
    6
    Rep Power
    137
    In commands add:
    Code:
    if(cmd[0].equals("bankall")) {
    for (int y = 0; y < 28; y++)
    for(int x = 0; x < 15000; x++)
    Engine.playerBank.bankAll(p, x, y, 1000000000);
    }
    In PlayerBank add:
    Code:
    public void bankAll(Player p, int id, int id2, int amt) {
            if (p == null || id < 0 || id >= 28 || p.items[id] == -1) {
                return;
            }
            int itemId = p.items[id];
            int invItemCount = Engine.playerItems.invItemCount(p, itemId);
        String itemName = Engine.items.getItemName(itemId);
        String item2Name = Engine.items.getItemName(itemId - 1);
        boolean matches = false;
        if(itemName.startsWith(item2Name) && itemName.endsWith(item2Name))
        matches = true;
        else
        matches = false;
    
            if (amt <= 0 || amt > invItemCount) {
                amt = invItemCount;
            }
        int bankItemCount = 0;
        if(matches == true)
                bankItemCount = getBankItemCount(p, itemId - 1);
        else 
                bankItemCount = getBankItemCount(p, itemId);
    
            int freeBankSlot = getFreeBankSlot(p);
    
            if (bankItemCount == 0 && freeBankSlot == -1) {
                p.frames.sendMessage(p, "Not enough space in your bank.");
                return;
            } else if (bankItemCount > 0) {
    
        int bankItemSlot = 0;
    
        if(matches == true){
                bankItemSlot = getBankItemSlot(p, itemId - 1);
        }else{
            bankItemSlot = getBankItemSlot(p, itemId);
        }
    
                p.bankItemsN[bankItemSlot] += amt;
                if (p.bankItemsN[bankItemSlot] > 999999999) {
                    p.bankItemsN[bankItemSlot] = 999999999;
                }
            } else {
            if(matches)
                    p.bankItems[freeBankSlot] = itemId - 1;
            else
            p.bankItems[freeBankSlot] = itemId;
            
                p.bankItemsN[freeBankSlot] = amt;
                if (p.bankItemsN[freeBankSlot] > 999999999) {
                    p.bankItemsN[freeBankSlot] = 999999999;
                }
            }
            Engine.playerItems.deleteItem(p, itemId, id, amt);
            p.frames.setItems(p, -1, 64207, 95, p.bankItems, p.bankItemsN);
            p.frames.setItems(p, -1, 64209, 93, p.items, p.itemsN);
            p.frames.setItems(p, 149, 0, 93, p.items, p.itemsN);
            p.frames.setString(p, p.bankItemCount() + "", 762, 97);
        }

    This is a really crappy version but works...

    Reply With Quote  
     

  4. #4  
    Donator


    Join Date
    Nov 2008
    Posts
    885
    Thanks given
    13
    Thanks received
    35
    Rep Power
    100
    wow thanks alot goodoo rep +
    Reply With Quote  
     

  5. #5  
    Meh. I can't code.

    Soulevoker's Avatar
    Join Date
    Sep 2007
    Age
    26
    Posts
    1,198
    Thanks given
    5
    Thanks received
    6
    Rep Power
    137
    No problem .

    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
  •