GC - Neggsweeper better flagging

Makes flagging easier

目前为 2023-05-31 提交的版本。查看 最新版本

// ==UserScript==
// @name         GC - Neggsweeper better flagging
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Makes flagging easier
// @author       wibreth
// @match        https://www.grundos.cafe/games/neggsweeper*
// @match        https://grundos.cafe/games/neggsweeper*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=grundos.cafe
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_addStyle
// ==/UserScript==

(function() {
	'use strict';
	GM_addStyle(`
	.flagging img[src="https://grundoscafe.b-cdn.net/games/php_games/neggsweeper/negg.gif"]:hover {
		 content: url("https://grundoscafe.b-cdn.net/games/php_games/neggsweeper/flagnegg.gif")
	}
	#container {
    grid-template-areas:
        'top top aio'
        'side banner aio'
        'side content aio'
        'side event aio'
        'side footer aio';
	}`);

	$('#neggsweeper_grid').after( $('<div class="mb-1 center"><input type="checkbox" id="persistent-btn" name="persistent-btn" value="1"><label for="persistent-btn"> Persistent flagging?</label></div>'));
	let persistent = GM_getValue('persistent', false);


	$('#flag_it').on('change', () => {
		let flag = $('#flag_it').prop('checked');
		if (persistent)
			GM_setValue('flag', flag);

		if(flag) {
				$('#neggsweeper_grid').addClass('flagging');
		}
		$('#neggsweeper_grid').removeClass('flagging');
	});

	if (persistent) {
		$('#persistent-btn').prop('checked', true);
		let flag = GM_getValue('flag', false);
		$('#flag_it').prop('checked', flag);
	}

	$('#persistent-btn').on('change', () => {
		persistent = $('#persistent-btn').prop('checked');
		GM_setValue('persistent', persistent);
		GM_setValue('flag', $('#flag_it').prop('checked'));
	});


	$('.bonus_negg').insertAfter('#neggsweeper_grid');

	$(document).keydown(function(e) {
			if (e.which == 88) //x
					$('#flag_it').click();
			if (e.which == 69) //e
					$('input.ns_start:nth-child(3)').click();
			if (e.which == 77) //m
					$('input.ns_start:nth-child(4)').click();
			if (e.which == 72) //h
					$('input.ns_start:nth-child(5)').click();
	});

})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址