Character-limit *OLD*

Stops and tells you when past the chat limit

2016-04-01 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name           Character-limit *OLD*
// @namespace      tag://kongregate
// @description    Stops and tells you when past the chat limit
// @include        http://www.kongregate.com/games/*
// @version        1.5.2
// @date           12.11.10
// @author         Ventero
// require        http://kong.ventero.de/updates/48979.js
// ==/UserScript==

// Written by Ventero (http://www.kongregate.com/accounts/Ventero) 05/12/09

var dom = (typeof unsafeWindow === "undefined" ? window : unsafeWindow);

function init_characterLimitVent(){

	var CDialogue = dom.ChatDialogue;

	if(CDialogue){
		CDialogue.prototype = dom.CDprototype||dom.ChatDialogue.prototype;

		if(!CDialogue.prototype.oldKeyPressLimit){
			CDialogue.prototype.oldKeyPressLimit = CDialogue.prototype.onKeyPress;
			CDialogue.prototype.onKeyPress = function (a) {
				var node = (this._input_node.wrappedJSObject || this._input_node);
				this.oldKeyPressLimit(a);
				if (node.getValue().length > 249) {
					z = node.getValue();
					var y = "";
					if (n=z.match(/^(\/\S+\s+\S*\s*)(.*)/)){
						y=n[2];
						if (y.length>249){
							node.setValue(n[1]+y.substr(0, 249))
						}
					}else{
						node.setValue(node.getValue().substr(0, 249))
					}
				}
			}
		}
	};
};

function check(){
	dom.injectScript = dom.injectScript||(document.getElementById("injectScriptDiv")?document.getElementById("injectScriptDiv").onclick():0);
	if(dom.injectScript){
		dom.injectScript(init_characterLimitVent, 0);
	} else if(!dom._promptedFramework && !/Chrome/i.test(navigator.appVersion)){
		if(confirm("You don't have the latest version of the framework-script!\n" +
		           "Please install it, otherwise the scripts won't work.\n" +
		           "Clicking ok will open a new tab where you can install the script"))
			window.open("https://greasyfork.org/scripts/17703", "_blank");
		dom._promptedFramework = true;
	}
}

setTimeout(check, 0);