1. sorted

2. What's going on here?

does this not return the amount already?
Code:
player.getInventory().getAmount(5023)

3. Originally Posted by NeilG
What's going on here?

does this not return the amount already?
Code:
player.getInventory().getAmount(5023)
Nah this works fine i just need to find out how to do this all command line but in reverse

if(itemId == 5022) {
int amount = 0;

for(int i = 0; i < player.getInventory().getAmount(5022); i++) {
amount++;
}
player.getInventory().delete(5022,1000000);
}

this is what im trying to do but it does not want to work properly cuz even if i have 1x 5022 it will give me 1x 5023

4. look up the modulo operator

5. So you are looping a amount to check for an amount? Seems like you need to fix your logic.
Spoiler for Spoiler:

Code:
if(itemId == 5022) {
int amount = player.getInventory().getAmount(5022) / 1000000;
player.getInventory().delete(5022,amount *1000000);
}

6. Originally Posted by Arch337
So you are looping a amount to check for an amount? Seems like you need to fix your logic.
Spoiler for Spoiler:

Code:
if(itemId == 5022) {
int amount = player.getInventory().getAmount(5022) / 1000000;
player.getInventory().delete(5022,amount *1000000);
}
ok bud

7. Originally Posted by koska
Nah this works fine i just need to find out how to do this all command line but in reverse
Yeah it works, but it makes no sense
you already have the amount figured out, so you're counting up from 0 to the amount to figure out the amount.

8. Originally Posted by NeilG
Yeah it works, but it makes no sense
you already have the amount figured out, so you're counting up from 0 to the amount to figure out the amount.
Concerned helped i figgure it out ty

9. Code:
for(int i = 0; i <= player.getInventory().getAmount(5022); i++) {
if (i >= 1000000) {
if (i % 1000000 == 0)
amount++;
}
}

10. ## Thankful user:

11. Originally Posted by El Camino
Code:
for(int i = 0; i <= player.getInventory().getAmount(5022); i++) {
if (i >= 1000000) {
if (i % 1000000 == 0)
amount++;
}
}
Yep thats what i figgured big thanx

Page 1 of 2 12 Last