-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.scrp
141 lines (120 loc) · 3.43 KB
/
test.scrp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
on run argv
set my_path to (system attribute "PWD") & "/"
set my_disk to item 1 of argv
set my_audio to item 2 of argv
set my_screen1 to item 3 of argv
set my_timeout1 to item 4 of argv
set my_screen2 to item 5 of argv
set my_timeout2 to item 6 of argv
set my_screen3 to item 7 of argv
set my_timeout3 to item 8 of argv
set my_screen4 to item 9 of argv
set my_timeout4 to item 10 of argv
set my_screen5 to item 11 of argv
set my_timeout5 to item 12 of argv
set my_screen6 to item 13 of argv
set my_timeout6 to item 14 of argv
set my_screen7 to item 15 of argv
set my_timeout7 to item 16 of argv
tell application "Virtual ]["
activate
-- may need delay for this error: execution error: Virtual ][ got an error: Connection is invalid. (-609)
delay 1.5
-- Close all open machines
close every machine saving no
-- Create a new (AppleIIe)
set theMachine to (make new AppleIIe)
tell theMachine
-- Change to a color screen
set monochrome screen to false
set scanlines to true
set speaker volume to 0.25
-- load disk
insert my_path & my_disk into device "S6D1"
-- splash page
try
with timeout of my_timeout1 seconds
waiting until screen equals imagefile POSIX path of (my_path & my_screen1)
end timeout
on error
return "ERROR: TIMEOUT: Virtual ][ screen != " & my_screen1
end try
-- full speed ahead
set speed to maximum
-- main screen
try
with timeout of my_timeout2 seconds
waiting until screen equals imagefile POSIX path of (my_path & my_screen2)
end timeout
on error
return "ERROR: TIMEOUT: Virtual ][ screen != " & my_screen2
end try
delay 0.5
-- normal speed
set speed to regular
-- down arrow 23x and return
repeat 28 times
type key down arrow
delay 0.03
end repeat
-- ballblazer selected
try
with timeout of my_timeout3 seconds
waiting until screen equals imagefile POSIX path of (my_path & my_screen3)
end timeout
on error
return "ERROR: TIMEOUT: Virtual ][ screen != " & my_screen3
end try
delay 0.5
-- return on ballblazer
type line ""
-- qr code screen
try
with timeout of my_timeout4 seconds
waiting until screen equals imagefile POSIX path of (my_path & my_screen4)
end timeout
on error
return "ERROR: TIMEOUT: Virtual ][ screen != " & my_screen4
end try
delay 0.5
-- send audio
play my_path & my_audio on device "cassette recorder"
-- audio start screen
try
with timeout of my_timeout5 seconds
waiting until screen equals imagefile POSIX path of (my_path & my_screen5)
end timeout
on error
return "ERROR: TIMEOUT: Virtual ][ screen != " & my_screen5
end try
-- full speed ahead
set speed to maximum
-- pirate splash page
try
with timeout of my_timeout6 seconds
waiting until screen equals imagefile POSIX path of (my_path & my_screen6)
end timeout
on error
return "ERROR: TIMEOUT: Virtual ][ screen != " & my_screen6
end try
delay 1.0
-- normal speed
set speed to regular
-- eject tape
eject device "cassette recorder"
-- press return
type line ""
-- game screen
try
with timeout of my_timeout7 seconds
waiting until screen equals imagefile POSIX path of (my_path & my_screen7)
end timeout
on error
return "ERROR: TIMEOUT: Virtual ][ screen != " & my_screen7
end try
end tell
delay 0.5
close every machine saving no
quit
end tell
end run