public static void use(final String command, String parameters) {
    if (parameters.equals("")) {
      return;
    }

    boolean either = parameters.startsWith("either ");
    if (either) {
      parameters = parameters.substring(7).trim();
    }

    if (command.equals("eat") || command.equals("eatsilent")) {
      if (KoLCharacter.inBadMoon() && KitchenCommand.visit(parameters)) {
        return;
      }
      if (KoLCharacter.canadiaAvailable() && RestaurantCommand.makeChezSnooteeRequest(parameters)) {
        return;
      }
    }

    if (command.equals("drink") || command.equals("overdrink")) {
      if (KoLCharacter.inBadMoon() && KitchenCommand.visit(parameters)) {
        return;
      }
      if (KoLCharacter.gnomadsAvailable()
          && RestaurantCommand.makeMicroBreweryRequest(parameters)) {
        return;
      }
    }

    // Now, handle the instance where the first item is actually
    // the quantity desired, and the next is the amount to use

    if (command.equals("eat") || command.equals("eatsilent") || command.equals("ghost")) {
      ItemFinder.setMatchType(ItemFinder.FOOD_MATCH);
    } else if (command.equals("drink") || command.equals("overdrink") || command.equals("hobo")) {
      ItemFinder.setMatchType(ItemFinder.BOOZE_MATCH);
    } else if (command.equals("slimeling")) {
      ItemFinder.setMatchType(ItemFinder.EQUIP_MATCH);
    } else {
      ItemFinder.setMatchType(ItemFinder.USE_MATCH);
    }

    Object[] itemList = ItemFinder.getMatchingItemList(KoLConstants.inventory, parameters);

    ItemFinder.setMatchType(ItemFinder.ANY_MATCH);

    for (int level = either ? 0 : 2;
        level <= 2;
        ++level) { // level=0: use only items in inventory, exit on first success
      // level=1: buy/make as needed, exit on first success
      // level=2: use all items in list, buy/make as needed
      for (int i = 0; i < itemList.length; ++i) {
        AdventureResult currentMatch = (AdventureResult) itemList[i];
        int consumpt = ItemDatabase.getConsumptionType(currentMatch.getItemId());

        if (command.equals("eat") && consumpt == KoLConstants.CONSUME_FOOD_HELPER) { // allowed
        } else if (command.equals("eat") || command.equals("ghost")) {
          if (consumpt != KoLConstants.CONSUME_EAT) {
            KoLmafia.updateDisplay(
                MafiaState.ERROR, currentMatch.getName() + " cannot be consumed.");
            return;
          }
        }

        if (command.equals("drink") && consumpt == KoLConstants.CONSUME_DRINK_HELPER) { // allowed
        } else if (command.equals("drink") || command.equals("hobo")) {
          if (consumpt != KoLConstants.CONSUME_DRINK) {
            KoLmafia.updateDisplay(
                MafiaState.ERROR, currentMatch.getName() + " is not an alcoholic beverage.");
            return;
          }
        }

        if (command.equals("use")) {
          switch (consumpt) {
            case KoLConstants.CONSUME_EAT:
            case KoLConstants.CONSUME_FOOD_HELPER:
              KoLmafia.updateDisplay(MafiaState.ERROR, currentMatch.getName() + " must be eaten.");
              return;
            case KoLConstants.CONSUME_DRINK:
            case KoLConstants.CONSUME_DRINK_HELPER:
              KoLmafia.updateDisplay(
                  MafiaState.ERROR, currentMatch.getName() + " is an alcoholic beverage.");
              return;
          }
        }

        int have = currentMatch.getCount(KoLConstants.inventory);
        if (level > 0 || have > 0) {
          if (level == 0 && have < currentMatch.getCount()) {
            currentMatch = currentMatch.getInstance(have);
          }
          if (KoLmafiaCLI.isExecutingCheckOnlyCommand) {
            RequestLogger.printLine(currentMatch.toString());
          } else {
            UseItemRequest request =
                command.equals("hobo")
                    ? UseItemRequest.getInstance(KoLConstants.CONSUME_HOBO, currentMatch)
                    : command.equals("ghost")
                        ? UseItemRequest.getInstance(KoLConstants.CONSUME_GHOST, currentMatch)
                        : command.equals("slimeling")
                            ? UseItemRequest.getInstance(KoLConstants.CONSUME_SLIME, currentMatch)
                            : UseItemRequest.getInstance(currentMatch);
            RequestThread.postRequest(request);
          }

          if (level < 2) {
            return;
          }
        }
      }
    }
  }
  public static boolean makeMicroBreweryRequest(final String parameters) {
    if (!KoLCharacter.gnomadsAvailable()) {
      KoLmafia.updateDisplay(
          "Since you have no access to the Gnomish Gnomad Camp, you may not visit the micromicrobrewery.");
      return false;
    }

    if (KoLConstants.microbreweryItems.isEmpty()) {
      MicroBreweryRequest.getMenu();
    }

    if (parameters.equals("")) {
      RequestLogger.printLine("Today's Special: " + MicroBreweryRequest.getDailySpecial());
      return false;
    }

    String[] splitParameters = AbstractCommand.splitCountAndName(parameters);
    String countString = splitParameters[0];
    String nameString = splitParameters[1];

    if (nameString.equalsIgnoreCase("daily special")) {
      nameString = MicroBreweryRequest.getDailySpecial().getName();
    } else if (nameString.startsWith("\u00B6")) {
      String name = ItemDatabase.getItemName(StringUtilities.parseInt(nameString.substring(1)));
      if (name != null) {
        nameString = name;
      }
    }

    nameString = nameString.toLowerCase();

    for (int i = 0; i < KoLConstants.microbreweryItems.size(); ++i) {
      String name = (String) KoLConstants.microbreweryItems.get(i);

      if (!StringUtilities.substringMatches(name.toLowerCase(), nameString, false)) {
        continue;
      }

      if (KoLmafiaCLI.isExecutingCheckOnlyCommand) {
        RequestLogger.printLine(name);
        return true;
      }

      int count =
          countString == null || countString.length() == 0
              ? 1
              : StringUtilities.parseInt(countString);

      if (count == 0) {
        int inebriety = ItemDatabase.getInebriety(name);
        if (inebriety > 0) {
          count = (KoLCharacter.getInebrietyLimit() - KoLCharacter.getInebriety()) / inebriety;
        }
      }

      for (int j = 0; j < count; ++j) {
        RequestThread.postRequest(new MicroBreweryRequest(name));
      }

      return true;
    }

    return false;
  }