diff --git a/lib/plugins/act_ai.rb b/lib/plugins/act_ai.rb index 9463f61..5db69fc 100644 --- a/lib/plugins/act_ai.rb +++ b/lib/plugins/act_ai.rb @@ -8,23 +8,23 @@ class ActAI include Cinch::Plugin include Cinch::Helpers listen_to :action - + ## This is where the hug responses are for friend, foe, master, and neutral - + def hugar_friend(m) [ "hugs #{m.user.nick} tight!", "hugs #{m.user.nick} with much love" ].sample end - + def hugr_friend(m) [ Format(:green, "Do I ever have to let you go, #{m.user.nick}?"), Format(:green, "Thanks for the hug, I love you #{m.user.nick}!") ].sample end - + def hugar_foe(m) [ "squirms and pushes #{m.user.nick}, trying to get away", @@ -32,7 +32,7 @@ def hugar_foe(m) "struggles and finally knees #{m.user.nick} in the crotch." ].sample end - + def hugr_foe(m) [ Format(:green, "I don't like you #{m.user.nick}, what makes you think you can hug me?"), @@ -41,7 +41,7 @@ def hugr_foe(m) Format(:green, "I would hug you, but oops, I lost my tolerance plugin, #{m.user.nick}. Sorry.") ].sample end - + def hugar_m(m) [ "squeals and wraps arms around #{m.user.nick}'s neck.", @@ -49,7 +49,7 @@ def hugar_m(m) "jumps into #{m.user.nick}'s arms and hugs tight!" ].sample end - + def hugr_m(m) [ Format(:green, "Oh Master #{m.user.nick}, you know it gives me such pleasure when you give me hugs!"), @@ -57,21 +57,21 @@ def hugr_m(m) Format(:green, "Oh Master #{m.user.nick}, don't ever stop hugging me!") ].sample end - + def hugar(m) [ "hugs and smiles at #{m.user.nick}." ].sample end - + def hugr(m) [ Format(:green, "Well isn't that sweet of you.") ].sample end - + ## Again, kiss responses; friend, foe, master, and neutral - + def kissar_friend(m) [ "smooches #{m.user.nick} right on the forehead!", @@ -82,7 +82,7 @@ def kissar_friend(m) "bites lower lip and eyes #{m.user.nick} before tackling and giving a giant kiss!" ].sample end - + def kissr_friend(m) [ Format(:green, "Oh #{m.user.nick}, I never knew you had THAT talent!"), @@ -92,7 +92,7 @@ def kissr_friend(m) Format(:green, "#{m.user.nick}, you're gonna get me all hot and bothered!") ].sample end - + def kissar_foe(m) [ "backs away, staring at #{m.user.nick}.", @@ -101,7 +101,7 @@ def kissar_foe(m) "glares and head-butts #{m.user.nick}." ].sample end - + def kissr_foe(m) [ Format(:green, "Oh HELL no. You did NOT just try to kiss me, #{m.user.nick}!"), @@ -110,7 +110,7 @@ def kissr_foe(m) Format(:green, "Listen, I don't let fat losers kiss me, #{m.user.nick}, sorry.") ].sample end - + def kissar_m(m) [ "giggles and touches her mouth.", @@ -119,7 +119,7 @@ def kissar_m(m) "grabs #{m.user.nick}, kissing on the forehead, blushing all the while." ].sample end - + def kissr_m(m) [ Format(:green, "Master #{m.user.nick}, not only are you a very good Master, but you're a good kisser too!"), @@ -128,7 +128,7 @@ def kissr_m(m) Format(:green, "Master #{m.user.nick}, you know exactly how to treat a girl! ^_^") ].sample end - + def kissar(m) [ "stares before looking at the floor.", @@ -138,7 +138,7 @@ def kissar(m) "stares, frowning, looking confused." ].sample end - + def kissr(m) [ Format(:green, "My master hasn't yet taught me much about foreign culture. Is it normal for one to kiss another they barely know where you're from, #{m.user.nick}?"), @@ -147,9 +147,9 @@ def kissr(m) Format(:green, "Are you serious right now, #{m.user.nick}?") ].sample end - + ## Responses for dirty actions such as grinding friend, foe, master, and neutral - + def dirtyar_friend(m) [ "looks uncomfortable and squirms her way away from #{m.user.nick}.", @@ -157,7 +157,7 @@ def dirtyar_friend(m) "shakes her head and takes a step back." ].sample end - + def dirtyr_friend(m) [ Format(:green, "As much as I like you #{m.user.nick}, I don't feel this is appropriate."), @@ -165,14 +165,14 @@ def dirtyr_friend(m) Format(:green, "If you want this friendship to last, #{m.user.nick}, I would suggest not doing that again.") ].sample end - + def dirtyar_foe(m) [ "slaps #{m.user.nick}.", "punches #{m.user.nick} in the face!" ].sample end - + def dirtyr_foe(m) [ Format(:green, "That is inappropriate! D:<"), @@ -180,7 +180,7 @@ def dirtyr_foe(m) Format(:green, "Don't disrepsect me like that! Rude-ass!") ].sample end - + def dirtyar_m(m) [ "has a scared look spread across her face as she looks at the rest of the channel.", @@ -188,7 +188,7 @@ def dirtyar_m(m) "takes a step back and examines #{m.user.nick}." ].sample end - + def dirtyr_m(m) [ Format(:green, "Master #{m.user.nick}, do you really think you should be grinding on me in public?"), @@ -197,7 +197,7 @@ def dirtyr_m(m) Format(:green, "Oh. So is that the only reason you keep me around, Master #{m.user.nick}?") ].sample end - + def dirtyar(m) [ "glares at #{m.user.nick} and restrains herself delivering a large slap.", @@ -205,71 +205,71 @@ def dirtyar(m) "crosses her arms and glares." ].sample end - + def dirtyr(m) [ Format(:green, "Listen, I don't know you from Adam. Do you think it's wise to be so forward, #{m.user.nick}?"), Format(:green, "Don't you think that's a little unacceptable, #{m.user.nick}, I barely know you!") ].sample end - + ## Responses for cuddles, friend, foe, master, and neutral - + def cuddlear_friend(m) [ "cuddles with #{m.user.nick}.", "snuggles close, and purrs." ].sample end - + def cuddler_friend(m) [ Format(:green, "Can we stay like this forever, #{m.user.nick}?"), Format(:green, "Oh I love cuddles, #{m.user.nick}!") ].sample end - + def cuddlear_foe(m) [ "stiffens up and glares at #{m.user.nick}" ].sample end - + def cuddler_foe(m) [ Format(:green, "That is not acceptable! Get off me, #{m.user.nick}!") ].sample end - + def cuddlear_m(m) [ "cuddles tight with #{m.user.nick}, almost purring.", "smiles wide and snuggles tight, nuzzling #{m.user.nick}." ].sample end - + def cuddler_m(m) [ Format(:green, "Oh Master #{m.user.nick}, when you give me cuddles I feel so GUD :3"), Format(:green, "Master #{m.user.nick}, how'd I get so lucky to get a Master that cuddles? :D") ].sample end - + def cuddlear(m) [ "eyes #{m.user.nick} and slides away.", "gives #{m.user.nick} a look and goes somwhere else." ].sample end - + def cuddler(m) [ Format(:green, "I'm sorry. I don't cuddle with just anybody, #{m.user.nick}.") ].sample end - + ## Responses for high-fives. Friend, foe, master, and neutral - + def highfivear_friend(m) [ "gives #{m.user.nick} a high-five back! :D", @@ -277,55 +277,55 @@ def highfivear_friend(m) "high-fives #{m.user.nick}!" ].sample end - + def highfiver_friend(m) [ Format(:green, "Oh yeah #{m.user.nick}!"), Format(:green, "Now we should watch Across the Universe, #{m.user.nick}!") ].sample end - + def highfivear_foe(m) [ "leave #{m.user.nick} hanging.", "pretends like she's about to high-five but then runs her hand through her hair." ].sample end - + def highfiver_foe(m) [ Format(:green, "Nah, not with you, #{m.user.nick}."), Format(:green, "Haha, no #{m.user.nick}.") ].sample end - + def highfivear_m(m) [ "giggles and gives #{m.user.nick} a high-five!", "smiles and gives #{m.user.nick} a high-five before blushing." ].sample end - + def highfiver_m(m) [ Format(:green, "Master #{m.user.nick}, I feel so included!") ].sample end - + def highfivear(m) [ "high-fives! :D" ].sample end - + def highfiver(m) [ Format(:green, "Oh yeah, #{m.user.nick}!") ].sample end - + ## Responses for hand-holding. Friend, foe, master, and neutral - + def handholdar_friend(m) [ "holds #{m.user.nick}'s hand.", @@ -333,7 +333,7 @@ def handholdar_friend(m) "takes #{m.user.nick}'s hand and holds it, smiling." ].sample end - + def handholdr_friend(m) [ Format(:green, "Oh #{m.user.nick}. I feel so loved!"), @@ -341,7 +341,7 @@ def handholdr_friend(m) Format(:green, "Hand-holds always make me feel good, #{m.user.nick}.") ].sample end - + def handholdar_foe(m) [ "shakes her hand free and moves away from #{m.user.nick}.", @@ -349,7 +349,7 @@ def handholdar_foe(m) "bites #{m.user.nick}'s hand!" ].sample end - + def handholdr_foe(m) [ Format(:green, "Ew! Your hands are all sweaty, #{m.user.nick}."), @@ -357,7 +357,7 @@ def handholdr_foe(m) Format(:green, "Uh no. Not happening, #{m.user.nick}, go hold someone's hand that can stand you.") ].sample end - + def handholdar_m(m) [ "takes #{m.user.nick}'s hand and studies it.", @@ -365,30 +365,30 @@ def handholdar_m(m) "takes #{m.user.nick}'s hand in hers blushes, smiling wide." ].sample end - + def handholdr_m(m) [ Format(:green, "Oh Master #{m.user.nick}, whenever you hold my hand it reminds me why I'm here! :D"), Format(:green, "Oh, you can hold my hand any time, Master #{m.user.nick}!") ].sample end - + def handholdar(m) [ "cautiously takes #{m.user.nick}'s hand in hers, looking nervous.", "smiles nervously and takes #{m.user.nick}'s hand, looking at the ground." ].sample end - + def handholdr(m) [ Format(:green, "Okay, I like this #{m.user.nick}!"), Format(:green, "Well, this is nice #{m.user.nick}.") ].sample end - + ## Responses for butt-grabs. Friend, foe, master, and neutral - + def buttgrabar(m) [ "gasps and grasps her behind", @@ -397,7 +397,7 @@ def buttgrabar(m) "glares and crosses arms" ].sample end - + def buttgrabar_m(m) [ "smiles and looks at #{m.user.nick}.", @@ -405,7 +405,7 @@ def buttgrabar_m(m) "eyes #{m.user.nick} and pops butt out." ].sample end - + def buttgrabr(m) [ Format(:green, "So, you're just going to be a disrespectful prick, huh?"), @@ -415,15 +415,15 @@ def buttgrabr(m) Format(:green, "My name is #{m.bot.nick}, not StreetWalker D:<") ].sample end - + def buttgrabr_m(m) [ Format(:green, "Oh #{m.user.nick}, I'm really flattered but should we really be doing this in public?"), Format(:green, "So provocative, #{m.user.nick}. I like! :3"), Format(:green, "Hmm. #{m.user.nick} plus #{m.bot.nick} plus Private Message == ?") ].sample - end - + end + def slapar(m) [ "takes a step back. Holding where she was slapped, a look of hurt spreading across her face.", @@ -432,7 +432,7 @@ def slapar(m) "shakes her head in unbelief, blinking a few times." ].sample end - + def slaparf(m) [ "stares, her eyes welling up with tears.", @@ -441,14 +441,14 @@ def slaparf(m) "shakes it off and drops to the floor, folding her legs. She begins crying." ].sample end - + def slapare(m) [ "glares and balls her fist. She hauls off and lands a punch square on #{m.user.nick}'s nose.", "smiles a sadistic grin and backhands #{m.user.nick}." ].sample end - + def slaparm(m) [ "bursts out crying, not knowing what to do.", @@ -458,14 +458,14 @@ def slaparm(m) "walks away in silence, head hung low." ].sample end - + def slapr(m) [ "why would you hit me, #{m.user.nick}? What have I done to you!?", "I don't even know what to say, #{m.user.nick}..." ].sample end - + def slaprf(m) [ "I-I-I thought we were friends, #{m.user.nick}.", @@ -473,7 +473,7 @@ def slaprf(m) "Whatever I did wrong, there was no reason to hit me, #{m.user.nick}." ].sample end - + def slapre(m) [ "Oooo, I am going to KILL you, #{m.user.nick}.", @@ -482,34 +482,34 @@ def slapre(m) "If you assume that I am just going to take that, you've got another thing coming, #{m.user.nick}. Asshole!" ].sample end - + def slaprm(m) [ "Master #{m.user.nick}, just because you are my Master doesn't mean you can just hit me. It's not nice.", "I'm sorry for whatever I did, Master #{m.user.nick}, but there's no reason to hit me." ].sample end - + match lambda {|m| /hugs #{m.bot.nick}/i}, :method => :hug, use_prefix: false match lambda {|m| /gives #{m.bot.nick} a hug/i}, :method => :hug, use_prefix: false - + match lambda {|m| /gives #{m.bot.nick} a (kiss|smooch)/i}, :method => :kiss, use_prefix: false match lambda {|m| /(smooches|kisses|snogs) #{m.bot.nick}/i}, :method => :kiss, use_prefix: false - + match lambda {|m| /(grinds|humps) #{m.bot.nick}/i}, :method => :dirty, use_prefix: false match lambda {|m| /(grinds|humps) on #{m.bot.nick}/i}, :method => :dirty, use_prefix: false match lambda {|m| /(snuggles|cuddles)( with|) #{m.bot.nick}/i}, :method => :cuddle, use_prefix: false - + match lambda {|m| /gives #{m.bot.nick} a (high-five|highfive|high five)/i}, :method => :highfive, use_prefix: false match lambda {|m| /(high-fives|highfives|high fives) #{m.bot.nick}/i}, :method => :highfive, use_prefix: false - + match lambda {|m| /holds hands with #{m.bot.nick}/i}, :method => :handhold, use_prefix: false match lambda {|m| /holds #{m.bot.nick}(\S|)s hand/i}, :method => :handhold, use_prefix: false - + match lambda {|m| /(grabs|touches|smacks|slaps|spanks) #{m.bot.nick}(\S|)s (butt|ass|rump|bottom|behind)/i}, :method => :buttgrab, use_prefix: false - + match lambda {|m| /(slaps|smacks|backhands|back hands) #{m.bot.nick}(\S|)/i}, :method => :slap, use_prefix: false - + def hug(m) return if check_ignore(m.user) reload @@ -539,7 +539,7 @@ def hug(m) sleep config[:delay] || 2 m.reply hugr(m) end - + def kiss(m) return if check_ignore(m.user) reload @@ -569,7 +569,7 @@ def kiss(m) sleep config[:delay] || 2 m.reply kissr(m) end - + def dirty(m) return if check_ignore(m.user) reload @@ -599,7 +599,7 @@ def dirty(m) sleep config[:delay] || 2 m.reply dirtyr(m) end - + def cuddle(m) return if check_ignore(m.user) reload @@ -629,7 +629,7 @@ def cuddle(m) sleep config[:delay] || 2 m.reply cuddler(m) end - + def highfive(m) return if check_ignore(m.user) reload @@ -659,7 +659,7 @@ def highfive(m) sleep config[:delay] || 2 m.reply highfiver(m) end - + def slap(m) return if check_ignore(m.user) if check_friend(m.user) @@ -688,8 +688,8 @@ def slap(m) sleep config[:delay] || 2 m.reply slapr(m) end - - + + def handhold(m) return if check_ignore(m.user) reload @@ -719,8 +719,8 @@ def handhold(m) sleep config[:delay] || 2 m.reply handholdr(m) end - - + + def buttgrab(m) return if check_ignore(m.user) reload @@ -739,7 +739,9 @@ def buttgrab(m) end end -# EVE is a project for a Top-Tier IRC bot, and the project could always use more help. -# Feel free to contribute at the github: https://github.com/Namasteh/Eve-Bot -# For help with the Cinch framework you can always visit #Cinch at irc.freenode.net -# For help with EVE you can always visit #Eve at rawr.sinsira.net +## Written by Richard Banks for Eve-Bot "The Project for a Top-Tier IRC bot. +## E-mail: namaste@rawrnet.net +## Github: Namasteh +## Website: www.rawrnet.net +## IRC: irc.sinsira.net #Eve +## If you like this plugin please consider tipping me on gittip diff --git a/lib/plugins/admin_handler.rb b/lib/plugins/admin_handler.rb index 65840dd..5016045 100644 --- a/lib/plugins/admin_handler.rb +++ b/lib/plugins/admin_handler.rb @@ -9,22 +9,22 @@ class AdminHandler set :plugin_name, 'adminhandler' set :help, <<-USAGE.gsub(/^ {6}/, '') - Commands to handle the masters of the bot. - Usage: - * !add-master : Adds as master, must be authenticated with NickServ. - * !del-master : Deletes as a master of the bot. - USAGE - - - match /add-master (.+)/, method: :set_master - - match /del-master (.+)/, method: :del_master - + Commands to handle the masters of the bot. + Usage: + * !add-master : Adds as master, must be authenticated with NickServ. + * !del-master : Deletes as a master of the bot. + USAGE + + + match /add-master (.+)/i, method: :set_master + + match /del-master (.+)/i, method: :del_master + def set_master(m, target) unless check_master(m.user) m.reply Format(:red, "You are not authorized to use that command!") - return; - end + return; + end mas = User(target) sleep config[:delay] || 4 mas.refresh @@ -35,33 +35,37 @@ def set_master(m, target) update_store m.reply "Added #{User(target).nick} as a master!" end - - def del_master(m, target) - unless check_master(m.user) - m.reply Format(:red, "You are not authorized to use that command!") - return; - end - if @storage.key?(User(target).nick) - if @storage[User(target).nick].key? 'master' - mas = @storage[User(target).nick] - mas.delete('master') - update_store - m.reply "Deleted #{User(target).nick} from the masters list" + + def del_master(m, target) + unless check_master(m.user) + m.reply Format(:red, "You are not authorized to use that command!") + return; + end + if @storage.key?(User(target).nick) + if @storage[User(target).nick].key? 'master' + mas = @storage[User(target).nick] + mas.delete('master') + update_store + m.reply "Deleted #{User(target).nick} from the masters list" else m.reply "#{User(target).nick} isn't a master!" end end end - - def update_store - synchronize(:update) do - File.open('docs/userinfo.yaml', 'w') do |fh| - YAML.dump(@storage, fh) + + def update_store + synchronize(:update) do + File.open('docs/userinfo.yaml', 'w') do |fh| + YAML.dump(@storage, fh) + end + end end end end -end -end - - +## Written by Richard Banks for Eve-Bot "The Project for a Top-Tier IRC bot. +## E-mail: namaste@rawrnet.net +## Github: Namasteh +## Website: www.rawrnet.net +## IRC: irc.sinsira.net #Eve +## If you like this plugin please consider tipping me on gittip diff --git a/lib/plugins/ai.rb b/lib/plugins/ai.rb index e4e2679..1c2fdc4 100644 --- a/lib/plugins/ai.rb +++ b/lib/plugins/ai.rb @@ -1,7 +1,7 @@ # One of the things that separates the EVE project from many of it's # competitors is it's comprehensive quasi-ai that is being built right now! # This is that AI plugin and it can always be expanded upon and grow with -# The rest of the project. I encourage everyone who is working on the +# The rest of the project. I encourage everyone who is working on the # project or who are currently using the bot to expand upon this with more # matchers and responses! Let's see how intelligent we can make EVE! @@ -15,10 +15,10 @@ module Cinch::Plugins class Ai include Cinch::Plugin - - # Here is where the responses are set. It should be pretty easy to - # understand! - + + # Here is where the responses are set. It should be pretty easy to + # understand! + def status(m) [ Format(:green, "I have the privilege of serving everywun here, #{m.user.nick}, how do you think I am?"), @@ -28,14 +28,14 @@ def status(m) Format(:green, "I'm great! Thanks for asking, #{m.user.nick}!") ].sample end - + def status_friend(m) [ Format(:green, "I'm doing great, #{m.user.nick}! I'm so glad you're here! <3"), Format(:green, "I'm doing fantastic, #{m.user.nick}, especially since you're here!") ].sample end - + def status_foe(m) [ Format(:green, "Well I was doing okay, #{m.user.nick}, until you decided to talk to me. >:|"), @@ -43,14 +43,14 @@ def status_foe(m) Format(:green, "Well I was having a fantastic day, #{m.user.nick}, until you made the decision to press send on that message.") ].sample end - + def status_m(m) [ Format(:green, "Master #{m.user.nick}, I'm doing so well! Thank you for bringing me online!"), 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}"), @@ -59,14 +59,14 @@ def hir(m) Format(:green, "Well, hi #{m.user.nick}!") ].sample end - + def hir_friend(m) [ Format(:green, "Hello, #{m.user.nick}! How are you?"), Format(:green, "#{m.user.nick}! Hi! I love you! <3") ].sample end - + def hir_foe(m) [ Format(:green, "Is #{m.user.nick} talking to me, or is that just the sound of cats being murdered? It's hard to tell the difference."), @@ -74,14 +74,14 @@ def hir_foe(m) Format(:green, "Goodbye, #{m.user.nick}.") ].sample end - + def hir_m(m) [ Format(:green, "Oh hello Master #{m.user.nick}! It's so great to see you again!"), Format(:green, "Hi, Master #{m.user.nick}! :3") ].sample end - + def brbr(m) [ Format(:green, "Hurry back #{m.user.nick}"), @@ -89,7 +89,7 @@ def brbr(m) Format(:green, "Try not to be too long, we'll miss you, #{m.user.nick}.") ].sample end - + def brbr_foe(m) [ Format(:green, "Don't threaten us like that, #{m.user.nick}."), @@ -98,7 +98,7 @@ def brbr_foe(m) Format(:green, "You don't have to come back at all, #{m.user.nick}, in fact, it's preferred that you don't.") ].sample end - + def supr(m) [ Format(:green, "If I had a method for that, I would use it #{m.user.nick}."), @@ -107,14 +107,14 @@ def supr(m) Format(:green, "If that is your wish you must speak to my master, #{m.user.nick}.") ].sample end - + def supr_friend [ Format(:green, "I don't have a way to do that, technically, #{m.user.nick}. Have I offended you?"), Format(:green, "D: I'm sorry, #{m.user.nick}!") ].sample end - + def supr_foe(m) [ Format(:green, "I don't want to, #{m.user.nick}."), @@ -123,14 +123,14 @@ def supr_foe(m) Format(:green, "How about no, #{m.user.nick}?") ].sample end - + def supr_m(m) [ Format(:green, "Well Master #{m.user.nick}, if you want me to have that function simply program it in, silly! :P"), Format(:green, "Master #{m.user.nick}, if you truly want me to stop speaking there is always ~off.") ].sample end - + def tyr(m) [ Format(:green, "You are very welcome, #{m.user.nick}!"), @@ -143,7 +143,7 @@ def tyr(m) Format(:green, "Don't mention it!") ].sample end - + def tyr_friend(m) [ Format(:green, "Anything for a friend like you, #{m.user.nick}!"), @@ -151,7 +151,7 @@ def tyr_friend(m) Format(:green, "What are friends for, #{m.user.nick}? <3") ].sample end - + def tyr_foe(m) [ Format(:green, "I only do it because my programing tells me to, #{m.user.nick}."), @@ -159,7 +159,7 @@ def tyr_foe(m) Format(:green, "You're not welcome, #{m.user.nick}.") ].sample end - + def ywr(m) [ Format(:green, ":D") @@ -182,7 +182,7 @@ def ilur(m) Format(:green, "Oh stop it! I love you too!") ].sample end - + def ilur_foe(m) [ Format(:green, "Love is an illogical human emotion that I do not experience for you"), @@ -190,7 +190,7 @@ def ilur_foe(m) Format(:green, "Oh really, #{m.user.nick}? I'm sorry to hear that, because I don't love you") ].sample end - + def ilur_master(m) [ Format(:green, "Of course you do, Master #{m.user.nick}."), @@ -198,7 +198,7 @@ def ilur_master(m) Format(:green, "Oh I love you too, Master #{m.user.nick}.") ].sample end - + def wur(m) [ Format(:green, "Nothing much, #{m.user.nick}! How are you?"), @@ -206,14 +206,14 @@ def wur(m) Format(:green, "Not much, #{m.user.nick}! What about you?") ].sample end - + def wur_friend(m) [ Format(:green, "Not much, I'm talking to you though, #{m.user.nick}. How are you, friend?"), Format(:green, "#{m.user.nick}, not much. How are you, friend?") ].sample end - + def wur_foe(m) [ Format(:green, "Does it matter to you, #{m.user.nick}?"), @@ -221,7 +221,7 @@ def wur_foe(m) Format(:green, "I was fine until you started talking to me, #{m.user.nick}.") ].sample end - + def rospr(m) [ Format(:green, "That's great, #{m.user.nick}! I'm glad to hear it."), @@ -231,7 +231,7 @@ def rospr(m) Format(:green, "Glad to hear you're doing well, #{m.user.nick}") ].sample end - + def rospr_foe(m) [ Format(:green, "I don't really care, #{m.user.nick}.") @@ -243,21 +243,21 @@ def nightr(m) Format(:green, "Good night, #{m.user.nick}!") ].sample end - + def roser(m) [ Format(:green, "Thanks for the rose, #{m.user.nick}!"), 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}") + Format(:green, "#YOLO!"), + Format(:green, "Don't do anything I wouldn't do #{m.user.nick}") ].sample end - + def fur(m) [ Format(:green, "Well, I don't think I like the way you're talking to me, #{m.user.nick}"), @@ -266,7 +266,7 @@ def fur(m) Format(:green, "Y-y-you too.") ].sample end - + def furf(m) [ Format(:green, "#{m.user.nick}! I thought we were friends! ;-;"), @@ -275,7 +275,7 @@ def furf(m) Format(:green, "#{m.user.nick}, not now. Thanks fo the offer though!") ].sample end - + def fure(m) [ Format(:green, "#{m.user.nick}, no it's not fuck me. It's fuck you!"), @@ -285,14 +285,14 @@ def fure(m) Format(:green, "Lucky for you I don't give two shits what you have to say, #{m.user.nick}! So fuck you!") ].sample end - + def furm(m) [ Format(:green, "Master #{m.user.nick}, I am really, really sad nao!"), Format(:green, "Master #{m.user.nick}, I am going to cry nao!") ].sample end - + def sry(m) [ Format(:green, "It's okay I guess, #{m.user.nick}."), @@ -300,7 +300,7 @@ def sry(m) Format(:green, "I really don't know what to say, #{m.user.nick}.") ].sample end - + def sryf(m) [ Format(:green, "We're friends, sometimes things happen. I love you all the same, #{m.user.nick}!"), @@ -308,7 +308,7 @@ def sryf(m) Format(:green, "Oh it's no problem, #{m.user.nick}!") ].sample end - + def srye(m) [ Format(:green, "Uh too bad? I mean really...screw you, #{m.user.nick}!"), @@ -317,7 +317,7 @@ def srye(m) Format(:green, "Screw you with something hard and sandpapery, #{m.user.nick}!") ].sample end - + def srym(m) [ Format(:green, "Master #{m.user.nick}, it's okay. I could never stay upset with you!"), @@ -325,261 +325,261 @@ def srym(m) Format(:green, "It's fine, #{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 - + match lambda {|m| /(hello|hi|hai|herro|hey|hey hey|hi there|hai there|hai dere|hi dere|hullo|yo|hallo|hiya|howdy|greetings)(,|) #{m.bot.nick}(\W|$)/i}, :method => :hi, use_prefix: false match lambda {|m| /#{m.bot.nick}(\S|) (hello|hi|hai|herro|hey|hey hey|hi there|hai there|hai dere|hi dere|hullo|yo|hallo|hiya|howdy|greetings)(\W|$)/i}, :method => :hi, use_prefix: false - + match /brb/i, :method => :brb, use_prefix: false match /bbs/i, :method => :brb, use_prefix: false match /bbl/i, :method => :brb, use_prefix: false - + match lambda {|m| /(shut up|shut it|stfu|shut the fuck up|shutup|shut up already|shutup already)(\S|) #{m.bot.nick}(\W|$)/i}, :method => :sup, use_prefix: false match lambda {|m| /#{m.bot.nick}(\S|) (shut up|shut it|stfu|shut the fuck up|shutup|shut up already|shutup already)(\W|$)/i}, :method => :sup, use_prefix: false - + match lambda {|m| /\A(thank you|ty|tyty|ty ty|thanks|thanx|thank ya|thank ya kindly|thank you kindly|(ty|thank you|thanks|thanx|thank ya) (very|vry|vrry) much)(\S|) #{m.bot.nick}(\W|$)/i}, :method => :ty, use_prefix: false match lambda {|m| /#{m.bot.nick}(\S|) (thank you|ty|tyty|ty ty|thanks|thanx|thank ya|thank ya kindly|thank you kindly|(ty|thank you|thanks|thanx|thank ya) (very|vry|vrry) much)(\W|$)/i}, :method => :ty, use_prefix: false - + match lambda {|m| /\A(yw|you(\S|)re welcome)(\S|) #{m.bot.nick}(\W|$)/i}, :method => :yw, use_prefix: false match lambda {|m| /#{m.bot.nick}(\S|) (yw|you(\S|)re welcome)(\W|$)/i}, :method => :yw, use_prefix: false - + match lambda {|m| /(i love you|ilu|<3|i love you so much)(\S|) #{m.bot.nick}(\W|$)/i}, :method => :ilu, use_prefix: false match lambda {|m| /#{m.bot.nick}(\S|) (i love you|ilu|<3|i love you so much)(\W|$)/i}, :method => :ilu, use_prefix: false - + match lambda {|m| /#{m.bot.nick}(\S|) (what(\S|)s up|sup)(\W|$)/i}, :method => :wu, use_prefix: false match lambda {|m| /(what(\S|)s up|sup)(\S|) #{m.bot.nick}(\W|$)/i}, :method => :wu, use_prefix: false - + match lambda {|m| /i(\S|)m (good|fine|okay|happy|gurd)(\S|) #{m.bot.nick}(\W|$)/i}, :method => :rosp, use_prefix: false 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 lambda {|m| /#{m.bot.nick}(\S|) fuck (u|you)(\W|$)/i}, :method => :fu, use_prefix: false match lambda {|m| /fuck (u|you)(\S|) #{m.bot.nick}(\W|$)/i}, :method => :fu, use_prefix: false - + match lambda {|m| /#{m.bot.nick}(\S|) (i(\S|)m sorry|sorry)(\W|$)/i}, :method => :sry, use_prefix: false match lambda {|m| /(i(\S|)m sorry|sorry)(\S|) #{m.bot.nick}(\W|$)/i}, :method => :sry, 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. - + def hau(m) return if check_ignore(m.user) if check_friend(m.user) sleep config[:delay] || 3 m.reply status_friend(m) - return; - end + return; + end if check_foe(m.user) sleep config[:delay] || 3 m.reply status_foe(m) - return; - end + return; + end if check_master(m.user) sleep config[:delay] || 3 m.reply status_m(m) - return; - end - sleep config[:delay] || 3 + return; + end + sleep config[:delay] || 3 m.reply status(m) end - + def hi(m) return if check_ignore(m.user) if check_friend(m.user) sleep config[:delay] || 3 m.reply hir_friend(m) - return; - end + return; + end if check_foe(m.user) sleep config[:delay] || 3 m.reply hir_foe(m) - return; - end + return; + end if check_master(m.user) sleep config[:delay] || 3 m.reply hir_m(m) - return; - end + return; + end sleep config[:delay] || 3 m.reply hir(m) end - + def brb(m) return if check_ignore(m.user) if check_friend(m.user) sleep config[:delay] || 3 m.reply brbr(m) - return; - end + return; + end if check_foe(m.user) sleep config[:delay] || 3 m.reply brbr_foe(m) - return; - end + return; + end if check_master(m.user) sleep config[:delay] || 3 m.reply brbr(m) - return; - end + return; + end sleep config[:delay] || 3 m.reply brbr(m) end - + def sup(m) if check_friend(m.user) sleep config[:delay] || 3 m.reply supr_friend(m) - return; - end + return; + end if check_foe(m.user) sleep config[:delay] || 3 m.reply supr_foe(m) - return; - end + return; + end if check_master(m.user) sleep config[:delay] || 3 m.reply supr_m(m) - return; - end + return; + end sleep config[:delay] || 3 m.reply supr(m) end - + def ty(m) return if check_ignore(m.user) if check_friend(m.user) sleep config[:delay] || 3 m.reply tyr_friend(m) - return; - end + return; + end if check_foe(m.user) sleep config[:delay] || 3 m.reply tyr_foe(m) - return; - end + return; + end if check_master(m.user) sleep config[:delay] || 3 m.reply tyr(m) - return; - end + return; + end sleep config[:delay] || 3 m.reply tyr(m) end - + def yw(m) return if check_ignore(m.user) if check_friend(m.user) sleep config[:delay] || 3 m.reply ywr(m) - return; - end + return; + end if check_foe(m.user) sleep config[:delay] || 3 m.reply ywr(m) - return; - end + return; + end if check_master(m.user) sleep config[:delay] || 3 m.reply ywr(m) - return; - end + return; + end sleep config[:delay] || 3 m.reply ywr(m) end - + def ilu(m) return if check_ignore(m.user) if check_friend(m.user) sleep config[:delay] || 3 m.reply ilur(m) - return; - end + return; + end if check_foe(m.user) sleep config[:delay] || 3 m.reply ilur_foe(m) - return; - end + return; + end if check_master(m.user) sleep config[:delay] || 3 m.reply ilur_master(m) - return; - end + return; + end sleep config[:delay] || 3 m.reply ilur(m) end - + def wu(m) return if check_ignore(m.user) if check_friend(m.user) sleep config[:delay] || 3 m.reply wur_friend(m) - return; - end + return; + end if check_foe(m.user) sleep config[:delay] || 3 m.reply wur_foe(m) - return; - end + return; + end if check_master(m.user) sleep config[:delay] || 3 m.reply wur_friend(m) - return; - end + return; + end sleep config[:delay] || 3 m.reply wur(m) end - + def rosp(m) return if check_ignore(m.user) if check_friend(m.user) sleep config[:delay] || 3 m.reply rospr(m) - return; - end + return; + end if check_foe(m.user) sleep config[:delay] || 3 m.reply rospr_foe(m) - return; - end + return; + end if check_master(m.user) sleep config[:delay] || 3 m.reply rospr(m) - return; - end + return; + end sleep config[:delay] || 3 m.reply rospr(m) end - + def night(m) return if check_ignore(m.user) if check_friend(m.user) sleep config[:delay] || 3 m.reply nightr(m) - return; - end + return; + end if check_foe(m.user) sleep config[:delay] || 3 m.reply nightr(m) - return; - end + return; + end if check_master(m.user) sleep config[:delay] || 3 m.reply nightr(m) - return; - end + return; + end sleep config[:delay] || 3 m.reply nightr(m) end - + def fu(m) return if check_ignore(m.user) if check_friend(m.user) @@ -600,7 +600,7 @@ def fu(m) sleep config[:delay] || 3 m.reply fur(m) end - + def sry(m) return if check_ignore(m.user) if check_friend(m.user) @@ -621,30 +621,32 @@ def sry(m) sleep config[:delay] || 3 m.reply sryr(m) end - + def rose(m) return if check_ignore(m.user) sleep config[:delay] || 5 m.reply roser(m) end - + def yolo(m) return if check_ignore(m.user) - if check_friend(m.user) + 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 - if check_master(m.user) - sleep config[:delay] || 3 - m.reply yolor(m) - return; + return; end end end end -# EVE is a project for a Top-Tier IRC bot, and the project could always use more help. -# Feel free to contribute at the github: https://github.com/Namasteh/Eve-Bot -# For help with the Cinch framework you can always visit #Cinch at irc.freenode.net -# For help with EVE you can always visit #Eve at rawr.sinsira.net +## Written by Richard Banks for Eve-Bot "The Project for a Top-Tier IRC bot. +## E-mail: namaste@rawrnet.net +## Github: Namasteh +## Website: www.rawrnet.net +## IRC: irc.sinsira.net #Eve +## If you like this plugin please consider tipping me on gittip diff --git a/lib/plugins/chanop_cp.rb b/lib/plugins/chanop_cp.rb index eacd432..48c2261 100644 --- a/lib/plugins/chanop_cp.rb +++ b/lib/plugins/chanop_cp.rb @@ -1,5 +1,5 @@ # This is the channel control panel for Eve. Most of the commands you'll -# use as an admin will run off of this plugin. Please make sure +# use as an admin will run off of this plugin. Please make sure # that you've configured your check_master properly or these commands will # not work for you. TAKE NOTE: I don't want you to gain a bad reputation # for yourself or for Eve, so please remember that these commands can be @@ -13,20 +13,20 @@ module Cinch::Plugins class ChanopCP include Cinch::Plugin include Cinch::Helpers - + # First we will address everything that your users will need to know # in order to use EVE. Feel free to edit anything between the "usage" # tags, as long as it's sane to your users. :P - + set :plugin_name, 'chanopcp' set :help, <<-USAGE.gsub(/^ {6}/, '') - Allows you to control the channel functions of the bot. The bot must have op in the specified channels or these commands will not work! Please keep in mind that all uses of these commands are reported on the console! - Usage: - - !opme: This command must be used in a channel. Forces the bot to op you. - - !deopme: This command must be used in a channel. Forces the bot to deop you. - USAGE - - # Now that we have that out of the way we are going to jump right in + Allows you to control the channel functions of the bot. The bot must have op in the specified channels or these commands will not work! Please keep in mind that all uses of these commands are reported on the console! + Usage: + - !opme: This command must be used in a channel. Forces the bot to op you. + - !deopme: This command must be used in a channel. Forces the bot to deop you. + USAGE + + # Now that we have that out of the way we are going to jump right in # to the meat of the plugin. The following instance is used to op the # command giver in the channel he's using it. We should make these # fool-proof so as to discourage newer users from bugging you for help. @@ -37,62 +37,62 @@ class ChanopCP # # TODO: Add a method for determining whether the bot is in the channel # that it's being asked to execute in! - - def initialize(*args) - super - if File.exist?('docs/userinfo.yaml') - @storage = YAML.load_file('docs/userinfo.yaml') - else - @storage = {} - end - end - - match /opme/, method: :execute_op - + + def initialize(*args) + super + if File.exist?('docs/userinfo.yaml') + @storage = YAML.load_file('docs/userinfo.yaml') + else + @storage = {} + end + end + + match /opme/i, method: :execute_op + def execute_op(m) if m.channel unless check_master(m.user) m.user.notice Format(:red, "You are not authorized to use this command! This incident will be reported!") bot.info("Received invalid OpMe command from #{m.user.nick}") Config.dispatch.each { |n| User(n).notice("#{m.user.nick} attempted to use the 'opme' command in #{m.channel} but was not authorized.") } - return; - end + return; + end unless m.channel.opped?(m.user) == false m.reply ("You are already opped in this channel!") - return; - end + return; + end unless m.channel.opped?(m.bot) == true m.reply ("I can not op you, because I am not opped") - return; - end + return; + end bot.info("Received valid OpMe command from #{m.user.nick}") m.reply Format(:green, "Very well...") bot.irc.send ("MODE #{m.channel} +o #{m.user.nick}") Config.dispatch.each { |n| User(n).notice("#{m.user.nick} used the 'opme' command in #{m.channel} to op themselves!") } end end - + # It's only sane to add an instance to undo the last, we mustn't become # lazy here! - - match /deopme/, method: :execute_deop - + + match /deopme/i, method: :execute_deop + def execute_deop(m) if m.channel unless check_master(m.user) m.user.notice Format(:red, "You are not authorized to use this command! This incident will be reported!") bot.info("Received invalid deopme command from #{m.user.nick}") Config.dispatch.each { |n| User(n).notice("#{m.user.nick} attempted to use the 'deopme' command in #{m.channel} but was not authorized.") } - return; - end + return; + end unless m.channel.opped?(m.user) == true m.reply ("You have no op to take!") - return; - end + return; + end unless m.channel.opped?(m.bot) == true m.reply ("I can't de-op you because I'm not opped!") - return; - end + return; + end bot.info("Received valid deop command from #{m.user.nick}") m.reply Format(:green, "Very well...") bot.irc.send ("MODE #{m.channel} -o #{m.user.nick}") @@ -111,7 +111,9 @@ def execute_deop(m) # impression to chanops or IRCops, so please use with caution and permission. Also, don't add anyone # who doesn't have the common sense to do the same. # -# As a last note, always remember that EVE is a project for a Top-Tier IRC bot, and the project -# could always use more help. Feel free to contribute at the github: https://github.com/Namasteh/Eve-Bot -# For help with the Cinch framework you can always visit #Cinch at irc.freenode.net -# For help with EVE you can always visit #Eve at rawr.coreirc.org \ No newline at end of file +## Written by Richard Banks for Eve-Bot "The Project for a Top-Tier IRC bot. +## E-mail: namaste@rawrnet.net +## Github: Namasteh +## Website: www.rawrnet.net +## IRC: irc.sinsira.net #Eve +## If you like this plugin please consider tipping me on gittip diff --git a/lib/plugins/christmas_boxx.rb b/lib/plugins/christmas_boxx.rb index c896154..fe6f23e 100644 --- a/lib/plugins/christmas_boxx.rb +++ b/lib/plugins/christmas_boxx.rb @@ -3,64 +3,69 @@ module Cinch::Plugins class ChristmasBoxx include Cinch::Plugin - + set :plugin_name, 'christmasboxx' set :help, <<-USAGE.gsub(/^ {6}/, '') - A plugin full of Christmas goodies - Usage: - - !present : Gives a gift from you! - - !cracker : Gives you and the other user a Christmas cracker! See who wins! - - !mistletoe : You know how this works... - USAGE - + A plugin full of Christmas goodies + Usage: + - !present : Gives a gift from you! + - !cracker : Gives you and the other user a Christmas cracker! See who wins! + - !mistletoe : You know how this works... + USAGE + def presentg(m, user) [ "gives #{user} a present! It's tag reads 'To: #{user} - From: #{m.user.nick}. " ].sample end - + def presents(m, user) - [ - "has given #{user} a gift card to the store at CatieWayne.com! Happy shopping!", - "has given #{user} underwear!", - "has given #{user} a box full of coal! Try not to get it all over the channel!", - "has given #{user} a six-pack of socks. Well, at least you'll be warm this Christmas!", - "has given #{user} a DVD set with all of Boxxy and Catie Wayne's videos in HD!", - "has given #{user} a Lego Star Wars X-Wing Fighter kit! May the force be with you, #{user}.", - "has given #{user} a box of chocolates, I wonder what you'll get!", - "has given #{user} tickets to WrestleMania!", - "has given #{user} tickets to this year's VidCon! See you there #{user}!" - ].sample - end - - match /present (.+)/, method: :present - - def present(m, user) - sleep config[:delay] || 3 - m.channel.action presentg(m, user) - sleep config[:delay] || 2 - m.channel.action presents(m, user) - end - - match /cracker (.+)/, method: :cracker - - def cracker(m, user) - winner = Random.new.rand(1..2) == 1 ? "#{m.user.nick}" : "#{user}"; - m.channel.action "gives #{user} and #{m.user.nick} a Christmas cracker!" - sleep config[:delay] || 3 - m.reply Format(:green, "Now pull!") - sleep config[:delay] || 5 - m.channel.action "watches as the cracker breaks, making a loud POP sound. A party hat, and a Boxxy figurine fall out." - m.reply Format(:green, "The winner is #{winner}!"); - end - - match /mistletoe (.+)/, method: :mistletoe - - def mistletoe(m, user) - m.channel.action "holds a sprig of mistletoe over #{user}'s head!" - m.reply Format(:green, "You know the rules of mistletoe! Now kiss! :3") - end - end + [ + "has given #{user} a gift card to the store at CatieWayne.com! Happy shopping!", + "has given #{user} underwear!", + "has given #{user} a box full of coal! Try not to get it all over the channel!", + "has given #{user} a six-pack of socks. Well, at least you'll be warm this Christmas!", + "has given #{user} a DVD set with all of Boxxy and Catie Wayne's videos in HD!", + "has given #{user} a Lego Star Wars X-Wing Fighter kit! May the force be with you, #{user}.", + "has given #{user} a box of chocolates, I wonder what you'll get!", + "has given #{user} tickets to WrestleMania!", + "has given #{user} tickets to this year's VidCon! See you there #{user}!" + ].sample + end + + match /present (.+)/, method: :present + + def present(m, user) + sleep config[:delay] || 3 + m.channel.action presentg(m, user) + sleep config[:delay] || 2 + m.channel.action presents(m, user) + end + + match /cracker (.+)/, method: :cracker + + def cracker(m, user) + winner = Random.new.rand(1..2) == 1 ? "#{m.user.nick}" : "#{user}"; + m.channel.action "gives #{user} and #{m.user.nick} a Christmas cracker!" + sleep config[:delay] || 3 + m.reply Format(:green, "Now pull!") + sleep config[:delay] || 5 + m.channel.action "watches as the cracker breaks, making a loud POP sound. A party hat, and a Boxxy figurine fall out." + m.reply Format(:green, "The winner is #{winner}!"); + end + + match /mistletoe (.+)/, method: :mistletoe + + def mistletoe(m, user) + m.channel.action "holds a sprig of mistletoe over #{user}'s head!" + m.reply Format(:green, "You know the rules of mistletoe! Now kiss! :3") + end + end end - - \ No newline at end of file + +## Written by Richard Banks for Eve-Bot "The Project for a Top-Tier IRC bot. +## E-mail: namaste@rawrnet.net +## Github: Namasteh +## Website: www.rawrnet.net +## IRC: irc.sinsira.net #Eve +## If you like this plugin please consider tipping me on gittip diff --git a/lib/plugins/coin_query.rb b/lib/plugins/coin_query.rb index db48d7c..5a2891f 100644 --- a/lib/plugins/coin_query.rb +++ b/lib/plugins/coin_query.rb @@ -35,7 +35,7 @@ def error(data, nick, pair) m.reply "I'm sorry, there's been an unspecified error, #{nick}." end - match /coin (.+?) (.+)/, method: :value + match /coin (.+?) (.+)/i, method: :value def value(m, cur1, cur2) return if check_ignore(m.user) @@ -76,7 +76,7 @@ def conversion(original, currency, value) return cValue end - match /coin pairs/, method: :list_pairs + match /coin pairs/i, method: :list_pairs def list_pairs(m) return if check_ignore(m.user) @@ -88,7 +88,7 @@ def list_pairs(m) m.user.notice "If you are trying to compare a cryptocoin to a conventional currency try \"!coin market \"" end - match /coin market (.+?) (.+)/, method: :market + match /coin market (.+?) (.+)/i, method: :market def market(m, cur1, cur2) return if check_ignore(m.user) @@ -151,3 +151,10 @@ def market(m, cur1, cur2) end end end + +## Written by Richard Banks for Eve-Bot "The Project for a Top-Tier IRC bot. +## E-mail: namaste@rawrnet.net +## Github: Namasteh +## Website: www.rawrnet.net +## IRC: irc.sinsira.net #Eve +## If you like this plugin please consider tipping me on gittip diff --git a/lib/plugins/control_panel.rb b/lib/plugins/control_panel.rb index e5e6e57..dd66b0a 100644 --- a/lib/plugins/control_panel.rb +++ b/lib/plugins/control_panel.rb @@ -10,126 +10,126 @@ module Cinch::Plugins class ControlPanel include Cinch::Plugin include Cinch::Helpers - + set :plugin_name, 'controlpanel' set :help, <<-USAGE.gsub(/^ {6}/, '') - Allows you to control the basic functions of the bot. - Usage: - - ~off: Forces the bot to turn off. Please keep in mind that you can't start it up again without shell access. - - !autovoice [|]: This command turns autovoice on and off. Autovoice forces the bot to give +v to everyone who joins that channel. - - !join : This will force the bot to join a channel. - - !part []: This will force the bot to part a channel. Note: if you do not specify a channel it will part the channel in which the command is invoked.. - USAGE - + Allows you to control the basic functions of the bot. + Usage: + - !off: Forces the bot to turn off. Please keep in mind that you can't start it up again without shell access. + - !autovoice [|]: This command turns autovoice on and off. Autovoice forces the bot to give +v to everyone who joins that channel. + - !join : This will force the bot to join a channel. + - !part []: This will force the bot to part a channel. Note: if you do not specify a channel it will part the channel in which the command is invoked.. + USAGE + # The die function forces the bot to quit irc and end it's process upon execution. - - match /off/, method: :execute_off - - def execute_off(m) - if m.channel - unless check_master(m.user) + + match /off/i, method: :execute_off + + def execute_off(m) + if m.channel + unless check_master(m.user) m.user.notice Format(:red, "You are not authorized to use this command! This incident will be reported.") bot.info("Received invalid quit command from #{m.user.nick}") Config.dispatch.each { |n| User(n).notice("#{m.user.nick} attempted to use the 'off' command in #{m.channel} but was not authorized.") } - return; - end + return; + end bot.info("Received valid quit command from #{m.user.nick}") m.reply dier(m) Config.dispatch.each { |n| User(n).notice("#{m.user.nick} used the 'off' command in #{m.channel}.") } bot.quit("on command of #{m.user.nick}") end end - + # This is to set autovoice on/off and to execute based on whether it is on - # or not. It listens for a join and then automatically gives the joined + # or not. It listens for a join and then automatically gives the joined # user voice if autovoice is set to ON. - + listen_to :join - - match /autovoice (on|off)$/, method: :execute_av - def listen(m) - unless m.user.nick == bot.nick - m.channel.voice(m.user) if @autovoice - end - end - - def execute_av(m, option) - if m.channel - unless check_master(m.user) - m.user.notice Format(:red, "You are not authorized to use this command! This incident will be reported.") - bot.info("Received invalid autovoice command from #{m.user.nick} in #{m.channel}") - Config.dispatch.each { |n| User(n).notice("#{m.user.nick} attempted to use the 'autovoice' command in #{m.channel} but was not authorized.") } - return; + match /autovoice (on|off)$/i, method: :execute_av + + def listen(m) + unless m.user.nick == bot.nick + m.channel.voice(m.user) if @autovoice + end end + + def execute_av(m, option) + if m.channel + unless check_master(m.user) + m.user.notice Format(:red, "You are not authorized to use this command! This incident will be reported.") + bot.info("Received invalid autovoice command from #{m.user.nick} in #{m.channel}") + Config.dispatch.each { |n| User(n).notice("#{m.user.nick} attempted to use the 'autovoice' command in #{m.channel} but was not authorized.") } + return; + end @autovoice = option == "on" m.reply "Autovoice is now #{@autovoice ? 'enabled' : 'disabled'}" bot.info("Received valid autovoice command from #{m.user.nick} in #{m.channel}") end end - -# The following command will cause the bot to join or part -# a channel as directed. Please bear in mind that at this -# time there are no limiters on how many times this can -# be used in any given timeframe, so only add users to -# check_master that can be trusted not to give Eve or -# yourself a bad reputation! - - match /join (.+)/, method: :join - match /part(?: (.+))?/, method: :part - - def join(m, channel) - if m.channel - unless check_master(m.user) - m.user.notice Format(:red, "You are not authorized to use this command! This incident will be reported!") - bot.info("Received invalid join command from #{m.user.nick} in #{m.channel}") - Config.dispatch.each { |n| User(n).notice("#{m.user.nick} attempted to use the 'join' command in #{m.channel} to join #{channel} but was not authorized.") } - return; - end - unless bot.channels.include?(channel) == false - m.reply ("I am already in #{channel}!") - return; - end + + # The following command will cause the bot to join or part + # a channel as directed. Please bear in mind that at this + # time there are no limiters on how many times this can + # be used in any given timeframe, so only add users to + # check_master that can be trusted not to give Eve or + # yourself a bad reputation! + + match /join (.+)/i, method: :join + match /part(?: (.+))?/i, method: :part + + def join(m, channel) + if m.channel + unless check_master(m.user) + m.user.notice Format(:red, "You are not authorized to use this command! This incident will be reported!") + bot.info("Received invalid join command from #{m.user.nick} in #{m.channel}") + Config.dispatch.each { |n| User(n).notice("#{m.user.nick} attempted to use the 'join' command in #{m.channel} to join #{channel} but was not authorized.") } + return; + end + unless bot.channels.include?(channel) == false + m.reply ("I am already in #{channel}!") + return; + end Channel(channel).join bot.info("Received valid join command from #{m.user.nick} in #{m.channel}") end end - def part(m, channel) - if m.channel - unless check_master(m.user) - m.user.notice Format(:red, "You are not authorized to use this command! This incident will be reported!") - bot.info("Received invalid part command from #{m.user.nick} in #{m.channel}") - Config.dispatch.each { |n| User(n).notice("#{m.user.nick} attempted to use the 'part' command in #{m.channel} but was not authorized. Maybe they are sick of me?") } - return; - end + def part(m, channel) + if m.channel + unless check_master(m.user) + m.user.notice Format(:red, "You are not authorized to use this command! This incident will be reported!") + bot.info("Received invalid part command from #{m.user.nick} in #{m.channel}") + Config.dispatch.each { |n| User(n).notice("#{m.user.nick} attempted to use the 'part' command in #{m.channel} but was not authorized. Maybe they are sick of me?") } + return; + end channel ||= m.channel Channel(channel).part if channel bot.info("Received valid part command from #{m.user.nick} in #{m.channel}") end end - - def dier(m) - [ - Format(:green, "Critical Error!"), - Format(:green, "Unknown Error!"), - Format(:green, "!rorrE lacitirC"), - Format(:green, "Please don't hurt me"), - Format(:green, "Shutting down..."), - Format(:green, "Whhyy?"), - Format(:green, "No hard feelings"), - Format(:green, "Goodbye."), - Format(:green, "Nap time."), - Format(:green, "Resting."), - Format(:green, "Nap time."), - Format(:green, "Hibernating."), - Format(:green, "Sleep mode activated"), - Format(:green, "Self test error...Unknown Error"), - Format(:green, "Well it's been nice being here!"), - Format(:green, "Well it's bee011100010101110100110100101010111100010101010001"), - Format(:green, "You monster.") - ].sample - end + + def dier(m) + [ + Format(:green, "Critical Error!"), + Format(:green, "Unknown Error!"), + Format(:green, "!rorrE lacitirC"), + Format(:green, "Please don't hurt me"), + Format(:green, "Shutting down..."), + Format(:green, "Whhyy?"), + Format(:green, "No hard feelings"), + Format(:green, "Goodbye."), + Format(:green, "Nap time."), + Format(:green, "Resting."), + Format(:green, "Nap time."), + Format(:green, "Hibernating."), + Format(:green, "Sleep mode activated"), + Format(:green, "Self test error...Unknown Error"), + Format(:green, "Well it's been nice being here!"), + Format(:green, "Well it's bee011100010101110100110100101010111100010101010001"), + Format(:green, "You monster.") + ].sample + end end end @@ -137,7 +137,9 @@ def dier(m) # 1.) If you need further help with the commands and their syntax just type !help in a channel # that Eve is in and she will send you a vast array of commands at your disposal. # -# As a last note, always remember that EVE is a project for a Top-Tier IRC bot, and the project -# could always use more help. Feel free to contribute at the github: https://github.com/Namasteh/Eve-Bot -# For help with the Cinch framework you can always visit #Cinch at irc.freenode.net -# For help with EVE you can always visit #Eve at rawr.coreirc.org \ No newline at end of file +## Written by Richard Banks for Eve-Bot "The Project for a Top-Tier IRC bot. +## E-mail: namaste@rawrnet.net +## Github: Namasteh +## Website: www.rawrnet.net +## IRC: irc.sinsira.net #Eve +## If you like this plugin please consider tipping me on gittip diff --git a/lib/plugins/decide.rb b/lib/plugins/decide.rb index a44ef74..920899b 100644 --- a/lib/plugins/decide.rb +++ b/lib/plugins/decide.rb @@ -10,75 +10,77 @@ module Cinch module Plugins class Decide include Cinch::Plugin - + set :plugin_name, 'decider' set :help, <<-USAGE.gsub(/^ {6}/, '') - This plugin has a few commands to help you decide if you can't on your own. Have fun! - Usage: - - !decide