[Release] @clearslot Command ! Clears item inventory slot ! *Updated* v55 & v59

Experienced Elementalist
Joined
Jul 26, 2008
Messages
280
Reaction score
0
[Release] @clearslot Command ! Clears item inventory slot ! *Updated* v55

*Edited* I have rewritten this command script because some fucktards thought I copied it without any knowledge about anything. Here is some proof that I actually did this and I know what I'm doing. In your face HonorMs. Some credits to DavidKun for the original version of this.

For v55
Open commandprocessor.java and add this import if you don't have it.
Code:
import net.sf.odinms.client.MapleInventoryType;
Then, in commandprocessor.java, Ctrl + F and find
Code:
} else if (splitted[0].equals("@helpwith")) {
Above it add.
PHP:
} else if (splitted[0].equals("@clearslot")) {
        if (splitted.length < 2) {
        mc.dropMessage("eq, use, setup, etc, cash.");
}          
        int x = 0;
    if (splitted[1].equals("all")) {
        while (x < 101) {
    if (c.getPlayer().getInventory(MapleInventoryType.EQUIP).getItem((byte) x) == null)
            x++;
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.EQUIP, (byte) x, c.getPlayer().getInventory(MapleInventoryType.EQUIP).getItem((byte) x).getQuantity(), false, true);
}
        while (x < 101) {
    if (c.getPlayer().getInventory(MapleInventoryType.USE).getItem((byte) x) == null)
            x++;
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.USE, (byte) x, c.getPlayer().getInventory(MapleInventoryType.USE).getItem((byte) x).getQuantity(), false, true);
}
        while (x < 101) {
    if (c.getPlayer().getInventory(MapleInventoryType.SETUP).getItem((byte) x) == null)
            x++;
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.SETUP, (byte) x, c.getPlayer().getInventory(MapleInventoryType.SETUP).getItem((byte) x).getQuantity(), false, true);
}
        while (x < 101) {
    if (c.getPlayer().getInventory(MapleInventoryType.ETC).getItem((byte) x) == null)
            x++;
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.ETC, (byte) x, c.getPlayer().getInventory(MapleInventoryType.ETC).getItem((byte) x).getQuantity(), false, true);
}
        while (x < 101) {
    if (c.getPlayer().getInventory(MapleInventoryType.CASH).getItem((byte) x) == null)
            x++;
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.CASH, (byte) x, c.getPlayer().getInventory(MapleInventoryType.CASH).getItem((byte) x).getQuantity(), false, true);
}        
                        mc.dropMessage("All slots cleared.");                             
                        
    } else if (splitted[1].equals("eq")) {
        while (x < 101) {
    if (c.getPlayer().getInventory(MapleInventoryType.EQUIP).getItem((byte) x) == null)
            x++;
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.EQUIP, (byte) x, c.getPlayer().getInventory(MapleInventoryType.EQUIP).getItem((byte) x).getQuantity(), false, true);
}        
                        mc.dropMessage("Eq inventory slots cleared.");                          
                        
    } else if (splitted[1].equals("use")) {
        while (x < 101) {
    if (c.getPlayer().getInventory(MapleInventoryType.USE).getItem((byte) x) == null)
            x++;
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.USE, (byte) x, c.getPlayer().getInventory(MapleInventoryType.USE).getItem((byte) x).getQuantity(), false, true);
}        
                        mc.dropMessage("Use inventory slots cleared.");                           
                        
    } else if (splitted[1].equals("setup")) {
        while (x < 101) {
    if (c.getPlayer().getInventory(MapleInventoryType.SETUP).getItem((byte) x) == null)
            x++;
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.SETUP, (byte) x, c.getPlayer().getInventory(MapleInventoryType.SETUP).getItem((byte) x).getQuantity(), false, true);
}        
                        mc.dropMessage("Setup inventory slots cleared.");                           
                        
    } else if (splitted[1].equals("etc")) {
        while (x < 101) {
    if (c.getPlayer().getInventory(MapleInventoryType.ETC).getItem((byte) x) == null)
            x++;
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.ETC, (byte) x, c.getPlayer().getInventory(MapleInventoryType.ETC).getItem((byte) x).getQuantity(), false, true);
}        
                        mc.dropMessage("Etc inventory slots cleared.");                           
                        
    } else if (splitted[1].equals("cash")) {
        while (x < 101) {
    if (c.getPlayer().getInventory(MapleInventoryType.CASH).getItem((byte) x) == null)
            x++;
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.CASH, (byte) x, c.getPlayer().getInventory(MapleInventoryType.CASH).getItem((byte) x).getQuantity(), false, true);
}
                        mc.dropMessage("Cash inventory slots cleared.");
                                                
        } else { 
        mc.dropMessage("@clearslot " + splitted[1] + " does not exist!");
}
HonorMs, if you have eyes open it now and compare "your" script with mine.
Here's DavidKun's script. Which HonorMs claimed to have made.
PHP:
else if (splitted[0].equals("!clearinvent")) {
                        if (splitted.length < 2) {
                throw new IllegalCommandSyntaxException(2);
            }          
                        String type = splitted[1];
                        if (type.equals("all")) {
                                for (int i = 0; i < 101; i++) {
                                        IItem tempItem = c.getPlayer().getInventory(MapleInventoryType.EQUIP).getItem((byte) i);
                                        if (tempItem == null)
                                                continue;
                                        MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.EQUIP, (byte) i, tempItem.getQuantity(), false, true);
                                }
                                for (int i = 0; i < 101; i++) {
                                        IItem tempItem = c.getPlayer().getInventory(MapleInventoryType.USE).getItem((byte) i);
                                        if (tempItem == null)
                                                continue;
                                        MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.USE, (byte) i, tempItem.getQuantity(), false, true);
                                }
                                for (int i = 0; i < 101; i++) {
                                        IItem tempItem = c.getPlayer().getInventory(MapleInventoryType.ETC).getItem((byte) i);
                                        if (tempItem == null)
                                                continue;
                                        MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.ETC, (byte) i, tempItem.getQuantity(), false, true);
                                }
                                for (int i = 0; i < 101; i++) {
                                        IItem tempItem = c.getPlayer().getInventory(MapleInventoryType.SETUP).getItem((byte) i);
                                        if (tempItem == null)
                                                continue;
                                        MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.SETUP, (byte) i, tempItem.getQuantity(), false, true);
                                } 
                                for (int i = 0; i < 101; i++) {
                                        IItem tempItem = c.getPlayer().getInventory(MapleInventoryType.CASH).getItem((byte) i);
                                        if (tempItem == null)
                                                continue;
                                        MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.CASH, (byte) i, tempItem.getQuantity(), false, true);
                                }                                 
                        }
                        else if (type.equals("equip")) {
                                for (int i = 0; i < 101; i++) {
                                        IItem tempItem = c.getPlayer().getInventory(MapleInventoryType.EQUIP).getItem((byte) i);
                                        if (tempItem == null)
                                                continue;
                                        MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.EQUIP, (byte) i, tempItem.getQuantity(), false, true);
                                }                           
                        }
                        else if (type.equals("use")) {
                                for (int i = 0; i < 101; i++) {
                                        IItem tempItem = c.getPlayer().getInventory(MapleInventoryType.USE).getItem((byte) i);
                                        if (tempItem == null)
                                                continue;
                                        MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.USE, (byte) i, tempItem.getQuantity(), false, true);
                                }                           
                        }
                        else if (type.equals("etc")) {
                                for (int i = 0; i < 101; i++) {
                                        IItem tempItem = c.getPlayer().getInventory(MapleInventoryType.ETC).getItem((byte) i);
                                        if (tempItem == null)
                                                continue;
                                        MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.ETC, (byte) i, tempItem.getQuantity(), false, true);
                                }                           
                        }
                        else if (type.equals("etc")) {
                                for (int i = 0; i < 101; i++) {
                                        IItem tempItem = c.getPlayer().getInventory(MapleInventoryType.SETUP).getItem((byte) i);
                                        if (tempItem == null)
                                                continue;
                                        MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.SETUP, (byte) i, tempItem.getQuantity(), false, true);
                                }                           
                        }
                        else if (type.equals("cash")) {
                                for (int i = 0; i < 101; i++) {
                                        IItem tempItem = c.getPlayer().getInventory(MapleInventoryType.CASH).getItem((byte) i);
                                        if (tempItem == null)
                                                continue;
                                        MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.CASH, (byte) i, tempItem.getQuantity(), false, true);
                                }                           
                        }                        
                        else mc.dropMessage("!clearinvent " + type + " does not exist!");
        }                   
    }
