Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private final String[] randomMessages = {
- "pie", "kebab", "chocolate", "bagel", "triangle",
- "square", "bread"
- };
- private final int[][] responseButtons = {
- { 63013, 0 }, { 63014, 1 }, { 63015, 2 }, { 63009, 3 },
- { 63010, 4 }, { 63011, 5 }, { 63012, 6 }
- };
- public void executeRandom() {
- getPA().sendFrame126("", 16131);
- getPA().showInterface(16135);
- foodType = Misc.random(6);
- getPA().sendFrame126("Please select the " + randomMessages[foodType] + " for a cash reward!", 16145);
- }
- public void checkResponse(int button) {
- for (int i = 0; i < responseButtons.length; i ++) {
- if (responseButtons[i][0] == button) {
- if (responseButtons[i][1] == foodType) {
- sendMessage("Congratulations! You've completed the random event.");
- getPA().closeAllWindows();
- getItems().addItem(995, Misc.random(2000));
- return;
- }
- /**
- * You can add other things here, such as a teleport or something.
- * This is where it fails and they click the wrong food type.
- */
- sendMessage("Please select the " + randomMessages[foodType] + " to continue");
- }
- }
- }
- public int foodType = -1;
- public long lastRandom;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement