Ruby Monstas Session 8 Project: IRC Bot Recap IRC channel user - - PowerPoint PPT Presentation

ruby monstas
SMART_READER_LITE
LIVE PREVIEW

Ruby Monstas Session 8 Project: IRC Bot Recap IRC channel user - - PowerPoint PPT Presentation

Ruby Monstas Session 8 Project: IRC Bot Recap IRC channel user list user channel message Client / Server Networking Client Internet (the Cloud) Server Client / Server Networking TCP connection A little help Our goal [18:25]


slide-1
SLIDE 1

Ruby Monstas

Session 8

slide-2
SLIDE 2

Project: IRC Bot

slide-3
SLIDE 3

Recap

slide-4
SLIDE 4

IRC

channel user list user channel message

slide-5
SLIDE 5

Client / Server Networking

Client Internet (the “Cloud”) Server

slide-6
SLIDE 6

Client / Server Networking

TCP connection

slide-7
SLIDE 7

A little help

slide-8
SLIDE 8

Our goal

[18:25] <nerdinand_> lalala [18:25] <nerdinand_> Hi [18:25] <nerdinand_> Hi nerdinand-bot [18:25] <nerdinand-bot> Hi nerdinand_!

slide-9
SLIDE 9

3 things you need to know

  • How to work with strings
  • How to conditionally execute code
  • How to call a method
slide-10
SLIDE 10

A little help

slide-11
SLIDE 11

A little help

":nerdinand_!b2c5e1f5@gateway/web/freenode/ip.178.197.225.245 PRIVMSG #rubymonstas :lalala"

slide-12
SLIDE 12

A little help

":nerdinand_!b2c5e1f5@gateway/web/freenode/ip.178.197.225.245 PRIVMSG #rubymonstas :lalala" ":nerdinand_!b2c5e1f5@gateway/web/freenode/ip.178.197.225.245 PRIVMSG #rubymonstas :Hi"

slide-13
SLIDE 13

A little help

":nerdinand_!b2c5e1f5@gateway/web/freenode/ip.178.197.225.245 PRIVMSG #rubymonstas :lalala" ":nerdinand_!b2c5e1f5@gateway/web/freenode/ip.178.197.225.245 PRIVMSG #rubymonstas :Hi" ":nerdinand_!b2c5e1f5@gateway/web/freenode/ip.178.197.225.245 PRIVMSG #rubymonstas :Hi nerdinand-bot"

slide-14
SLIDE 14

What are the important parts?

":nerdinand_!b2c5e1f5@gateway/web/freenode/ip.178.197.225.245 PRIVMSG #rubymonstas :Hi nerdinand-bot"

slide-15
SLIDE 15

What are the important parts?

":nerdinand_!b2c5e1f5@gateway/web/freenode/ip.178.197.225.245 PRIVMSG #rubymonstas :Hi nerdinand-bot"

slide-16
SLIDE 16

3 things you need to know

  • How to work with strings
  • How to conditionally execute code
  • How to call a method
slide-17
SLIDE 17

3 things you need to know

  • How to work with strings
  • How to conditionally execute code
  • How to call a method

Split message into the useful parts, ignore the rest

slide-18
SLIDE 18

3 things you need to know

  • How to work with strings
  • How to conditionally execute code
  • How to call a method

Split message into the useful parts, ignore the rest Only react to the message, if you’re supposed to, ignore it

  • therwise
slide-19
SLIDE 19

3 things you need to know

  • How to work with strings
  • How to conditionally execute code
  • How to call a method

Split message into the useful parts, ignore the rest Only react to the message, if you’re supposed to, ignore it

  • therwise

Call the irc_send method with a string the IRC server understands E.g. irc_send("PRIVMSG #rubymonstas :Hi!")

slide-20
SLIDE 20

That’s it! Happy Hacking!

Just do it!