Bot用Limechat Script

var preTopic = "";
var footer = "ここは誰でも配信できます ";
var ustTpc = "ust「空き」";
var jusTpc = "jus「空き」";

var dd = new Date();
function event::onChannelText (prefix, channel, text) {
 if(channel == "#stgch") footer += "wiki→http://goo.gl/7jOKS";
 if(channel == "#programch") footer += "wiki→http://goo.gl/5XTs6";
 if(text.match(/ust(?:"|「|')(.*?)(?:"|」|')/i)){
  // log("マッチ");
  var tpcText = RegExp.$1;
  if (tpcText == "") tpcText = "空き";
  ustTpc = "ust「" + tpcText + "」 ";
  // log("トピック変更→"+ustTpc+jusTpc+footer);
  topic(channel,ustTpc+jusTpc+footer);
 }
 if(text.match(/jus(?:"|「|')(.*?)(?:"|」|')/i)){
  // log("マッチ");
  var tpcText = RegExp.$1;
  if (tpcText == "") tpcText = "空き";
  jusTpc = "jus「" + tpcText + "」 ";
  // log("トピック変更→"+ustTpc+jusTpc+footer);
  topic(channel,ustTpc+jusTpc+footer);
 }
}

function event::onLoad (){
/*  // log("load");
 var text = "ust\"aaa\"jus「aaaa」";
 if(text.match(/ust(?:"|「|')(.*?)(?:"|」|')/i)){
  var tpcText = RegExp.$1;
  if (tpcText == "") tpcText = "空き";
  ustTpc = "ust「" + tpcText + "」 ";
  // log("トピック変更→"+ustTpc+jusTpc+footer);
 }
 if(text.match(/jus(?:"|「|')(.*?)(?:"|」|')/i)){
  var tpcText = RegExp.$1;
  if (tpcText == "") tpcText = "空き";
  jusTpc = "jus「" + tpcText + "」 ";
  // log("トピック変更→"+ustTpc+jusTpc+footer);
 } */
}

うまいこと簡素にできたんじゃないかなと

コメント

このブログの人気の投稿

vsftpが起動に失敗するんだ。

2020年7月22日 近況報告