Skip to content

Instantly share code, notes, and snippets.

@ypchen
Created April 20, 2009 12:21
Show Gist options
  • Save ypchen/98512 to your computer and use it in GitHub Desktop.
Save ypchen/98512 to your computer and use it in GitHub Desktop.
new an id in PalmBBS
#!/usr/local/bin/expect -f
set timeout -1
set idletime 0
set idleint 190
#set id [lindex $argv 0]
#set password [lindex $argv 1]
set id pekopeko
set password 6543
if {[string compare $id ""] == 0} {
puts "no id.\n"
exit 0
}
if {[string compare $password ""] == 0} {
puts "no password.\n"
exit 0
}
for {set count 1} {$count <= 50} {incr count 1} {
spawn telnet bbs.ntu.edu.tw
expect "請輸入代號:"
send "$id\n"
expect "請輸入密碼:" {
send "$password\n"
send "\n"
send "\n"
send "\n"
send "\n"
}
interact {
timeout $idleint {
send "g\n"
send "g\n"
send "\n"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment