Advertisement
Tyluur

Untitled

Dec 25th, 2011
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. private final String[] randomMessages = {
  2. "pie", "kebab", "chocolate", "bagel", "triangle",
  3. "square", "bread"
  4. };
  5.  
  6. private final int[][] responseButtons = {
  7. { 63013, 0 }, { 63014, 1 }, { 63015, 2 }, { 63009, 3 },
  8. { 63010, 4 }, { 63011, 5 }, { 63012, 6 }
  9. };
  10.  
  11. public void executeRandom() {
  12. getPA().sendFrame126("", 16131);
  13. getPA().showInterface(16135);
  14. foodType = Misc.random(6);
  15. getPA().sendFrame126("Please select the " + randomMessages[foodType] + " for a cash reward!", 16145);
  16. }
  17.  
  18. public void checkResponse(int button) {
  19. for (int i = 0; i < responseButtons.length; i ++) {
  20. if (responseButtons[i][0] == button) {
  21. if (responseButtons[i][1] == foodType) {
  22. sendMessage("Congratulations! You've completed the random event.");
  23. getPA().closeAllWindows();
  24. getItems().addItem(995, Misc.random(2000));
  25. return;
  26. }
  27.  
  28. /**
  29. * You can add other things here, such as a teleport or something.
  30. * This is where it fails and they click the wrong food type.
  31. */
  32. sendMessage("Please select the " + randomMessages[foodType] + " to continue");
  33. }
  34. }
  35. }
  36.  
  37. public int foodType = -1;
  38. public long lastRandom;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement