Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.16 KB | None | 0 0
  1. #!/usr/bin/ruby
  2.  
  3. require 'cinch'
  4. one = 1
  5.  
  6.  
  7. bot = Cinch::Bot.new do
  8.   configure do |c|
  9.     c.server = "irc.wyldryde.org"
  10.     c.channels = ["#fufy"]
  11.     c.nick = "Nanook"
  12.     c.password = "notonyourlife"
  13.   end
  14.  
  15.  
  16.  
  17.   on :message, "hello" do |m|
  18.      m.reply "hello, #{m.user.nick}"
  19.   end
  20.  
  21.  
  22.   on :message, "hello, nanook!" do |m|
  23.     m.reply "muahahahha"
  24.   end
  25.   on :message, /^!shoot (.+)/ do |m, text|
  26.     output = "elo "
  27.     tens = output + text
  28.     m.reply tens
  29.   end
  30.   on :message, "!desc" do |m|
  31.     text = "testing"
  32.     m.reply text
  33.     m.channel.action text
  34.   end
  35.   on :message, "!name" do |m|
  36.   m.reply "Hi,  #{m.user.nick}"
  37.   end
  38.  
  39.  on :message, "!add" do |m|
  40.   atext = "Current adder value: "
  41.   type = "adder.log"
  42.   user = "#{m.user.nick}"
  43.   filename = user + type
  44.   one = one + 1
  45.   msg = "heya"
  46.   def func(a)
  47.    m.reply a
  48.   end
  49.  
  50.   func atext
  51.   m.reply one
  52.     File.open('adder.log', 'w') do |f2|  
  53.     f2.puts "The current adder value is:"
  54.     f2.puts one
  55.     end
  56.    puts "Write attempt finished"
  57.        File.open(filename.downcase, 'w') do |f2|  
  58.     f2.puts "Success!!!"
  59.     end
  60.    
  61.  
  62.  end
  63.  
  64.  
  65. end
  66.  
  67. bot.start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement