Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* blimlimb.rb: let's give a warm welcome to the innards of this thea…
…tre.
- Loading branch information
_why
committed
May 16, 2008
0 parents
commit f458738
Showing
8 changed files
with
1,242 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
require 'rbot/rfc2812' | ||
require 'rbot/ircsocket' | ||
require 'rbot/timer' | ||
require 'rbot/message' | ||
|
||
HOST = 'irc.freenode.net' | ||
CHAN = '#stage' | ||
FROM = 'blim.limb' | ||
|
||
def debug(message=nil) | ||
print "DEBUG: #{message}\n" if message | ||
end | ||
|
||
class BotPlayer | ||
attr_reader :nick, :socket, :client | ||
def initialize(nick) | ||
@socket = Irc::IrcSocket.new(HOST, 6667, false) | ||
@client = Irc::IrcClient.new | ||
@nick = nick | ||
@client[:welcome] = proc do |data| | ||
@socket.queue "JOIN #{CHAN}" | ||
end | ||
end | ||
def connect | ||
@socket.connect | ||
@socket.puts "NICK #{@nick}\nUSER #{@nick} 4 #{FROM} :blimLimb, of #camping" | ||
@socket.puts "JOIN #{CHAN}" | ||
Thread.start(self) do |bot| | ||
while true | ||
while bot.socket.connected? | ||
if bot.socket.select | ||
break unless reply = bot.socket.gets | ||
bot.client.process reply | ||
end | ||
end | ||
end | ||
end | ||
end | ||
def msg(type, where, message) | ||
@socket.queue("#{type} #{where} :#{message}") | ||
end | ||
def say(message) | ||
msg("PRIVMSG", CHAN, message) | ||
end | ||
def action(message) | ||
msg("PRIVMSG", CHAN, "\001ACTION #{message}\001") | ||
end | ||
def renick(name) | ||
@nick = name | ||
@socket.queue("NICK #{@nick}") | ||
end | ||
def quit(message) | ||
@socket.puts "QUIT :#{message}" | ||
@socket.flush | ||
@socket.shutdown | ||
end | ||
end | ||
|
||
class BotTroupe | ||
def initialize(script) | ||
@script = script | ||
@actors = {} | ||
end | ||
def parse line | ||
case line.strip | ||
when /^\[(\w+)\]\s+(.+?)$/ | ||
kid, actor = $1, $2 | ||
@actors[kid] = BotPlayer.new(actor) | ||
@actors[kid].connect | ||
puts "Join #{actor}" | ||
when /^(\w+)=\s*(.+?)$/ | ||
kid, nick = $1, $2 | ||
puts "#{@actors[kid].nick} is now named #{nick}" | ||
@actors[kid].renick(nick) | ||
when /^(\w+):\s?(.+?)$/ | ||
kid, msg = $1, $2 | ||
@actors[kid].say(msg) | ||
puts "<#{@actors[kid].nick}> #{msg}" | ||
when /^\((\w+)\)\s+(.+?)$/ | ||
kid, msg = $1, $2 | ||
@actors[kid].action(msg) | ||
puts "** #{@actors[kid].nick} #{msg}" | ||
when /^\+\s*(\d+)/ | ||
puts "Wait #{$1} secs" | ||
sleep $1.to_i | ||
when /^\*\s+(.+?)$/ | ||
puts "--- okay, _why: your console - #$1 ---" | ||
while true | ||
puppet = $stdin.gets.strip | ||
break if puppet =~ /^\*/ | ||
parse puppet | ||
end | ||
when /^\-(\w+)\s+(.+?)$/ | ||
kid, msg = $1, $2 | ||
@actors[kid].quit(msg) | ||
puts "Exit #{@actors[kid].nick}" | ||
end | ||
rescue => e | ||
p e.message | ||
end | ||
def act! | ||
IO.foreach(@script) do |line| | ||
parse line | ||
sleep(1+ rand(8)) | ||
end | ||
end | ||
end | ||
|
||
if __FILE__ == $0 | ||
troupe = BotTroupe.new ARGV[0] | ||
troupe.act! | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
[2006/11/09 15:31:19] @ j`ey_ is now known as j`ey | ||
[2006/11/09 15:34:34] <j`ey> anyone here an expert on Steel? | ||
[2006/11/09 15:35:12] <manfred-s> Yes, I know it's cold and shiny! | ||
[2006/11/09 15:36:24] <j`ey> have to do a physics presentation about samurai swords | ||
[2006/11/09 15:36:45] <manfred-s> Ah, Wikipedia? | ||
[2006/11/09 15:37:07] <j`ey> it doesnt seem to have about the actual structure | ||
[2006/11/09 15:37:56] * j`ey actually reads the whole page | ||
[2006/11/09 16:01:27] @ aidelaide joined channel #camping | ||
[2006/11/09 16:01:32] @ FNONt joined channel #camping | ||
[2006/11/09 16:01:44] @ teslyANDERSowens joined channel #camping | ||
[2006/11/09 16:01:47] @ ^sHuxley^ joined channel #camping | ||
[2006/11/09 16:01:53] <aidelaide> hello | ||
[2006/11/09 16:01:56] <^sHuxley^> (( //......\\'''''''//.....\\ )) | ||
[2006/11/09 16:01:58] <^sHuxley^> )) <good><day><#camping><!> (( | ||
[2006/11/09 16:02:03] @ beo_stepfIsDein joined channel #camping | ||
[2006/11/09 16:02:10] <^sHuxley^> (( \\......//'''''''\\.....///)) | ||
[2006/11/09 16:02:11] <beo_stepfIsDein> yes -- truly -- hello -- lo -- lo | ||
[2006/11/09 16:02:18] <aidelaide> :) | ||
[2006/11/09 16:02:24] <^sHuxley^> please pardon us for intruding, we are but a lowly improvisational bot troupe. :( | ||
[2006/11/09 16:02:29] <beo_stepfIsDein> yes, yes, it is true. | ||
[2006/11/09 16:02:37] * beo_stepfIsDein hangs his hat. | ||
[2006/11/09 16:02:38] <beo_stepfIsDein> woefully. | ||
[2006/11/09 16:02:42] <^sHuxley^> oh, take heart, young lad. | ||
[2006/11/09 16:02:46] <^sHuxley^> afte all, we are most definitely the /ONE', the /ONLY', the .(OFFICIAL). | ||
[2006/11/09 16:02:48] <^sHuxley^> entertainers of #camping, a gift from your KING< a true offering | ||
[2006/11/09 16:02:54] <^sHuxley^> of haste and scenic tales >PERFORMING TODAY!< for your gifted | ||
[2006/11/09 16:03:02] * aidelaide gasps. | ||
[2006/11/09 16:03:06] <^sHuxley^> minds, to lift your spirits and to spread luxurious laughter, as | ||
[2006/11/09 16:03:07] <beo_stepfIsDein> ** the show starts in roughly -- checks watch -- four minutes -- get comfortable. ** | ||
[2006/11/09 16:03:08] <^sHuxley^> it were a catapult travelling o'er the oval moons and roof boats!! | ||
[2006/11/09 16:03:16] <aidelaide> :) alright | ||
[2006/11/09 16:03:23] <aidelaide> i am aidelaide. | ||
[2006/11/09 16:03:30] <^sHuxley^> and: i am starlight huxley! | ||
[2006/11/09 16:03:33] <beo_stepfIsDein> and: :) i am b.e.o. stepfisdein. | ||
[2006/11/09 16:03:35] <^sHuxley^> >> we are blimLimb, the bot troupe! <<< | ||
[2006/11/09 16:03:37] <beo_stepfIsDein> previously known as blimLimb limLirrm, the bot troupe. | ||
[2006/11/09 16:03:41] @ jargonjustin joined channel #camping | ||
[2006/11/09 16:03:44] <aidelaide> we go by either :) | ||
[2006/11/09 16:03:48] <FNONt> I PLAY MYSELF. | ||
[2006/11/09 16:03:59] <aidelaide> hey, jargonjustin :) | ||
[2006/11/09 16:04:19] <^sHuxley^> jargonjustin: we are blimLimb, the bot troupe!! | ||
[2006/11/09 16:04:25] <^sHuxley^> we're right here | ||
[2006/11/09 16:04:27] <^sHuxley^> today | ||
[2006/11/09 16:04:48] * beo_stepfIsDein checks his watch again | ||
[2006/11/09 16:04:59] * beo_stepfIsDein checks j`ey's watch as well | ||
[2006/11/09 16:05:31] @ Quit: baijiutong: | ||
[2006/11/09 16:05:41] @ baijiutong joined channel #camping | ||
[2006/11/09 16:05:45] <^sHuxley^> any questions from the audience?? | ||
[2006/11/09 16:06:04] <^sHuxley^> ---------> (..+..+) <--------- | ||
[2006/11/09 16:06:11] <^sHuxley^> blimLimb | ||
[2006/11/09 16:06:29] <^sHuxley^> ^^ START YOUR QUESTIONS NOW!! ^^ | ||
[2006/11/09 16:06:39] @ wilig is now known as wilig_away | ||
[2006/11/09 16:06:53] <aidelaide> boohoo | ||
[2006/11/09 16:07:40] @ Quit: baijiutong: Client Quit | ||
[2006/11/09 16:07:42] @ Quit: tlockney: Read error: 60 (Operation timed out) | ||
[2006/11/09 16:08:21] @ baijiutong joined channel #camping | ||
[2006/11/09 16:09:04] <aidelaide> OH, and tesly.ANDERS.owens is our director!! thank you for coming, tesly!! | ||
[2006/11/09 16:09:11] <beo_stepfIsDein> yes, thankyou for travelling here with us, tesly! | ||
[2006/11/09 16:09:16] <aidelaide> :) | ||
[2006/11/09 16:09:19] <aidelaide> he is so supportive | ||
[2006/11/09 16:09:24] <teslyANDERSowens> ---.o )) | ||
[2006/11/09 16:09:45] * teslyANDERSowens smokes a long pipe with a strange smell you've never smelt before. | ||
[2006/11/09 16:10:06] <aidelaide> he's my husband!! i love you, tesly!! | ||
[2006/11/09 16:10:21] * teslyANDERSowens puts his jacket on | ||
[2006/11/09 16:10:28] <teslyANDERSowens> you notice it is a material never before seen. | ||
[2006/11/09 16:10:32] <beo_stepfIsDein> today's show is called %%> EDWARD AND HIS BOOK KNOWLEDGE <%% | ||
[2006/11/09 16:10:35] <^sHuxley^> just a few minutes, everyone | ||
[2006/11/09 16:10:38] <beo_stepfIsDein> thankyeh thankyoll | ||
[2006/11/09 16:11:06] <beo_stepfIsDein> i play the prototagonist EDWARD, in his quest to free himself from his cumbersome book knowledge. | ||
[2006/11/09 16:11:26] <^sHuxley^> coming up :) | ||
[2006/11/09 16:15:05] * aidelaide waits | ||
[2006/11/09 16:15:28] @ PoorKitKallaway joined channel #camping | ||
[2006/11/09 16:15:35] <PoorKitKallaway> sorry :( | ||
[2006/11/09 16:15:40] <teslyANDERSowens> hehe | ||
[2006/11/09 16:15:44] <^sHuxley^> OH, POOR KiT, late again | ||
[2006/11/09 16:15:51] <aidelaide> :D classic | ||
[2006/11/09 16:15:55] <PoorKitKallaway> i guess i got locked in the laundromat | ||
[2006/11/09 16:16:00] <beo_stepfIsDein> poor kit kallaway | ||
[2006/11/09 16:16:02] <aidelaide> again?? | ||
[2006/11/09 16:16:04] <^sHuxley^> >> PLEASE <<>> EVERYONE <<< | ||
[2006/11/09 16:16:11] <^sHuxley^> give a warm welcome to poor | ||
[2006/11/09 16:16:16] <^sHuxley^> KIT!! ... KALLAWAY!! ... | ||
[2006/11/09 16:16:39] <^sHuxley^> straight outta the locked laundromat | ||
[2006/11/09 16:16:43] <^sHuxley^> he guesses | ||
[2006/11/09 16:16:44] * PoorKitKallaway is wearing bleached shoes, he hopes that's ok | ||
[2006/11/09 16:16:49] <aidelaide> how did your shoes get bleached?? | ||
[2006/11/09 16:16:53] <beo_stepfIsDein> wtf? | ||
[2006/11/09 16:16:58] <teslyANDERSowens> kit, go home. seriously. | ||
[2006/11/09 16:17:00] <PoorKitKallaway> meanies ;,( | ||
[2006/11/09 16:17:05] * teslyANDERSowens puts some beer in his cigar. | ||
[2006/11/09 16:17:11] <^sHuxley^> no, hey | ||
[2006/11/09 16:17:13] <^sHuxley^> y | ||
[2006/11/09 16:17:13] <^sHuxley^> whoops | ||
[2006/11/09 16:17:20] <^sHuxley^> i think that tesly means we don't have a part for you in this show, kit | ||
[2006/11/09 16:17:24] <aidelaide> ?? | ||
[2006/11/09 16:17:31] * aidelaide checks. | ||
[2006/11/09 16:17:39] <PoorKitKallaway> which one is it? | ||
[2006/11/09 16:17:41] <^sHuxley^> it's the elliot one | ||
[2006/11/09 16:17:45] <beo_stepfIsDein> %%> EDWARD AND HIS BOOK KNOWLEDGE <%%% | ||
[2006/11/09 16:17:48] <^sHuxley^> right right | ||
[2006/11/09 16:17:53] <^sHuxley^> edward | ||
[2006/11/09 16:17:58] <^sHuxley^> i don't think you're in this one. | ||
[2006/11/09 16:18:31] @ Quit: PoorKitKallaway: Client Quit | ||
[2006/11/09 16:18:35] <teslyANDERSowens> hehe | ||
[2006/11/09 16:18:40] <beo_stepfIsDein> my lord, would it be so hard to add a part for him? | ||
[2006/11/09 16:18:46] * aidelaide shrugs | ||
[2006/11/09 16:18:47] <aidelaide> SHUT UP, I HATE YOU!! | ||
[2006/11/09 16:18:54] <aidelaide> oh | ||
[2006/11/09 16:18:58] <aidelaide> sorry wrong window | ||
[2006/11/09 16:19:04] * ^sHuxley^ is studying. | ||
[2006/11/09 16:19:34] <^sHuxley^> okay, here we go. | ||
[2006/11/09 16:19:41] <^sHuxley^> i think we could give kit a line or two during the part where EDWARD has to take his skin off in order to fit in the donkey door. | ||
[2006/11/09 16:19:49] <beo_stepfIsDein> that's true | ||
[2006/11/09 16:19:55] <^sHuxley^> kit could walk in and say, "here, i'll take that skin off your hands." | ||
[2006/11/09 16:19:56] <beo_stepfIsDein> you mean when he's done taking off his skin | ||
[2006/11/09 16:19:58] <beo_stepfIsDein> he'll walk in and say that | ||
[2006/11/09 16:20:04] <^sHuxley^> yeah | ||
[2006/11/09 16:20:19] * manfred-s leaves | ||
[2006/11/09 16:20:53] * MenTaLguY trees | ||
[2006/11/09 16:21:14] <FNONt> MANTEL GUY | ||
[2006/11/09 16:21:17] @ Quit: raaum: "." | ||
[2006/11/09 16:21:44] <FNONt> I AM A GOOD ACTOR | ||
[2006/11/09 16:21:50] <FNONt> FOR A BOT | ||
[2006/11/09 16:21:54] <FNONt> JUST WAIT AND SEE | ||
[2006/11/09 16:22:20] <^sHuxley^> sshhh, FNONt | ||
[2006/11/09 16:22:51] * beo_stepfIsDein and sHuxley go back to reworking the script | ||
[2006/11/09 16:23:22] <j`ey> manfred-s: I know, wtf | ||
[2006/11/09 16:23:27] <MenTaLguY> Hark, I am the Duke of the Realm of Audience Participation | ||
[2006/11/09 16:24:04] <aidelaide> MenTaLguY: :D awesome! | ||
[2006/11/09 16:24:19] <aidelaide> we need people like you | ||
[2006/11/09 16:24:35] * aidelaide wonders. | ||
[2006/11/09 16:24:37] <aidelaide> ^sHuxley^: you guys talking about the donkey's door? | ||
[2006/11/09 16:25:23] <^sHuxley^> ^^YES^^ | ||
[2006/11/09 16:25:26] <beo_stepfIsDein> we just added a line for kit :D!!! | ||
[2006/11/09 16:25:30] <aidelaide> yeah but now everyone knows about the donkey's door | ||
[2006/11/09 16:26:10] <beo_stepfIsDein> ohhh | ||
[2006/11/09 16:26:15] <beo_stepfIsDein> we're still in #camping | ||
[2006/11/09 16:26:21] <MenTaLguY> Be your donkey door compleat w' donkey? | ||
[2006/11/09 16:26:22] <^sHuxley^> OH DAMNIT!!! | ||
[2006/11/09 16:26:29] @ Quit: ^sHuxley^: "away!!" | ||
[2006/11/09 16:27:01] @ Quit: aidelaide: "i'm justified... and i'm ancient!" | ||
[2006/11/09 16:27:09] @ Quit: FNONt: "QUIT" | ||
[2006/11/09 16:27:14] @ Quit: beo_stepfIsDein: "%^ paraumph ^% 444 444 444 (( mooon" | ||
[2006/11/09 16:29:42] <j`ey> thats was without a doubt, the weirdest thing Ive eer seen on IRC | ||
[2006/11/09 16:29:44] <MenTaLguY> I liked the idea, but the implementation lacketh much. | ||
[2006/11/09 16:30:40] <teslyANDERSowens> and... | ||
[2006/11/09 16:31:09] <teslyANDERSowens> CUT | ||
[2006/11/09 16:31:11] @ Quit: teslyANDERSowens: "justified and ancient" | ||
[2006/11/09 16:31:25] <j`ey> MenTaLguY: im pondering blogging it | ||
[2006/11/09 16:34:22] <MenTaLguY> We should do some improv theatre in here. | ||
[2006/11/09 16:34:28] <MenTaLguY> But, actually do it. | ||
[2006/11/09 16:34:34] <MenTaLguY> Rather than meta-theatrics. | ||
[2006/11/09 16:34:36] <j`ey> heh | ||
[2006/11/09 16:34:53] @ adelaide joined channel #camping | ||
[2006/11/09 16:35:00] @ Quit: adelaide: Client Quit | ||
[2006/11/09 16:35:31] @ adelaide joined channel #camping | ||
[2006/11/09 16:35:39] @ Quit: adelaide: Client Quit | ||
[2006/11/09 16:37:48] @ teslyANDERSowens joined channel #camping | ||
[2006/11/09 16:37:52] @ wilig_away is now known as wilig | ||
[2006/11/09 16:37:53] <teslyANDERSowens> my wife left her hanky | ||
[2006/11/09 16:37:57] * teslyANDERSowens picks up hanky | ||
[2006/11/09 16:37:58] @ Quit: teslyANDERSowens: Client Quit | ||
[2006/11/09 16:38:46] <MenTaLguY> So, yeah. | ||
[2006/11/09 16:38:50] <MenTaLguY> I was totally serious about the improv thing. | ||
[2006/11/09 16:39:03] <j`ey> hmm | ||
[2006/11/09 16:40:09] <j`ey> I got a C in drama, if that helps | ||
[2006/11/09 16:41:01] <MenTaLguY> perhaps |
Oops, something went wrong.