You need to do something similar to*:
Code:
login = "#{RUBY_DIR}/ruby.exe #{LICH_DIR}/lich.rbw --login --char_name #{character_name} --without-frontend --start-scripts=exit";
# Start in a thread so we can kill it if it runs too long
thread = Thread.new {
system "#{login}"
}
where exit.lic is a script that just does whatever (I have it log "boost info", "bank account", and "experience" for data mining) then does "exit" so you don't stay logged in.
* "similar" because I used a modified lich.rbw. I think the above is correct for the standard version, but it might not be perfect. "ruby lich.rbw --help" will give you exact syntax.