If you can't tell the difference between mine and his, please go and join the blind.
This is not ur release... i released this on OdinTeh so u might aswell give me and DavidKun Credits..

Freakin biggest leecher ever AND HOW IS IT UR RELEASE u freakin noob u just changed my release From ! to @ WoW Seriously NOOOOOB~
 
Last edited:
Re: [Release] @clearslot Command ! Clears item inventory slot !

its good how u made ur own costume commands i want to know how to make some my slef any guids?
@shajal Learn java.
Forgot to add in the description @clearslot all for people who can't read from the script.
Edit * Added.
 
Re: [Release] @clearslot Command ! Clears item inventory slot !

erm my throw new IllegalCommandSyntaxException(2);
has the red underline thingy. It says cannot find symbol blah blah blah
 
Re: [Release] @clearslot Command ! Clears item inventory slot !

Just remove that line o.o I tried removing but haven't got the time to test it :P
 
Re: [Release] @clearslot Command ! Clears item inventory slot !

Oops I forgot to add something hold on i'll update it.
*Edit* Updated. If it still doesn't work then just remove it. Works fine without it.
 
Re: [Release] @clearslot Command ! Clears item inventory slot ! *Updated*

OH damm, its nice, now we dun have to drop items 1 by 1 XD
 
Re: [Release] @clearslot Command ! Clears item inventory slot ! *Updated*

It throws an exception (error) when splitted.length < 2
 
Re: [Release] @clearslot Command ! Clears item inventory slot ! *Updated*

this command work in 0.59. tested it.
you just need to place that @clearslot function into PlayerCommands.java to work.
and also need to define both the IItem and MapleInventoryManipulator.

but isnt this abit dangerous?
what if someone hacked into their account and use this command to wipe out all the victim items. Any ways to just clear the 1st row of the item slot instead of clearing the whole thingy ??

EDIT: forget what i said above about the dangerous thingy. I realize i can change that ==, guess i was too sleepy to read the code properly.. LOL
 
Re: [Release] @clearslot Command ! Clears item inventory slot ! *Updated*

YAAAAAAY!
Finally omg,
thanks thanks thanks!
Dude you don't know how annoying it is when stupid noob GMs drops those, bugged items,
when you get them in ur inventory, they are transparent, and when you click them, you like, crashes?
And this will solve it,
HUGE THANKS!
Next update will forsure be
@clear Misc/CASH/Equip
 
Back