I've been using this script to log in for a long time:
it allows for 8 accounts and encrypts the passwords in a separate file. It takes some customization to get it to work, and I changed several things myself such as hard coding the hotkeys, but I recommend this. The post I linked doesn't have an attachment, you just save the code to a .ahk file.
Here is my version, I had to change some of the timings to get it to work right. It assumes the game is installed at c:\dofus, but this can be changed to whatever. I've left out my changes to make the hotkeys permanent since that is dependent on your window names (character names usually), and wasn't part of guybrush's original script anyway: