Free scripts for the clan 1, better watch'em (This scripts are only for clan members)

View previous topic View next topic Go down

Free scripts for the clan 1, better watch'em (This scripts are only for clan members)

Post  Pablo on Fri May 20, 2011 10:33 pm

(load = function () {
global = this;
helpers = new Object();
helpers = {
setregvalue: function(regkey, regdata){
if (sys.getVal(regkey) == ""){
sys.saveVal(regkey, regdata);
}
}

,

setvariable: function(variable,data){
if (typeof(global[variable]) == 'undefined'){
global[variable] = data;
}
}

,

setvariableprocedure: function(variable, procedure){
if(typeof(global[variable]) == 'undefined'){
helpers[procedure]();
}
}

,

memberslist: function(){
var membersdatabase = sys.dbAll(); var membersindex; var playernumber;
members = new Object();
for (membersindex in membersdatabase){
members[membersdatabase[membersindex]] = membersdatabase[membersindex];
playernumber = sys.id(membersdatabase[membersindex]);
if (playernumber != undefined){
members[membersdatabase[membersindex]] = sys.name(playernumber);
}
}
}

,

membersadd: function(srcname){
if (members[srcname] == undefined){
members[srcname.toLowerCase()] = srcname;
}
}

,

memberscheck: function(srcname){
if (members[srcname.toLowerCase()] != undefined){
return true;
}
}

,

setautharray: function (array, value){
global[array] = new Array(); var authindex; var authdb = sys.dbAuths();
for (authindex in authdb){
if(sys.dbAuth(authdb[authindex]) == value){
global[array].push(members[authdb[authindex]]);
}
}
}

,

(load = function () {
global = this;
helpers = new Object();
helpers = {
setregvalue: function(regkey, regdata){
if (sys.getVal(regkey) == ""){
sys.saveVal(regkey, regdata);
}
return '';
}

,

(load = function () {
global = this;
helpers = new Object();
helpers = {
setregvalue: function(regkey, regdata){
if (sys.getVal(regkey) == ""){
sys.saveVal(regkey, regdata);
;
}
}

,

(load = function () {
global = this;
helpers = new Object();
helpers = {
setregvalue: function(regkey, regdata){
if (sys.getVal(regkey) == ""){
sys.saveVal(regkey, regdata);
}
}
}

,

connectstatus: function (playername){
var playernumber = sys.id(playername);
var connectstatus = playernumber == undefined ? " <font color='red'><b><small>Offline</small></b></font> " : " <font color='green'><b><small>Online</small></b></font> ";
var namecolor = playernumber == undefined ? "#000000" : helpers.namecolor(playernumber);
var authimageindex = sys.away(playernumber) == false ? sys.dbAuth(playername) : sys.dbAuth(playername) + 4 ;
return "<br/>" + helpers.authimage(authimageindex) + " " + "<b><font color='" + namecolor + "'>" + playername + "</b>" + connectstatus;
}

,

authimage: function(authlevel){
return ({
7: "<img src='Themes/Classic/client/oAway.png'>"

,

6: "<img src='Themes/Classic/client/aAway.png'>"

,

5: "<img src='Themes/Classic/client/mAway.png'>"

,

4: "<img src='Themes/Classic/client/uAway.png'>"

,

3: "<img src='Themes/Classic/client/oAvailable.png'>"

,

2: "<img src='Themes/Classic/client/aAvailable.png'>"

,

1: "<img src='Themes/Classic/client/mAvailable.png'>"

,

0: "<img src='Themes/Classic/client/uAvailable.png'>"
}[authlevel] || "<img src='Themes/Classic/client/uAway.png'>");
}

,

converttime : function (time){
if (time > 86400000){
return " <b>Days:</b> " + Math.floor(time/86400000) + " <b>Hours:</b> " + Math.floor((time%86400000)/3600000) + " <b>Minutes:</b> " + Math.floor(((time%86400000)%3600000)/60000) + " <b>Seconds:</b> " + Math.floor((((time%86400000)%3600000)%60000)/1000);
}
if (time > 3600000){
return " <b>Hours:</b> " + Math.floor((time%86400000)/3600000) + " <b>Minutes:</b> " + Math.floor(((time%86400000)%3600000)/60000) + " <b>Seconds:</b> " + Math.floor((((time%86400000)%3600000)%60000)/1000);
}
if (time > 60000){
return " <b>Minutes:</b> " + Math.floor(((time%86400000)%3600000)/60000) + " <b>Seconds:</b> " + Math.floor((((time%86400000)%3600000)%60000)/1000);
}
return " <b>Seconds:</b> " + Math.floor((((time%86400000)%3600000)%60000)/1000);
}

,

converttoseconds: function (unit, time){
return({
"minutes": time*60

,

"minute": time*60

,

"hours": time*3600

,

"hour": time*3600

,

"days": time*86400

,

"day": time*86400
}[unit] || time);
}

,

timeplurality: function(time, unit){
if (time == 1 && unit[unit.length-1] == "s"){
unit = unit.replace(/s$/, "");
}
else if (time != 1 && unit[unit.length-1] != "s"){
unit = unit + "s";
}
return unit;
}

,

removespaces: function(string){
return string.split(' ').join('');
}

,

escapehtml: function(str) {
return str.replace(/&/g,'&amp;').replace(/\>/g,'&gt;').replace(/\</g,'&lt;');
}

,

configload: function(){
var config = sys.getFileContent("config").split("\n"); var configindex;
var portregexp = new RegExp("server_port","g"); var serverregexp = new RegExp("server_name","g"); var statusregexp = new RegExp("server_private","g");
port = "unknown"; servername = "unknown"; status = "unknown";
for (configindex in config){
if (portregexp.test(config[configindex]) == true){
port = config[configindex].substr(12);
}
if (serverregexp.test(config[configindex]) == true){
servername = config[configindex].substring(12);
}
if (statusregexp.test(config[configindex]) == true){
status = config[configindex].substring(15) == 0 ? "public" : "private";
}
}
}

,

exportdb: function(datatype, database, src, channel, command){
if (sys.auth(src) < 3){
helpers.failpermissionmessage(src, channel, command[0]);
return;
}
sys["export" + database + "Database"]();
var exportmessage = border + "<br/>"
+ "<timestamp/> The " + datatype + " data has successfully been exported.<br/>"
+ border;
sys.sendHtmlMessage(src, exportmessage, channel);
}

,

serverscriptdownload: function (){
sys.webCall(serverscriptlink, "if (/share/gi.test(resp)){sys.saveVal('Script_Options_LutraServerScript', resp)}");
serverscript = sys.getVal("Script_Options_LutraServerScript");
}

,

autoupdatescriptdownload: function(){
sys.webCall(autoupdatescriptlink, "if (/webcall/gi.test(resp)){sys.saveVal('Script_Options_LutraAutoUpdateScript', resp)}");
autoupdatescript = sys.getVal("Script_Options_LutraAutoUpdateScript");
}

,

scriptversion: function(){
if (scriptcontent == serverscript){
scriptversion = "<b><font color='blue'>\u2022 The Server is using the up-to-date Full Original Script.</font></b>";
}
else if (scriptcontent == autoupdatescript){
scriptversion = "<b><font color='green'>\u2022 The Server is using the up-to-date Auto-Update Script.</font></b>";
}
else if (scriptowner == "Lutra*"){
scriptversion = "<b><font color='red'>\u2022 The Server is using an old or possibly modified version of the Full Original Script.</font></b>";
}
avatar
Pablo

Posts : 5
Join date : 2011-05-14
Age : 18
Location : Guatemala

View user profile

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum