Advertisement
lostcalpolydude

Show old combat form in mafia

Nov 19th, 2015
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. # save as fight.ash in your relay folder
  2.  
  3. string loadPage() {
  4. string fetch() {
  5. string[string] post = form_fields();
  6. if(post contains "runcombat" && post["runcombat"] == "heckyes")
  7. return run_combat();
  8. return visit_url();
  9. }
  10. // Add doctype to escape quirks mode
  11. return fetch();#.replace_string('<html>', '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\n<html>');
  12. }
  13.  
  14. string showForm(string page) {
  15. // If CAB is present, un-hide the old combat form
  16. if(page.contains_text("<div id=topbar>") && page.contains_text("show old combat form")) {
  17. #matcher fightEnd = create_matcher("(WINWINWIN|You run away, like a sissy little coward|You lose. +You slink away)", page);
  18. #if( !fightEnd.find() )
  19. return replace_all(create_matcher("(<div id='fightform' class='hideform'>|<br><a href='#'[^<]*</a>)", page), "");
  20. }
  21. return page;
  22. }
  23.  
  24. void main() {
  25. loadPage().showForm().write();
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement