Skip to content

Instantly share code, notes, and snippets.

@ustreamer-01647
Created August 24, 2012 11:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ustreamer-01647/3449521 to your computer and use it in GitHub Desktop.
Save ustreamer-01647/3449521 to your computer and use it in GitHub Desktop.
LimeChat2用アスカchトピックボット
/* アスカchトピックボット
> '11 7/1(金) TopicBotのスクリプト公開 こちら
> 常駐させるのが厳しくなってきたため、扱える方が必要に応じて使用して頂ければ助かります
*/
/* change log
1.0 2011年7月1日時点
2012年7月29日アスカchサイトアカウント凍結により,サイト移転
1.1 サイト移転対応.使用されていない変数hp2を削除
*/
var where='#asuka-ch';
var top, fustop, fjustop, sustop, sjustop, vstop, tktop, t;
var fustates=0;
var fjstates=0;
var sustates=0;
var sjstates=0;
var tkstates=0;
var hp=' http://asukach.web.fc2.com/';
function event::onChannelText(prefix, channel, text)
{
if(text.match(/^ユースト1「」$/)||text.match(/^ユースト1「」$/)||text.match(/^ust1「」$/)||text.match(/^ust1「」$/)||text.match(/^ustream1「」$/)||text.match(/^ustream1「」$/)||text.match(/^ユーストリーム1「」$/)||text.match(/^ユーストリーム1「」$/)||text.match(/^ユースト1「」$/)||text.match(/^ユースト1「」$/)||text.match(/^ust1「」$/)||text.match(/^ust1「」$/)||text.match(/^ustream1「」$/)||text.match(/^ustream1「」$/)||text.match(/^ユーストリーム1「」$/)||text.match(/^ユーストリーム1「」$/)){
fustop='';
fustates=0;
topicer();
}
else{
if(text.match(/^ユースト1「/)||text.match(/^ユースト1「/)||text.match(/^ust1「/)||text.match(/^ust1「/)||text.match(/^ustream1「/)||text.match(/^ustream1「/)||text.match(/^ユーストリーム1「/)||text.match(/^ユーストリーム1「/)||text.match(/^ユースト1「/)||text.match(/^ユースト1「/)||text.match(/^ust1「/)||text.match(/^ust1「/)||text.match(/^ustream1「/)||text.match(/^ustream1「/)||text.match(/^ユーストリーム1「/)||text.match(/^ユーストリーム1「/)){
fustop=RegExp.rightContext;
if(fustop.match(/」$/)||fustop.match(/^」$/)){
fustop=RegExp.leftContext;
fustop='Ust01「' + fustop + '」';
fustates=1;
topicer();
}
}
}
if(text.match(/^ジャスティン1「」$/)||text.match(/^ジャスティン1「」$/)||text.match(/^jus1「」$/)||text.match(/^jus1「」$/)||text.match(/^justin1「」$/)||text.match(/^justin1「」$/)||text.match(/^ジャス1「」$/)||text.match(/^ジャス1「」$/)||text.match(/^ジャスティン1「」$/)||text.match(/^ジャスティン1「」$/)||text.match(/^jus1「」$/)||text.match(/^jus1「」$/)||text.match(/^justin1「」$/)||text.match(/^justin1「」$/)||text.match(/^ジャス1「」$/)||text.match(/^ジャス1「」$/)){
fjustop='';
fjstates=0;
topicer();
}
else{
if(text.match(/^ジャスティン1「/)||text.match(/^ジャスティン1「/)||text.match(/^jus1「/)||text.match(/^jus1「/)||text.match(/^justin1「/)||text.match(/^justin1「/)||text.match(/^ジャス1「/)||text.match(/^ジャス1「/)||text.match(/^ジャスティン1「/)||text.match(/^ジャスティン1「/)||text.match(/^jus1「/)||text.match(/^jus1「/)||text.match(/^justin1「/)||text.match(/^justin1「/)||text.match(/^ジャス1「/)||text.match(/^ジャス1「/)){
fjustop=RegExp.rightContext;
if(fjustop.match(/」$/)||fjustop.match(/^」$/)){
fjustop=RegExp.leftContext;;
fjustop=' Jus01「' + fjustop + '」';
fjstates=1;
topicer();
}
}
}
if(text.match(/^ユースト2「」$/)||text.match(/^ユースト2「」$/)||text.match(/^ust2「」$/)||text.match(/^ust2「」$/)||text.match(/^ustream2「」$/)||text.match(/^ustream2「」$/)||text.match(/^ユーストリーム2「」$/)||text.match(/^ユーストリーム2「」$/)||text.match(/^ユースト2「」$/)||text.match(/^ユースト2「」$/)||text.match(/^ust2「」$/)||text.match(/^ust2「」$/)||text.match(/^ustream2「」$/)||text.match(/^ustream2「」$/)||text.match(/^ユーストリーム2「」$/)||text.match(/^ユーストリーム2「」$/)){
sustop='';
sustates=0;
topicer();
}
else{
if(text.match(/^ユースト2「/)||text.match(/^ユースト2「/)||text.match(/^ust2「/)||text.match(/^ust2「/)||text.match(/^ustream2「/)||text.match(/^ustream2「/)||text.match(/^ユーストリーム2「/)||text.match(/^ユーストリーム2「/)||text.match(/^ユースト2「/)||text.match(/^ユースト2「/)||text.match(/^ust2「/)||text.match(/^ust2「/)||text.match(/^ustream2「/)||text.match(/^ustream2「/)||text.match(/^ユーストリーム2「/)||text.match(/^ユーストリーム2「/)){
sustop=RegExp.rightContext;
if(sustop.match(/」$/)||sustop.match(/^」$/)){
sustop=RegExp.leftContext;
sustop=' Ust02「' + sustop + '」';
sustates=1;
topicer();
}
}
}
if(text.match(/^ジャスティン2「」$/)||text.match(/^ジャスティン2「」$/)||text.match(/^jus2「」$/)||text.match(/^jus2「」$/)||text.match(/^justin2「」$/)||text.match(/^justin2「」$/)||text.match(/^ジャス2「」$/)||text.match(/^ジャス2「」$/)||text.match(/^ジャスティン2「」$/)||text.match(/^ジャスティン2「」$/)||text.match(/^jus2「」$/)||text.match(/^jus2「」$/)||text.match(/^justin2「」$/)||text.match(/^justin2「」$/)||text.match(/^ジャス2「」$/)||text.match(/^ジャス2「」$/)){
sjustop='';
sjstates=0;
topicer();
}
else{
if(text.match(/^ジャスティン2「/)||text.match(/^ジャスティン2「/)||text.match(/^jus2「/)||text.match(/^jus2「/)||text.match(/^justin2「/)||text.match(/^justin2「/)||text.match(/^ジャス2「/)||text.match(/^ジャス2「/)||text.match(/^ジャスティン2「/)||text.match(/^ジャスティン2「/)||text.match(/^jus2「/)||text.match(/^jus2「/)||text.match(/^justin2「/)||text.match(/^justin2「/)||text.match(/^ジャス2「/)||text.match(/^ジャス2「/)){
sjustop=RegExp.rightContext;
if(sjustop.match(/」$/)||sjustop.match(/^」$/)){
sjustop=RegExp.leftContext;;
sjustop=' Jus02「' + sjustop + '」';
sjstates=1;
topicer();
}
}
}
if(text.match(/^大会「」$/)||text.match(/^大会「」$/)){
tkstates=0;
topicer();
}
else{
if(text.match(/^大会「/)||text.match(/^大会「/)){
tktop=RegExp.rightContext;
if(tktop.match(/」$/)||tktop.match(/^」$/)){
tktop=RegExp.leftContext;;
tkstates=1;
topicer();
}
}
}
if(text.match(/^対決「/)||text.match(/^対決「/)){
vstop=RegExp.rightContext;
if(vstop.match(/」$/)||vstop.match(/^」$/)){
vstop=RegExp.leftContext;
vstop='対決「' + vstop + '」';
fustates=2;
fjstates=2;
sustates=2;
sjstates=2;
topicer();
}
}
if(text.match(/^「初期化」/)||text.match(/^「初期化」/)||text.match(/^対決「」/)||text.match(/^対決「」/)){
fustop='';
fjustop='';
sustop='';
sjustop='';
fustates=0;
fjstates=0;
sustates=0;
sjstates=0;
topicer();
}
if(text.match(/^Ust1でやります/)||text.match(/^ユースト1でやります/)||text.match(/^ust1でやります/)||text.match(/^ustream1でやります/)||text.match(/^Ust1でやります/)||text.match(/^ユースト1でやります/)||text.match(/^ust1でやります/)||text.match(/^ustream1でやります/)){
mode(channel, '+o ' + prefix.nick);
fustop='Ust01準備中';
fustates=0;
topicer();
}
if(text.match(/^Justin1でやります/)||text.match(/^ジャスティン1でやります/)||text.match(/^jus1でやります/)||text.match(/^ジャス1でやります/)||text.match(/^Justin1でやります/)||text.match(/^ジャスティン1でやります/)||text.match(/^jus1でやります/)||text.match(/^ジャス1でやります/)){
mode(channel, '+o ' + prefix.nick);
fjustop=' Jus01準備中';
fjstates=0;
topicer();
}
if(text.match(/^Ust2でやります/)||text.match(/^ユースト2でやります/)||text.match(/^ust2でやります/)||text.match(/^ustream2でやります/)||text.match(/^Ust2でやります/)||text.match(/^ユースト2でやります/)||text.match(/^ust2でやります/)||text.match(/^ustream2でやります/)){
mode(channel, '+o ' + prefix.nick);
sustop=' Ust02準備中';
sustates=0;
topicer();
}
if(text.match(/^Justin2でやります/)||text.match(/^ジャスティン2でやります/)||text.match(/^jus2でやります/)||text.match(/^ジャス2でやります/)||text.match(/^Justin2でやります/)||text.match(/^ジャスティン2でやります/)||text.match(/^jus2でやります/)||text.match(/^ジャス2でやります/)){
mode(channel, '+o ' + prefix.nick);
sjustop=' Jus02準備中';
sjstates=0;
topicer();
}
}
function topicer(){
if(fustates==0&&fjstates==0&&sustates==0&&sjstates==0&&tkstates==0) top=fustop+fjustop+sustop+sjustop+hp;
if(fustates==1&&fjstates==0&&sustates==0&&sjstates==0&&tkstates==0) top=fustop+fjustop+sustop+sjustop+hp;
if(fustates==0&&fjstates==1&&sustates==0&&sjstates==0&&tkstates==0) top=fustop+fjustop+sustop+sjustop+hp;
if(fustates==0&&fjstates==0&&sustates==1&&sjstates==0&&tkstates==0) top=fustop+fjustop+sustop+sjustop+hp;
if(fustates==0&&fjstates==0&&sustates==0&&sjstates==1&&tkstates==0) top=fustop+fjustop+sustop+sjustop+hp;
if(fustates==1&&fjstates==1&&sustates==0&&sjstates==0&&tkstates==0) top=fustop+fjustop+sustop+sjustop+hp;
if(fustates==1&&fjstates==0&&sustates==1&&sjstates==0&&tkstates==0) top=fustop+fjustop+sustop+sjustop+hp;
if(fustates==1&&fjstates==0&&sustates==0&&sjstates==1&&tkstates==0) top=fustop+fjustop+sustop+sjustop+hp;
if(fustates==0&&fjstates==1&&sustates==1&&sjstates==0&&tkstates==0) top=fustop+fjustop+sustop+sjustop+hp;
if(fustates==0&&fjstates==1&&sustates==0&&sjstates==1&&tkstates==0) top=fustop+fjustop+sustop+sjustop+hp;
if(fustates==0&&fjstates==0&&sustates==1&&sjstates==1&&tkstates==0) top=fustop+fjustop+sustop+sjustop+hp;
if(fustates==1&&fjstates==1&&sustates==1&&sjstates==0&&tkstates==0) top=fustop+fjustop+sustop+sjustop+hp;
if(fustates==1&&fjstates==1&&sustates==0&&sjstates==1&&tkstates==0) top=fustop+fjustop+sustop+sjustop+hp;
if(fustates==1&&fjstates==0&&sustates==1&&sjstates==1&&tkstates==0) top=fustop+fjustop+sustop+sjustop+hp;
if(fustates==0&&fjstates==1&&sustates==1&&sjstates==1&&tkstates==0) top=fustop+fjustop+sustop+sjustop+hp;
if(fustates==1&&fjstates==1&&sustates==1&&sjstates==1&&tkstates==0) top=fustop+fjustop+sustop+sjustop+hp;
if(fustates==2&&fjstates==2&&sustates==2&&sjstates==2&&tkstates==0) top=vstop+hp;
if(fustates==0&&fjstates==0&&sustates==0&&sjstates==0&&tkstates==1) top=fustop+fjustop+sustop+sjustop+tktop;
if(fustates==1&&fjstates==0&&sustates==0&&sjstates==0&&tkstates==1) top=fustop+fjustop+sustop+sjustop+tktop;
if(fustates==0&&fjstates==1&&sustates==0&&sjstates==0&&tkstates==1) top=fustop+fjustop+sustop+sjustop+tktop;
if(fustates==0&&fjstates==0&&sustates==1&&sjstates==0&&tkstates==1) top=fustop+fjustop+sustop+sjustop+tktop;
if(fustates==0&&fjstates==0&&sustates==0&&sjstates==1&&tkstates==1) top=fustop+fjustop+sustop+sjustop+tktop;
if(fustates==1&&fjstates==1&&sustates==0&&sjstates==0&&tkstates==1) top=fustop+fjustop+sustop+sjustop+tktop;
if(fustates==1&&fjstates==0&&sustates==1&&sjstates==0&&tkstates==1) top=fustop+fjustop+sustop+sjustop+tktop;
if(fustates==1&&fjstates==0&&sustates==0&&sjstates==1&&tkstates==1) top=fustop+fjustop+sustop+sjustop+tktop;
if(fustates==0&&fjstates==1&&sustates==1&&sjstates==0&&tkstates==1) top=fustop+fjustop+sustop+sjustop+tktop;
if(fustates==0&&fjstates==1&&sustates==0&&sjstates==1&&tkstates==1) top=fustop+fjustop+sustop+sjustop+tktop;
if(fustates==0&&fjstates==0&&sustates==1&&sjstates==1&&tkstates==1) top=fustop+fjustop+sustop+sjustop+tktop;
if(fustates==1&&fjstates==1&&sustates==1&&sjstates==0&&tkstates==1) top=fustop+fjustop+sustop+sjustop+tktop;
if(fustates==1&&fjstates==1&&sustates==0&&sjstates==1&&tkstates==1) top=fustop+fjustop+sustop+sjustop+tktop;
if(fustates==1&&fjstates==0&&sustates==1&&sjstates==1&&tkstates==1) top=fustop+fjustop+sustop+sjustop+tktop;
if(fustates==0&&fjstates==1&&sustates==1&&sjstates==1&&tkstates==1) top=fustop+fjustop+sustop+sjustop+tktop;
if(fustates==1&&fjstates==1&&sustates==1&&sjstates==1&&tkstates==1) top=fustop+fjustop+sustop+sjustop+tktop;
if(fustates==2&&fjstates==2&&sustates==2&&sjstates==2&&tkstates==1) top=vstop+tktop;
topic(where,top);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment