Pinkie Bot chat command script

function logChat(avatar,name,text,color,userid,title,bgColor){
bgColor=(bgColor==undefined)?"":bgColor;
title=(title==undefined)?"User":title;
$("#chat-history ul").prepend("<li style='background:"+ bgColor+";'><div class='pull-left'><img style='border-color:"+ color+";' src='"+ avatar+"' alt='Avatar' /></div><span><a class='chat-ulink' title='"+ title+"' target='_blank' href='/profile?u="+ userid+"' style='color:"+ color+";'>"+ name+"</a></span><br/>"+ text+"</li>")
$(".chat-ulink").tooltip();
if($("#chat-history").children().children().length>50){
$("#chat-history ul li:last").remove();
}
runCmds(text,name,userid);
}

function runCmds(text,name,userid) {
if(userid!==73047) {
if(text.toUpperCase().indexOf(("Thing to detect here").toUpperCase())!==-1) {
socket.emit("chat",{"msg":"Message Here!"});
}
if(text.toUpperCase().indexOf(("Other thing to detect here").toUpperCase())!==-1) {
socket.emit("chat",{"msg":"Other message Here!"});
}
}
}

No comments:

Post a Comment