Advertisement
Guest User

Untitled

a guest
Mar 31st, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.11 KB | None | 0 0
  1. require "cinch"
  2. require "cinch/plugins/identify"
  3.  
  4. $admin = ["comfyasfuck", "ewhal4"]
  5.  
  6. class Autovoice
  7.   include Cinch::Plugin
  8.   listen_to :join
  9.   match /comf autovoice (on|off)$/, use_prefix: false
  10.  
  11.   def listen(m)
  12.     unless m.user.nick == bot.nick
  13.       m.channel.voice(m.user) if @autovoice
  14.     end
  15.   end
  16.  
  17.   def execute(m, option)
  18.     @autovoice = option == "on"
  19.     m.reply "Autovoice is now #{@autovoice ? 'enabled' : 'disabled'}."
  20.   end
  21. end
  22.  
  23. bot = Cinch::Bot.new do
  24.   configure do |c|
  25.     c.server = "irc.rizon.net"
  26.     c.channels = ["#comfortable", "#pasta"]
  27.     c.nick = "comfybot"
  28.     c.verbose = true
  29.     c.plugins.plugins = [Autovoice, Cinch::Plugins::Identify]
  30.     c.plugins.options[Cinch::Plugins::Identify] = {
  31.       :username => "",
  32.       :password => 'RudyRudy2by4',
  33.       :type => :nickserv,
  34.     }
  35.   end
  36.  
  37.   helpers do
  38.     def is_admin?(user)
  39.       true if $admin.include? user.nick
  40.     end
  41.   end
  42.  
  43.   on :message, /comf spam (.+?) (.+)/ do |m, who, text|
  44.     horizNum = who.split('x',2).first.to_i
  45.     vertiNum = who.split('x',2).last.to_i
  46.     whileNum = 1
  47.     spamText = "#{text} "
  48.     if is_admin?(m.user)
  49.       while whileNum <= horizNum
  50.         if whileNum == horizNum
  51.           whileNum = 1
  52.           while whileNum <= vertiNum
  53.             m.reply spamText.upcase
  54.             whileNum += 1
  55.           end
  56.         end
  57.         whileNum += 1
  58.         spamText = spamText + "#{text} "
  59.       end
  60.     end
  61.   end
  62.  
  63.   on :message, "comf rules" do |m|
  64.     m.reply "Rules: "
  65.     m.reply "0. This is not a democracy, this is not a constitutional republic."
  66.     m.reply "1. comfy has supreme power in this channel and ewhal4 has secondary power."
  67.     m.reply "2. installgen2 and other highups from #pasta are not allowed in here."
  68.     m.reply "3. Political dissent will be silenced."
  69.   end
  70.  
  71.   on :join do |m|
  72.     unless m.user.nick == bot.nick # No voicing or talking to self
  73.       unless m.user.nick == "vitimiti"
  74.         m.reply "Hello, and welcome to #{m.channel}, #{m.user.nick}! Get comfy <3333."
  75.       end
  76.     end
  77.   end
  78.  
  79.   on :message, /comf help/ do |m|
  80.     m.reply "Commands: "
  81.     m.reply "comf tell _nick_ like it is"
  82.     m.reply "comf rules - they apply to #comfortable only"
  83.     m.reply "comf join _channel_ and comf leave _channel_"
  84.     m.reply "comf send (nick or channel) _message_"
  85.   end
  86.  
  87.   on :message, /.bots/ do |m|
  88.     m.reply "Reporting in! [Ruby] Do comf help for more info."
  89.   end
  90.  
  91.   on :message, /comf tell (.+?) like it is/ do |m, who|
  92.     if is_admin?(m.user)
  93.       m.reply "YOU LITTLE STUPID ASS #{who} I AINT FUCKIN WHICHUUUUU".upcase
  94.     end
  95.   end
  96.  
  97.   on :message, /can confirm/ do |m|
  98.     m.reply "can confirm"
  99.   end
  100.  
  101.   on :message, /comf join (.+)/ do |m, channel|
  102.     bot.join(channel) if is_admin?(m.user)
  103.   end
  104.  
  105.   on :message, /comf leave (.+)/ do |m, channel|
  106.     channel = channel || m.channel
  107.     if channel
  108.       bot.part(channel) if is_admin?(m.user)
  109.     end
  110.   end
  111.  
  112.   on :message, /comf send (.+?) (.+)/ do |m, who, text|
  113.     if is_admin?(m.user)
  114.       Channel("#{who}").send "#{text}"
  115.     end
  116.   end
  117.  
  118.   on :message, /;-;/ do |m|
  119.     m.reply "Stop acting like a little bitch, #{m.user.nick}."
  120.   end
  121. end
  122.  
  123. bot.start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement