How am I able to do this:

Connect to one server, join a bunch of channels, then join the same server, on a new connection, and join different channels?

I would like to have this done from a script so I'll join the server twice and channels on each connection automatically