Script to make all my online ichat accounts repeat a message in a chat

I need a script to make my all my online ichat accounts enter a certain chat…then start sending a message starting with the first screenname and when it gets to the last i need it to loop and keep doing that. If possible id like a dialog box for the message to send, the chat to enter, how many times to loop etc…

heres something similar for adium

on substitute(theMessage)
tell application “Adium.app”
repeat with theChat in (every «class Chat»)
«event Adumsend» theChat given «class Smsg»:theMessage
end repeat
end tell
end substitute

but i need it for iChat.

I really would be extremely grateful. Thank you very much for your time