Guest User

Untitled

a guest
Nov 26th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. #!/usr/bin/ruby
  2.  
  3. # this is the main part of CoyoBOT
  4.  
  5. require_relative "./IRCSocket"
  6.  
  7. # setting constants for testing purposes
  8. SERVER = "irc.freenode.net" # server hostname to connect to
  9. PORT = 6667 # port number to connect to
  10. NICKNAME = "coyobot" # nickname
  11. USERNAME = "unf" # username
  12. GECOS = "Coyo's Bot" # "real name"
  13. PASSWORD = "pass" # server password
  14. MODES = "+iswx" # usermodes to set on connection
  15.  
  16. # main method
  17. def main
  18. s = IRCSocket.new SERVER, PORT, NICKNAME, USERNAME, GECOS, PASSWORD
  19. # instantiate new IRC socket connection
  20.  
  21. s.mode NICKNAME MODES
  22. s.join "#bots"
  23. s.msg "#bots", "Hello world!"
  24. # aaaand, now what?
  25. # I'm trying to output the puts from s but I dont know how. Halp!
  26. end
  27.  
  28. # Thank you so much in advance, I really appreciate it!
Add Comment
Please, Sign In to add comment