-fillformfield alice
-fillformfield bogus
-send "\t"
-submitform-expect "wrong password"
-
-fillformfield alice
-fillformfield sesame
-send "\t"
-submitform-expect "ACCESSGRANTED"
-
-etxt {path = '/Tsuffix'}
-
-send "/Make worms\r"
-submitform-expect "MAKING-worms"
-
-send "/Logout\r"
-submitform-expect "You have been logged out"
+proc loginas {user {password sesame} {wanttxt ACCESSGRANTED}} {
+ fillformfield $user
+ fillformfield $password
+ send "\t"
+ submitform-expect $wanttxt
+}