Skip to content

Instantly share code, notes, and snippets.

@simonask
Created January 6, 2009 09:50
Show Gist options
  • Save simonask/43745 to your computer and use it in GitHub Desktop.
Save simonask/43745 to your computer and use it in GitHub Desktop.
IRCBot: class {
initialize: (server, channel, nick) {
.server, .channel, .nick: server, channel, nick
}
connect: () {
.socket: /* blablabla */
}
send_message: (msg) {
.socket.write(msg) /* blablabla */
}
get_new_messages: () {
@("lol", "noob")
}
}
task: spawn (t) {
bot: IRCBot "irc.freenode.org", "#alminde", "snotbot"
bot.connect
while message: t.pop
t.yield bot.__send__(message, *message.args)
end
}
task.send_message("lol n00bs")
messages: task.get_new_messages
messages.each { print it }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment