Last active
December 23, 2015 12:19
-
-
Save 5zen/6634398 to your computer and use it in GitHub Desktop.
MC☆あくしず エンタープライズの××に引いたカードをぶち込むヾ(*´∀`*)ノキャッキャ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name mc_Enterprise_eating | |
// @description MC☆あくしず F-35 ライトニングの××に引いたカードをぶち込むヾ(*´∀`*)ノキャッキャ | |
// @include http://*.bmcaxis.jp/busyodas/busyodas_result.php* | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js | |
// @icon https://raw.github.com/5zen/mc_beyond/master/icon.png | |
// @version 0.02 | |
// @grant GM_xmlhttpRequest | |
// ==/UserScript== | |
// 2013.10.14 F-35 ライトニング用に改修(ファイル名は変わらない) | |
//グローバル変数 | |
var VERSION = "0.02"; //バージョン情報 | |
var d = document; | |
var $v = function(key) { return d.evaluate(key, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); }; | |
(function($) { | |
$.cookie = function(key, value, options) { | |
// key and possibly options given, get cookie... | |
options = value || {}; | |
var decode = options.raw ? function(s) { return s; } : decodeURIComponent; | |
var pairs = document.cookie.split('; '); | |
for(var i = 0, pair; pair = pairs[i] && pairs[i].split('='); i++) { | |
if(decode(pair[0]) === key) return decode(pair[1] || ''); // IE saves cookies with empty string as "c; ", e.g. without "=" as opposed to EOMB, thus pair[1] may be undefined | |
} | |
return null; | |
}; | |
})(jQuery); | |
jQuery.noConflict(); | |
j$ = jQuery; | |
var host = location.hostname; | |
// メイン | |
(function(){ | |
// カードIDの取得 | |
var regexp = /card=([0-9]*)/ | |
location.href.match(regexp); | |
var card_id = parseInt(RegExp.$1); | |
var cards = document.evaluate('//*[@class=\"back\"]',document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); | |
var rear_c = document.evaluate('//*[@class=\"cardStatus_rarerity_c\"]',document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); | |
var rear_uc = document.evaluate('//*[@class=\"cardStatus_rarerity_uc\"]',document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); | |
var rear_r = document.evaluate('//*[@class=\"cardStatus_rarerity_r\"]',document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); | |
var rear_hr = document.evaluate('//*[@class=\"cardStatus_rarerity_hr\"]',document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); | |
var rear_ur = document.evaluate('//*[@class=\"cardStatus_rarerity_ur\"]',document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); | |
var rear_pr = document.evaluate('//*[@class=\"cardStatus_rarerity_pr\"]',document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); | |
var card_no = document.evaluate('//*[@class=\"cardno\"]',document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null).snapshotItem(0).innerHTML; | |
var eatStart = d.createElement("input"); | |
eatStart.id = "OpenSetting"; | |
eatStart.type = "button"; | |
eatStart.value = "F-35 ライトニングに与える"; | |
eatStart.href = "javascript:void(0);"; | |
eatStart.style.marginTop = "20px"; | |
eatStart.style.marginBottom = "20px"; | |
eatStart.style.marginLeft = "10px"; | |
eatStart.style.color = "#000000"; | |
eatStart.style.cursor = "pointer"; | |
eatStart.addEventListener("click", function() { | |
if (eatStart.value != " 食べました ") { | |
var data = "card_id[" + card_id + "]=1&btn_send=与える"; | |
GM_xmlhttpRequest({ | |
method:"POST", | |
url:"http://" + host + "/girls/carduse.php", | |
headers:{"Content-type":"application/x-www-form-urlencoded"}, | |
data: data, | |
onload:function(x){ | |
eatStart.value = " 食べました "; | |
} | |
}); | |
} else { | |
var ssid = j$.cookie('SSID'); | |
var hrf = location.href; | |
var gat_type_ = hrf.replace(/^.*got_type=(-?[0-9]+)/, "$1"); | |
var got_type = RegExp.$1; | |
var tob = hrf.replace(/^.*tab=(.*)/, "$1"); | |
var tab = RegExp.$1; | |
var del_card_id = "0"; | |
ll_use_flg = false; | |
var data = "ssid=" + ssid + "&send=send" + "&got_type=" + got_type + "&tab=" + tab + "&delcard_id=0&ll_use_flg=false"; | |
GM_xmlhttpRequest({ | |
method:"POST", | |
url:"http://" + host + "/busyodas/busyodas.php", | |
headers:{"Content-type":"application/x-www-form-urlencoded"}, | |
data: data, | |
onload:function(x){ | |
location.href = x.finalUrl; | |
} | |
}); | |
} | |
}, true); | |
// C と UC だけボタン追加。いるカード食わせても泣くな∠( ゚д゚)/ | |
// №7041 ゼナとおにぎり | |
// №9913 UCパンツ は除外 | |
if (((rear_c.snapshotLength > 0) || (rear_uc.snapshotLength > 0)) && ((card_no != "7041") || (card_no != "9913"))) { | |
cards.snapshotItem(0).appendChild(eatStart); | |
} | |
})(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment