Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int x = 0;
- totalVal = 0;
- while (x < 29) {
- Item curItem = api.getInventory().getItemInSlot(x);
- api.log("Current item is " + curItem);
- if (curItem != null) {
- String valueItemName = curItem.getName();
- api.log("valueItemName is " + valueItemName);
- if (valueItemName.equals("Coins")) {
- api.log("Coins are a match");
- x = x + 1;
- MethodProvider.sleep(rnd3);
- }else if (!valueItemName.equals("Coins")) {
- buyItemId = 0;
- for(Map.Entry entry: stuff.entrySet()){
- if(valueItemName.equals(entry.getValue())){
- buyItemId = (int) entry.getKey();
- break; //breaking because its one to one map
- }
- }
- api.log("item is " + valueItemName);
- api.log("item id is " + buyItemId);
- x = x + 1;
- api.log("Item is not null, adding one to x. x now equals " + x);
- MethodProvider.sleep(rnd3);
- }else {
- x = x + 1;
- api.log("Item is null, adding one to x. x now equals " + x);
- MethodProvider.sleep(rnd3);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement