Purpose : to add a anti duping for a certain item and setting max amount of it
Difficulty : 1/10
Base : None
Credits : me?
Step 1 open up client.java and add this under client extends player implements runnable {
Code:
public int AntiDupe = 500;//Check AntiDupe
and this
Code:
public void AntiDupe(){
AntiDupe = 50;
for(int i = 0; i < playerBankSize; i++) {// Check bank for item
if(bankItems[i] == 1042) {
if(bankItemsN[i] >= 10){ // Setting max amount of item 10 atm
bankItems[i] = 1042; // Item ID , replaces item with lower value with same or diff item
bankItemsN[i] = 5;// Item value that you get instead of old value
}
}
}
for(int i2 = 0; i2 < playerItems.length; i2++) {//Check inv for item
if(playerItems[i2] == 566) { // Check Item ID
if(playerItemsN[i2] >= 5001){ //Max item value , if overrided replace by..
int newamount = playerItemsN[i2];//Replaces item
deleteItem(1042, getItemSlot(1042), playerItemsN[i2]);//Deletes old item
addItem(1042, 5);//... This item + value
}
}
}
You might want to add AntiDupe(); in your process to scan the item every 500ms.
Done , explanation behind lines so you cant possibly mess up.