A more recent version of scripts may be available at scripts.irssi.org.
Usage: Do /escape (or /esc) just like you would use /lastlog this then prints the lines, which you can use in /eval. see /help lastlog for options For example:
Hey! join #fooX (where X is some char you can't copy-paste) then you do /esc #foo and you'll get something like 19:50 \x048/<\x04g \x04gsomeone\x04g\x048/>\x04g \x04ehey! join #foo\x12 ignore the stuff in the first part of the message, that's irssi's internal color format for the line printed. doing /eval join #foo\x12 will make you join the right channel /esc -clear makes your scrollback clean again