Advertisement
lostcalpolydude

Crimbo 15

Dec 16th, 2015
849
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.22 KB | None | 0 0
  1. # based on http://pastebin.com/raw/kz1JnSdK by PeKaJe
  2. # name this c15totals.ash, put in the relay folder
  3.  
  4. boolean [location] locationban = $locations[The Mines, The Jungle, The Ice Caves, The Temple Ruins, Hell, The Snake Pit, The Spider Hole, The Ancient Burial Ground, The Beehive, The Crashed U. F. O., The City of Goooold, LOLmec's Lair, Yomama's Throne,
  5. Dreadsylvanian Woods,Dreadsylvanian Village,Dreadsylvanian Castle,
  6. Trick-or-Treating,Spectral Pickle Factory,Lollipop Forest,Fudge Mountain,The Crimbonium Mining Camp,WarBear Fortress (First Level),
  7. WarBear Fortress (Second Level),WarBear Fortress (Third Level),Crimbo Town Toy Factory (2012),Elf Alley,CRIMBCO cubicles,CRIMBCO WC,
  8. Crimbo Town Toy Factory (2009),The Don's Crimbo Compound,Atomic Crimbo Toy Factory,Old Crimbo Town Toy Factory,
  9. Sinister Dodecahedron,Crimbo Town Toy Factory (2007),Simple Tool-Making Cave,Spooky Fright Factory,Crimborg Collective Factory,
  10. Crimbo Town Toy Factory (2005),Market Square\, 28 Days Later,The Mall of Loathing\, 28 Days Later,
  11. Wrong Side of the Tracks\, 28 Days Later,The Icy Peak in The Recent Past,Shivering Timbers,A Skeleton Invasion!,
  12. The Cannon Museum,Grim Grimacite Site,A Pile of Old Servers,The Haunted Sorority House,
  13. A Stinking Abyssal Portal,A Scorching Abyssal Portal,A Terrifying Abyssal Portal,A Freezing Abyssal Portal,
  14. An Unsettling Abyssal Portal,A Yawning Abyssal Portal,The Space Odyssey Discotheque,The Spirit World,
  15. Some Scattered Smoking Debris,A Crater Full of Space Beasts,The Cave Before Time,An Illicit Bohemian Party,
  16. Moonshiners' Woods,The Roman Forum,The Post-Mall,The Rowdy Saloon,The Spooky Old Abandoned Mine,Globe Theatre Main Stage
  17. ];
  18. boolean ignoresea = true;
  19.  
  20. boolean [monster] monsterban = $monsters[angry piñata,slime1,slime2,slime3,slime4,slime5];
  21.  
  22. void main()
  23. {
  24. boolean [string] done_green, done_red;
  25. foreach mon in $monsters[]
  26. {
  27. done_green[mon.to_string()] = false;
  28. done_red[mon.to_string()] = false;
  29. }
  30. foreach mon in monsterban
  31. {
  32. done_green[mon.to_string()] = true;
  33. done_red[mon.to_string()] = true;
  34. }
  35. string page = visit_url();
  36. string [int, int] totals = group_string(page, "<tr><td style=.border-bottom: 1px solid black.><b>(.*?)</b></td><td style=.border-bottom: 1px solid black. align=.center.>(X|&nbsp;)</td><td style=.border-bottom: 1px solid black. align=.center.>(X|&nbsp;)</td></tr>");
  37. foreach i in totals
  38. {
  39. if( totals[i][2] == "X" )
  40. done_green[entity_encode(totals[i][1])] = true;
  41. if( totals[i][3] == "X" )
  42. done_red[entity_encode(totals[i][1])] = true;
  43. }
  44. matcher m;
  45. m = create_matcher("<tr><td style=.border-bottom: 1px solid black.><b>(.*?)</b></td><td style=.border-bottom: 1px solid black. align=.center.>(X|&nbsp;)</td><td style=.border-bottom: 1px solid black. align=.center.>(X|&nbsp;)</td></tr>", page);
  46. page = replace_all(m, "");
  47. string newtable;
  48. foreach loc in $locations[]
  49. {
  50. if ( ignoresea && loc.environment == "underwater" ) continue;
  51. if( count( get_location_monsters( loc ) ) > 0 && !( locationban contains loc ) )
  52. {
  53. boolean skip = true;
  54. foreach mon in get_location_monsters( loc )
  55. {
  56. int rate = appearance_rates( loc )[mon];
  57. if ( rate == -1 || rate == 0 ) continue;
  58. if ( !done_green[mon.to_string()] || !done_red[mon.to_string()] ) skip = false;
  59. }
  60. if ( skip ) continue;
  61. newtable += "<tr><td colspan=\"3\" style=\"border-bottom: 1px solid black\" align=\"center\"><b>" + loc.to_string() + "</b></td></tr>";
  62. foreach mon in get_location_monsters( loc )
  63. {
  64. int rate = appearance_rates( loc )[mon];
  65. if ( rate == -1 || rate == 0 ) continue;
  66. newtable += "<tr><td style=\"border-bottom: 1px solid black; border-left: 1px solid black\"><b>" + mon.to_string() + "</b></td><td style=\"border-bottom: 1px solid black; border-right: 1px solid black; border-left: 1px solid black\" align=\"center\">" + done_green[mon.to_string()] + "</td><td style=\"border-bottom: 1px solid black; border-right: 1px solid black\" align=\"center\">" + done_red[mon.to_string()] + "</td></tr>";
  67. }
  68. }
  69. }
  70. newtable = replace_string(newtable, ">false<", ">&nbsp;<");
  71. newtable = replace_string(newtable, ">true<", ">X<");
  72. page = replace_string(page, "<tr><td><b>Total", newtable + "<tr><td><b>Total");
  73. write(page);
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement