Last active
August 29, 2015 13:55
-
-
Save staybuzz/8747761 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding : utf-8 | |
# TLに流れてきたすべてのpostに対して適用しちゃう | |
# リプライする内容を予め指定しておく | |
reply = [ | |
" | |
ロッテ 阪神 | |
第1戦 10 - 1 | |
第2戦 10 - 0 | |
第3戦 10 - 1 | |
第4戦 3 - 2 | |
合計 33 - 4 | |
", | |
"http://victreal.net/card/gallery/170/170.jpg", | |
"なんでや!阪神関係ないやろ!" | |
] | |
i = 0 # 空白カウンタ | |
Plugin.create :tintin do | |
on_appear do |ms| | |
ms.each do |m| | |
if m.message.user != Service.primary.user and m.message.to_s =~ /ち[ー〜~]ん[\((]笑[\))]/ | |
Thread.new do | |
reply.each do |rep| | |
Service.primary.post(:message => "#{"@" + m.user.idname} #{rep +" "*i}", :replyto => m, :system => true) | |
sleep 1 | |
end | |
# 空白を入れる回数をカウントする。10postしたらリセットされる。 | |
unless i == 4 | |
i += 1 | |
else | |
i = 0 | |
end | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment