Skip to content

Commit

Permalink
Merge pull request #16 from KernelPone/master
Browse files Browse the repository at this point in the history
Add YOLO, fixed bug in required helpers.
  • Loading branch information
Namasteh committed Apr 14, 2014
2 parents be84217 + 71a54c1 commit f3cd250
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions lib/eve/plugins/ai.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
require 'cinch'
require 'yaml'
require_relative "config/check_master"
require_relative "config/check_friend"
require_relative "config/check_foe"


module Cinch::Plugins
class Ai
Expand Down Expand Up @@ -47,7 +50,7 @@ def status_m(m)
Format(:green, "Well, Master #{m.user.nick}, all my plugins are operational, and you're here, what more could I ask for?")
].sample
end
def hir(m)
[
Format(:green, "Hello #{m.user.nick}"),
Expand Down Expand Up @@ -247,6 +250,13 @@ def roser(m)
Format(:green, "#{m.user.nick}, roses are red, violets are blue, you gave me a rose, so I love you!")
].sample
end

def yolor(m)
[
Format(:green, "#YOLO!"),
Format(:green, "Don't do anything I wouldn't do #{m.user.nick}")
].sample
end

match lambda {|m| /#{m.bot.nick}(\S|) (how are ya|how are you|how are you doing|how are you feeling|how(\S|)s it going|how(\S|) you)(\W|$)/i}, :method => :hau, use_prefix: false
match lambda {|m| /(how are ya|how are you|how are you doing|how are you feeling|how(\S|)s it going|how(\S|) you)(\S|) #{m.bot.nick}(\W|$)/i}, :method => :hau, use_prefix: false
Expand All @@ -269,6 +279,7 @@ def roser(m)
match lambda {|m| /#{m.bot.nick}(\S|) I(\S|)m (good|fine|okay|happy|gurd)(\W|$)/i}, :method => :rosp, use_prefix: false
match lambda {|m| /(Good|)night(\S|) #{m.bot.nick}(\W|$)/i}, :method => :night, use_prefix: false
match lambda {|m| /!rose #{m.bot.nick}(\W|$)/i}, :method => :rose, use_prefix: false
match /(yolo|#yolo)/i, :method => :yolo, use_prefix: false

# Here is where we specify where to go in the array above for when
# matchers are met and a response is required from the bot.
Expand All @@ -292,7 +303,7 @@ def hau(m)
sleep config[:delay] || 3
m.reply status(m)
end
def hi(m)
if check_friend(m.user)
sleep config[:delay] || 3
Expand All @@ -312,7 +323,7 @@ def hi(m)
sleep config[:delay] || 3
m.reply hir(m)
end
def brb(m)
if check_friend(m.user)
sleep config[:delay] || 3
Expand Down Expand Up @@ -477,6 +488,19 @@ def rose(m)
sleep config[:delay] || 5
m.reply roser(m)
end

def yolo(m)
if check_friend(m.user)
sleep config[:delay] || 3
m.reply yolor(m)
return;
end
if check_master(m.user)
sleep config[:delay] || 3
m.reply yolor(m)
return;
end
end
end
end

Expand Down

0 comments on commit f3cd250

Please sign in to comment.