Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("javascript evaluation script loaded - edited by Stuart");
- Script.create("room");
- Script.eval("room", "String.prototype.trim = function () { return this.replace(/^[\\s\\xA0]+/, \"\").replace(/[\\s\\xA0]+$/, \"\"); }");
- Script.eval("room", "String.prototype.endsWith = function (str) { return this.match(str + \"$\") == str; }");
- Script.eval("room", "String.prototype.startsWith = function (str) { return this.match(\"^\" + str) == str; }");
- Script.eval("room", "String.prototype.repeat = function (n) { return new Array(n + 1).join(this); }");
- function onTextBefore(userobj, text)
- {
- if (canScript(userobj))
- {
- str = Script.eval("room", "userobj = user(" + userobj.id + "); null; " + (text.substr(0, 1) == "@" ? text.substr(1) : text));
- if(text.substr(0, 1) == "@")
- {
- if (str != null)
- {
- print(userobj, str);
- }
- return "";
- }
- if (str != null)
- {
- print(str);
- }
- }
- return text;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement