Created
January 6, 2009 09:50
-
-
Save simonask/43745 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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