Advertisement
kolpastebin

doInsultBeerPong()

Dec 23rd, 2016
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. int beerPongResponseForText(string page_text)
  2. {
  3. if (contains_text(page_text, "You attempt to make up for the slip, but it's too late -- your nerve has been broken, and you soon find yourself pushing your way through the crowd, away from the beer pong table and the jeering cat-calls of Old Don Rickets."))
  4. {
  5. print("failure", "red");
  6. return 0;
  7. }
  8.  
  9. int [string] text_to_id;
  10. text_to_id["Arrr, the power of me serve'll flay the skin from yer bones!"] = 1;
  11. text_to_id["Do ye hear that, ye craven blackguard"] = 2;
  12. text_to_id["ye miserable, pestilent wretch"] = 3;
  13. text_to_id["The streets will run red with yer blood when I'm through with ye"] = 4;
  14. text_to_id["Yer face is as foul as that of a drowned goat!"] = 5;
  15. text_to_id["When I'm through with ye, ye'll be crying like a little girl"] = 6;
  16. text_to_id["In all my years I've not seen a more loathsome worm than yerself"] = 7;
  17. text_to_id["Not a single man has faced me and lived to tell the tale"] = 8;
  18.  
  19. int found_id = -1;
  20. foreach text, id in text_to_id
  21. {
  22. if (page_text.contains_text(text))
  23. {
  24. found_id = id;
  25. break;
  26. }
  27. }
  28. if (found_id == -1)
  29. {
  30. abort("/!\\ Unknown pirate insult /!\\");
  31. return 0;
  32. }
  33.  
  34. if (get_property("lastPirateInsult" + found_id).to_boolean())
  35. {
  36. print("Found insult " + found_id, "red");
  37. return found_id;
  38. }
  39. print("Unable to find insult " + found_id + ", giving up", "red");
  40. return 9; //default, always available
  41. }
  42.  
  43. void doInsultBeerPong()
  44. {
  45. string text = visit_url("adventure.php?snarfblat=157");
  46. //step up:
  47. //beerpong.php?response=1
  48. text = visit_url("choice.php?whichchoice=187&option=1");
  49. int response = beerPongResponseForText(text);
  50. if (response == 0)
  51. return;
  52. text = visit_url("beerpong.php?response=" + response);
  53.  
  54. response = beerPongResponseForText(text);
  55. if (response == 0)
  56. return;
  57. text = visit_url("beerpong.php?response=" + response);
  58.  
  59. response = beerPongResponseForText(text);
  60. if (response == 0)
  61. return;
  62. text = visit_url("beerpong.php?response=" + response);
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement