Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //requires that choice.php override ezan wrote to let people make make overrides for individual choice adventures.
- //the gist is that we get rid of waves because waves, add coordinates and image# to all images, and replace all images sharing the most common one's digit on the current beach with bonestars. God only knows whether any of these things matter for anything.
- //try to make this only fire on the beach combing page.
- if(available_choice_options().count() <3 ){
- buffer page = visit_url();
- //get rid of waves because ugh.
- page = page.replace(page.index_of("var roll"),page.index_of("3050)\;")+6,"");
- //let's find image frequencies.
- int minfreq =69420;
- int maxfreq;
- int[string] number_of;
- string[int][int] buttons_to_change = page.group_string("(<button style=\"border: 0; background: none; padding: 0\" name=\"coords\" value=\"(\\d{1,2}\\,\\d{2,5})\" type=\"submit\"><img title=\")[^\"]*(\" alt=\"[^\"]*\" src=\")[^\"]*/beachcomb/([^\\.]+)\\.png(\" /></button>)");
- /*
- group 1 is everything before title text
- group 2 is coords value
- group 3 is everything between title text and image
- group 4 is the image name
- group 5 is everything after the image
- */
- foreach i,j in buttons_to_change{
- if(j==1){
- //last digit in image name.
- number_of[buttons_to_change[i][4].group_string("\\d(\\d)")[0][1]]++;
- }
- }
- foreach i in number_of{
- if(number_of[i] > maxfreq){
- maxfreq = number_of[i];
- }
- if(number_of[i] < minfreq){
- minfreq = number_of[i];
- }
- }
- foreach i,j in buttons_to_change{
- if(j == 1){
- if(
- // number_of[buttons_to_change[i][4].group_string("\\d(\\d)")[0][1]] == minfreq
- // ||
- number_of[buttons_to_change[i][4].group_string("\\d(\\d)")[0][1]] == maxfreq
- ){
- page = page.replace_string(buttons_to_change[i][0],
- buttons_to_change[i][1]
- +buttons_to_change[i][2]
- +":"+buttons_to_change[i][4].group_string("\\d+")[0][0]
- +buttons_to_change[i][3]
- //+"http:/\/127.0.0.1:60080/images/itemimages/asshat.gif"
- +"http:/\/127.0.0.1:60080/images/adventureimages/bonestar.gif\""
- //+"http:/\/127.0.0.1:60080/images/otherimages/main/map3.gif\""
- +" height=\"80"
- +buttons_to_change[i][5]
- );
- }
- }
- }
- //changing mouseover text for all sandy stuff because inspect element is dildos.
- buttons_to_change = page.group_string("(<button style=\"border: \\d; background: none; padding: 0\" name=\"coords\" value=\"(\\d{1,2}\\,\\d{2,5})\" type=\"submit\"><img title=\")[^\"]*(\" alt=\"[^\"]*\" src=\"[^\"]*\/beachcomb/(combed)?sand(castle)?(\\d+)\\.png\" /></button>)");
- /*
- group 1 is everything before title text
- group 2 is coords
- group 3 is everything after title text
- group 4 is "combed" or ""
- group 5 is "castle" or ""
- group 6 is the number in the image
- */
- if(buttons_to_change.count() > 0){
- foreach i,j in buttons_to_change{
- if(j==1 ){
- page = page.replace_string(buttons_to_change[i][0] , buttons_to_change[i][1]
- +buttons_to_change[i][2]
- +":"+buttons_to_change[i][6]
- +buttons_to_change[i][3]
- );
- //print(buttons_to_change[i][2]);
- }
- }
- }
- page.write();
- }
Advertisement
Add Comment
Please, Sign In to add comment