I'm making a Book of Knowledge for my server. It works with the code I will post below but when I click "More..." it closes the dialogue instead of moving to the next page. Also when I use it, it deletes 2 books instead of just 1.

In playerassistant.java (below reset variables)
Code:
c.usingBook = false;
c.usingBook2 = false;
In clickitem.java
Code:
if (itemId == 11640) {
c.handleBook();
}
In client.java
Code:
public boolean usingBook = false;
public boolean usingBook2 = false;
public void handleBook() {
	getDH().sendOption4("Attack", "Strength", "Defence", "More..");
	usingBook2 = false;
	usingBook = true;
}
public void handleBook2() {
	getDH().sendOption4("Ranged", "Magic", "Prayer", "Go back..");
	usingBook = false;
	usingBook2 = true;
}
In clickingbuttons.java
Code:
case 9178:
if (c.usingBook)
c.getPA().addSkillXP(2500000, 0);
c.getItems().deleteItem(11640, c.getItems().getItemSlot(11640), 1);
c.usingBook = false;
if (c.usingBook2)
c.getPA().addSkillXP(2500000, 4);
c.getItems().deleteItem(11640, c.getItems().getItemSlot(11640), 1);
c.usingBook2 = false;

case 9179:
if (c.usingBook)
c.getPA().addSkillXP(2500000, 2);
c.getItems().deleteItem(11640, c.getItems().getItemSlot(11640), 1);
c.usingBook = false;
if (c.usingBook2)
c.getPA().addSkillXP(2500000, 6);
c.getItems().deleteItem(11640, c.getItems().getItemSlot(11640), 1);
c.usingBook2 = false;

case 9180:
if (c.usingBook)
c.getPA().addSkillXP(2500000, 1);
c.getItems().deleteItem(11640, c.getItems().getItemSlot(11640), 1);
c.usingBook = false;
if (c.usingBook2)
c.getPA().addSkillXP(2500000, 5);
c.getItems().deleteItem(11640, c.getItems().getItemSlot(11640), 1);
c.usingBook2 = false;

case 9181:
if (c.usingBook)
c.handleBook2();
if (c.usingBook2)
c.handleBook();