Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name MCC Event Script
- // @namespace MCC Tools
- // @version 1.0
- // @description Auto event script
- // @author Ryozu
- // @match http://us-moe-app.amz-aws.jp/event/*
- // @exclude http://us-moe-app.amz-aws.jp/event/mini_event/*
- // @grant none
- // ==/UserScript==
- (function()
- {
- 'use strict';
- if (window.location.href.indexOf("/error.php") > -1)
- {
- window.history.go(-1);
- }
- if (window.location.href.indexOf("no_life.php") > -1)
- {
- console.log("Over Stamina Usage");
- //window.history.go(-1);
- }
- if (window.location.href.indexOf("end.php") > -1)
- {
- console.log("Step Success");
- }
- var stamina = parseInt(document.querySelector(".shadow").innerHTML.trim());
- console.log("Stamina: " + stamina);
- /* --------------------------------------------------------------------------- */
- //var BP = 0;
- //var Icons = document.images;
- //for (var c = 0; c < Icons.length; c++)
- //{
- // if (Icons[c].src.indexOf("battle_gauge_on.png") > -1)
- // {
- // BP++;
- // }
- //}
- //BP = BP / 2;
- //console.log("Battle Pts: " + BP);
- /* --------------------------------------------------------------------------- */
- /*
- var Spa = document.getElementsByClassName("img_ninja2017_2 move_sub");
- if (Spa.length > 0)
- {
- //Spa[0].click();
- }
- if (window.location.href.indexOf("/spa/") > -1)
- {
- var Spar = document.getElementsByClassName("img_ninja2017_1");
- if (Spar.length == 6)
- {
- Spar[5].click();
- }
- }
- */
- if (window.location.href.indexOf("/quest/") > -1)
- {
- console.log("/quest/");
- if (window.location.href.indexOf("move_select.php") > -1)
- {
- console.log("move_select.php");
- var links = document.getElementsByClassName("event_button");
- //console.log(links.length);
- for (var k = links.length - 1; k >= 0; k--)
- {
- if (links[k].href.indexOf("move_conf.php") > -1)
- {
- //console.log(links[k].href);
- if (links[k].href.indexOf("roid=53823&") > -1)
- {
- //That's Kiria's roid=id, change for your own or whatever.
- console.log("Myroid Found in location");
- links[k].click();
- }
- }
- }
- console.log("Myroid not found");
- }
- var Encounter = document.getElementsByClassName("img_teruteru2017_1 move2").length;
- Encounter += document.getElementsByClassName("img_teruteru2017_4 title_win").length;
- Encounter += document.getElementsByClassName("img_teruteru2017_4 title_fever").length;
- //Encounter++;
- //img_teruteru2017_4 title_win
- //#quest_window > table:nth-child(7) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(2) > a:nth-child(1)
- var Pict = document.querySelector("#quest_window > table:nth-child(7) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(2) > a:nth-child(1)");
- if (Pict != null)
- {
- if (Pict.text == "Take a Picture")
- {
- Encounter += 1;
- }
- }
- if (((stamina >= 10) && (Encounter > 0)) || (stamina >= 85))
- {
- console.log("Stamina Good");
- var Brights = document.getElementsByClassName("bright");
- var buttons = document.getElementsByClassName("event_button");
- var selected = document.getElementsByClassName("bright")[0];
- for (var i = 0; i < buttons.length; i++)
- {
- //console.log(buttons[i].innerHTML);
- //Buttons you want to be clicked when you have enough stamina
- if ((buttons[i].innerHTML.indexOf("Call Out") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1))
- {
- selected = buttons[i];
- //break;
- }
- }
- if (selected == 0)
- {
- console.log("No button found!");
- }
- else
- {
- console.log("Clicking: " + selected.innerHTML.toString());
- selected.click();
- }
- }
- else
- {
- console.log("Not enough stamina");
- var check0 = document.getElementsByName("mate0");
- if (check0[0])
- {
- check0[0].value = "99";
- }
- var check1 = document.getElementsByName("mate1")[0];
- if (check1)
- {
- check1.value = "99";
- }
- var check2 = document.getElementsByName("mate2")[0];
- if (check2)
- {
- check2.value = "99";
- }
- var buttons = document.getElementsByClassName("event_button");
- var selected = 0;
- for (var i = 0; i < buttons.length; i++)
- {
- //console.log(buttons[i].innerHTML);
- if (window.location.href.indexOf("/spa/result_end.php") > -1)
- {
- var GoBack = document.querySelector("a.event_button:nth-child(10)");
- if (GoBack != "")
- {
- GoBack.click();
- }
- }
- //Buttons you want clicked even if you don't hit the stamina threshold.
- if ((buttons[i].innerHTML.indexOf("Call Out") > -1) ||
- (buttons[i].innerHTML.indexOf("Keep going") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1) ||
- (buttons[i].innerHTML.indexOf("xx") > -1))
- {
- selected = buttons[i];
- break;
- }
- }
- if (selected == 0)
- {
- console.log("No button found!");
- }
- else
- {
- console.log("Clicking: " + selected.innerHTML.toString());
- selected.click();
- }
- }
- }
- })();
- console.log("Reloading page in a bit");
- setInterval(openUrl, 60000); // Wait x000 seconds
- function openUrl()
- {
- location.reload();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement