示例#1
0
  private void buyBeers() {
    space();

    long maxTime = System.currentTimeMillis() + 1500;

    while (!inChat() && System.currentTimeMillis() < maxTime) {
      sleep(25);
    }

    if (talkingToKaylee()) {
      // println("Talking to Kaylee");
      space();
      if (waitChatOption("dwarves", 1000)) {
        Keyboard.typeString("1");
        if (waitContinue(1000)) {
          space();
          if (waitChatOption("Asgarnian", 1000)) {
            space();
            if (waitChatOption("feel", 1000)) {
              Keyboard.typeString(choice);
              if (waitContinue(1000)) {
                space();
                beers++;
              }
            }
          }
        }
      }
    } else {
      // println("Talking to Emily");
      if (waitChatOption("ales are", 1000)) {
        Keyboard.typeString("1");
        if (waitContinue(1000)) {
          space();
          if (waitChatOption("Asgarnian", 1000)) {
            space();
            if (waitChatOption("dwarves", 1000)) {
              Keyboard.typeString(choice);
              if (waitContinue(1000)) {
                space();
                beers++;
              }
            }
          }
        }
      }
    }
  }
示例#2
0
 private void space() {
   char space = (char) KeyEvent.VK_SPACE;
   Keyboard.pressKey(space);
   sleep(200, 400);
 }