Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'cinch'
- class Rand
- include Cinch::Plugin
- match(/rand\s*(-?)(\d+)\.\.(-?)(\d+)/, method: :by_range)
- match(/rand\s*$/, method: :default)
- def by_range(m, min_m = "", min=0, max_m = "", max=1)
- min = min.to_i
- max = max.to_i
- min = if min_m == "-" then -min else min end
- max = if max_m == "-" then -max else max end
- if min > max
- min, max = max, min
- end
- result = rand min..max
- m.reply "#{m.user.nick}: #{result}"
- end
- def default(m)
- m.reply "#{m.user.nick}: #{rand 0..1}"
- end
- end
- class Choose
- include Cinch::Plugin
- match(/choose\s+(.*)/)
- def execute(m, args)
- puts "Kappa"
- args = args.split("/").map(&:strip)
- m.reply "#{m.user.nick}: #{args.sample} (danshat негр)"
- end
- end
- class Flood
- include Cinch::Plugin
- match "kappa", method: :kappa
- match "mico", method: :mico
- def kappa(m)
- m.reply
- "░░░░▄▀▀▀▀▀█▀▄▄▄▄░░░░\n" +
- "░░▄▀▒▓▒▓▓▒▓▒▒▓▒▓▀▄░░\n" +
- "▄▀▒▒▓▒▓▒▒▓▒▓▒▓▓▒▒▓█░\n" +
- "█▓▒▓▒▓▒▓▓▓░░░░░░▓▓█░\n" +
- "█▓▓▓▓▓▒▓▒░░░░░░░░▓█░\n" +
- "▓▓▓▓▓▒░░░░░░░░░░░░█░\n" +
- "▓▓▓▓░░░░▄▄▄▄░░░▄█▄▀░\n" +
- "░▀▄▓░░▒▀▓▓▒▒░░█▓▒▒░░\n" +
- "▀▄░░░░░░░░░░░░▀▄▒▒█░\n" +
- "░▀░▀░░░░░▒▒▀▄▄▒▀▒▒█░\n" +
- "░░▀░░░░░░▒▄▄▒▄▄▄▒▒█░\n" +
- "░░░▀▄▄▒▒░░░░▀▀▒▒▄▀░░\n" +
- "░░░░░▀█▄▒▒░░░░▒▄▀░░░\n" +
- "░░░░░░░░▀▀█▄▄▄▄▀░░░░"
- end
- def mico(m)
- m.reply "за mico!"
- end
- end
- bot = Cinch::Bot.new do
- configure do |c|
- c.server = "irc.esper.net"
- c.channels = ["#cc.ru"]
- c.plugins.plugins = [Rand, Choose, Flood]
- c.plugins.prefix = /^:/
- c.nick = "YuRaNnNzZZ"
- c.messages_per_second = 9999
- c.server_queue_size = 9999
- end
- on :join do |m|
- m.reply "o/"
- end
- end
- bot.start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement