「パズドラ ダメージ計算」にラードラボタンを表示するブックマークレット

    @@ -19,29 +19,24 @@ input.style.width = '3em'; } - var inputs = document.querySelectorAll('input[onclick^="set_ra"]'); - var input1 = inputs[0].cloneNode(true); - var input2 = inputs[0].cloneNode(true); - for (var node, i = 0; node = inputs[i]; i++) node.parentNode.removeChild(node); - - input1.value = 'ラードラパ(6色)ボタン'; - input1.style.left = 'auto'; - input1.style.top = '9em'; - input1.style.right = '0'; - document.body.appendChild(input1); - - input2.value = 'ラードラパ(5色)ボタン'; - input2.style.left = 'auto'; - input2.style.top = (parseInt(input1.style.top, 10) + 2).toString(10) + 'em'; - input2.style.right = '0'; - document.body.appendChild(input2); + var input = document.querySelector('input[onclick^="set_ra"]'); + input = input.cloneNode(true); + var table = document.querySelector('table[style*="left:800"]'); + table.parentNode.removeChild(table); + + input.value = 'ラードラパボタン'; + input.style.position = 'absolute'; + input.style.left = 'auto'; + input.style.top = '9em'; + input.style.right = '0'; + document.body.appendChild(input); - input1.onclick = function () { + input.onclick = function () { select_option(document.querySelector('select[name="enemy_color"]'), /^火$/); document.all.skill_onoff.selectedIndex = 0; - select_option(document.querySelector('select[name="ls"]'), /^9倍$/); - select_option(document.querySelector('select[name="fs"]'), /^8倍$/); + select_option(document.querySelector('select[name="ls"]'), /^ラードラ6色$/); + select_option(document.querySelector('select[name="fs"]'), /^ラードラ6色$/); document.all.na.value = "ラードラ99"; document.all.nb.value = "覚醒イシス99"; @@ -97,83 +92,6 @@ document.getElementById('color_sub_a:a:f').selectedIndex = 4; document.all.combo_select.value = 8; - select_option(document.all.enhance, /^神タイプ$/); - select_option(document.all.enh_power, /^2\.0倍$/); - - select_option(document.querySelector('select[name="stim_blue"]'), /^1枚$/); - select_option(document.querySelector('select[name="kd_blue"]'), /^2枚$/); - - document.getElementById('drop_red1').value = 3; - document.getElementById('drop_blue1').value = 3; - document.getElementById('drop_green1').value = 3; - document.getElementById('drop_yellow1').value = 3; - document.getElementById('drop_purple1').value = 3; - - bg_change(0); - main(); - }; - - input2.onclick = function () { - select_option(document.querySelector('select[name="enemy_color"]'), /^光$/); - document.all.skill_onoff.selectedIndex = 0; - - select_option(document.querySelector('select[name="ls"]'), /^4\.5倍$/); - select_option(document.querySelector('select[name="fs"]'), /^4\.5倍$/); - - document.all.na.value = "ラードラ99"; - document.all.nb.value = "覚醒イシス99"; - document.all.nc.value = "闇カーリー99"; - document.all.nd.value = "闇カーリー99"; - document.all.ne.value = "インドラ99"; - document.all.nf.value = "ラードラ99"; - - select_option(document.getElementById('type_main_a:a:a'), /^神$/); - select_option(document.getElementById('type_sub_a:a:a'), /^ドラゴン$/); - - select_option(document.getElementById('type_main_a:a:b'), /^神$/); - select_option(document.getElementById('type_sub_a:a:b'), /^悪魔$/); - - select_option(document.getElementById('type_main_a:a:c'), /^神$/); - select_option(document.getElementById('type_sub_a:a:c'), /^ドラゴン$/); - - select_option(document.getElementById('type_main_a:a:d'), /^神$/); - select_option(document.getElementById('type_sub_a:a:d'), /^ドラゴン$/); - - select_option(document.getElementById('type_main_a:a:e'), /^神$/); - select_option(document.getElementById('type_sub_a:a:e'), /^ドラゴン$/); - - select_option(document.getElementById('type_main_a:a:f'), /^神$/); - select_option(document.getElementById('type_sub_a:a:f'), /^ドラゴン$/); - - document.getElementById('atk_a:a:a').value = 2003; - document.getElementById('atk_a:a:b').value = 2092; - document.getElementById('atk_a:a:c').value = 2269; - document.getElementById('atk_a:a:d').value = 2269; - document.getElementById('atk_a:a:e').value = 1962; - document.getElementById('atk_a:a:f').value = 2003; - - document.getElementById('tway_0').selectedIndex = 2; - document.getElementById('tway_1').selectedIndex = 0; - document.getElementById('tway_2').selectedIndex = 1; - document.getElementById('tway_3').selectedIndex = 1; - document.getElementById('tway_4').selectedIndex = 0; - document.getElementById('tway_5').selectedIndex = 2; - - document.getElementById('color_main_a:a:a').selectedIndex = 3; - document.getElementById('color_main_a:a:b').selectedIndex = 1; - document.getElementById('color_main_a:a:c').selectedIndex = 4; - document.getElementById('color_main_a:a:d').selectedIndex = 4; - document.getElementById('color_main_a:a:e').selectedIndex = 3; - document.getElementById('color_main_a:a:f').selectedIndex = 3; - - document.getElementById('color_sub_a:a:a').selectedIndex = 4; - document.getElementById('color_sub_a:a:b').selectedIndex = 3; - document.getElementById('color_sub_a:a:c').selectedIndex = 1; - document.getElementById('color_sub_a:a:d').selectedIndex = 1; - document.getElementById('color_sub_a:a:e').selectedIndex = 4; - document.getElementById('color_sub_a:a:f').selectedIndex = 4; - - document.all.combo_select.value = 5; select_option(document.all.enhance, /^なし$/); select_option(document.all.enh_power, /^1\.0倍$/);
  • /*
     * @title 「パズドラ ダメージ計算」にラードラボタンを表示するブックマークレット
     * @include http://www.geocities.jp/pangya_monooki/p/dmg-sim2/
     * @license MIT License
     */
    
    (function () {
    	function select_option (select, regexp) {
    		var options = select.options;
    		for (var option, i = 0; option = options[i]; i++) if (regexp.test(option.text.trim())) break;
    		select.selectedIndex = i;
    	}
    
    	var inputs = document.querySelectorAll('input[id^="drop_"]');
    	for (var input, i = 0; input = inputs[i]; i++) {
    		input.type = 'number';
    		input.value = '';
    		input.placeholder = 0;
    		input.style.width = '3em';
    	}
    
    	var input = document.querySelector('input[onclick^="set_ra"]');
    	input = input.cloneNode(true);
    	var table = document.querySelector('table[style*="left:800"]');
    	table.parentNode.removeChild(table);
    
    	input.value = 'ラードラパボタン';
    	input.style.position = 'absolute';
    	input.style.left = 'auto';
    	input.style.top = '9em';
    	input.style.right = '0';
    	document.body.appendChild(input);
    
    	input.onclick = function () {
    		select_option(document.querySelector('select[name="enemy_color"]'), /^火$/);
    		document.all.skill_onoff.selectedIndex = 0;
    
    		select_option(document.querySelector('select[name="ls"]'), /^ラードラ6色$/);
    		select_option(document.querySelector('select[name="fs"]'), /^ラードラ6色$/);
    
    		document.all.na.value = "ラードラ99";
    		document.all.nb.value = "覚醒イシス99";
    		document.all.nc.value = "闇カーリー99";
    		document.all.nd.value = "闇カーリー99";
    		document.all.ne.value = "インドラ99";
    		document.all.nf.value = "ラードラ99";
    
    		select_option(document.getElementById('type_main_a:a:a'), /^神$/);
    		select_option(document.getElementById('type_sub_a:a:a'), /^ドラゴン$/);
    
    		select_option(document.getElementById('type_main_a:a:b'), /^神$/);
    		select_option(document.getElementById('type_sub_a:a:b'), /^悪魔$/);
    
    		select_option(document.getElementById('type_main_a:a:c'), /^神$/);
    		select_option(document.getElementById('type_sub_a:a:c'), /^ドラゴン$/);
    
    		select_option(document.getElementById('type_main_a:a:d'), /^神$/);
    		select_option(document.getElementById('type_sub_a:a:d'), /^ドラゴン$/);
    
    		select_option(document.getElementById('type_main_a:a:e'), /^神$/);
    		select_option(document.getElementById('type_sub_a:a:e'), /^ドラゴン$/);
    
    		select_option(document.getElementById('type_main_a:a:f'), /^神$/);
    		select_option(document.getElementById('type_sub_a:a:f'), /^ドラゴン$/);
    
    		document.getElementById('atk_a:a:a').value = 2003;
    		document.getElementById('atk_a:a:b').value = 2092;
    		document.getElementById('atk_a:a:c').value = 2269;
    		document.getElementById('atk_a:a:d').value = 2269;
    		document.getElementById('atk_a:a:e').value = 1962;
    		document.getElementById('atk_a:a:f').value = 2003;
    
    		document.getElementById('tway_0').selectedIndex = 2;
    		document.getElementById('tway_1').selectedIndex = 0;
    		document.getElementById('tway_2').selectedIndex = 1;
    		document.getElementById('tway_3').selectedIndex = 1;
    		document.getElementById('tway_4').selectedIndex = 0;
    		document.getElementById('tway_5').selectedIndex = 2;
    
    		document.getElementById('color_main_a:a:a').selectedIndex = 3;
    		document.getElementById('color_main_a:a:b').selectedIndex = 1;
    		document.getElementById('color_main_a:a:c').selectedIndex = 4;
    		document.getElementById('color_main_a:a:d').selectedIndex = 4;
    		document.getElementById('color_main_a:a:e').selectedIndex = 3;
    		document.getElementById('color_main_a:a:f').selectedIndex = 3;
    
    		document.getElementById('color_sub_a:a:a').selectedIndex = 4;
    		document.getElementById('color_sub_a:a:b').selectedIndex = 3;
    		document.getElementById('color_sub_a:a:c').selectedIndex = 1;
    		document.getElementById('color_sub_a:a:d').selectedIndex = 1;
    		document.getElementById('color_sub_a:a:e').selectedIndex = 4;
    		document.getElementById('color_sub_a:a:f').selectedIndex = 4;
    
    		document.all.combo_select.value = 8;
    		select_option(document.all.enhance, /^なし$/);
    		select_option(document.all.enh_power, /^1\.0倍$/);
    
    		select_option(document.querySelector('select[name="stim_blue"]'), /^1枚$/);
    		select_option(document.querySelector('select[name="kd_blue"]'), /^2枚$/);
    
    		document.getElementById('drop_red1').value = 3;
    		document.getElementById('drop_blue1').value = 3;
    		document.getElementById('drop_green1').value = 3;
    		document.getElementById('drop_yellow1').value = 3;
    		document.getElementById('drop_purple1').value = 3;
    
    		bg_change(0);
    		main();
    	};
    }());
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2015/11/28 21:38:22 - 2015-11-28
  2. 2015/11/28 21:18:03 - 2015-11-28
  3. 2015/11/28 21:17:07 - 2015-11-28
  4. 2015/09/30 10:23:59 - 2015-09-30
  5. 2015/09/28 01:32:28 - 2015-09-28
  6. 2015/09/27 13:09:20 - 2015-09-27
  7. 2015/09/27 12:45:45 - 2015-09-27
  8. 2015/09/27 12:42:11 - 2015-09-27