Forums - Open Redstone Engineers
guis i mad irk bot in rubee - Printable Version

+- Forums - Open Redstone Engineers (https://forum.openredstone.org)
+-- Forum: Off-Topic (https://forum.openredstone.org/forum-4.html)
+--- Forum: Programming (https://forum.openredstone.org/forum-8.html)
+--- Thread: guis i mad irk bot in rubee (/thread-3568.html)



guis i mad irk bot in rubee - Malcolmforde - 05-20-2014

I made an IRC bot in ruby that actually looks good and works good.
Code:
require 'cinch'

#create a shutdown passcode thingdoodle
passcode = String Random.rand 9999
puts passcode

bot = Cinch::Bot.new do
  configure do |c|
    c.server = "irc.freenode.org"
    c.channels = ["#OREServerChat"]
    c.nick = "Malcy"
  end

  #yell at noobs
  on :message, /^!apply (.+) \| (.+)/ do |m, player, insult|
    m.reply "Hey! #{player}! You need to apply on http://openredstone.org you #{insult}!"
  end
  
  #give free milk
  on :message, /^!freemilk (.+)/ do |m, player|
    player.upcase!
    m.reply "OHH YEAH GET THAT WHITE JUICE RIGHT OUT OF THERE, #{player}!"
  end

  #whack folk
  on :message, /^!whack (.+) \| (.+)/ do |m, player, object|
    m.reply "*Wacks #{player} about a bit with a #{object}*"
  end
  
  #help folk
  on :message, /^!help/ do |m|
    m.reply "Malcy is an ignorant asshole."
  end
  
  #insult link posters
  on :message, /http|https/ do |m|
    m.reply "HA! LINK POSTING IS FOR NUBS!"
  end
  
  #die in a fire
  on :message, /^!killwithfire (.+)/ do |m, pass|
    if pass == passcode
      m.reply "CYA SUCKAS"
      exit
    end
  end
  
end

bot.start



RE: guis i mad irk bot in rubee - David - 05-20-2014

Dat humor tho.