summaryrefslogtreecommitdiff
path: root/example/rogue.exp
diff options
context:
space:
mode:
Diffstat (limited to 'example/rogue.exp')
-rwxr-xr-xexample/rogue.exp23
1 files changed, 23 insertions, 0 deletions
diff --git a/example/rogue.exp b/example/rogue.exp
new file mode 100755
index 0000000..083acdf
--- /dev/null
+++ b/example/rogue.exp
@@ -0,0 +1,23 @@
+#!/bin/sh
+# -*- tcl -*-
+# The next line is executed by /bin/sh, but not tcl \
+exec tclsh "$0" ${1+"$@"}
+
+package require Expect
+
+# Look for a GREAT game of rogue.
+# Idea is that any game with a Strength of 18 is unusually good.
+# Written by Don Libes - March, 1990
+
+set timeout -1
+while {1} {
+ spawn rogue
+ expect "Str: 18" break \
+ "Str: 16"
+ send "Q"
+ expect "quit?"
+ send "y"
+ close
+ wait
+}
+interact