20 | | So courseScript should look like this after you edit it: |
21 | | |
22 | | (instance courseScript of Script |
23 | | (properties) |
24 | | |
25 | | (method (changeState newState &tmp temp0 [temp1 49]) |
26 | | (switch (= state newState) |
27 | | (0 |
28 | | (if local2 (localproc_003c local2) (= local2 0)) |
29 | | (= global162 (/ global214 12)) |
30 | | (if |
31 | | (> (= global161 (- global214 (* global162 12))) 0) |
32 | | (++ global162) |
33 | | else |
34 | | (= global161 12) |
35 | | ) |
36 | | (if (> global163 global161) (= global165 1)) |
37 | | (if (< global163 global161) (= global165 -1)) |
38 | | (if (== global163 global161) (= global165 0)) |
39 | | (if (> global164 global162) (= global166 1)) |
40 | | (if (< global164 global162) (= global166 -1)) |
41 | | (if (== global164 global162) (= global166 0)) |
42 | | (= seconds 2) |
43 | | ) |
44 | | (1 |
45 | | (= temp0 |
46 | | (if (== global213 global214) |
47 | | {COURSE ALREADY ACHIEVED} |
48 | | else |
49 | | {STANDBY\nCALCULATING COURSE} |
50 | | ) |
51 | | ) |
52 | | (if (!= global213 global214) (= global217 global213)) |
53 | | (if local1 (localproc_003c local1) (= local1 0)) |
54 | | (= local4 |
55 | | (Display |
56 | | temp0 |
57 | | dsWIDTH |
58 | | 135 |
59 | | dsALIGN |
60 | | 1 |
61 | | dsCOORD |
62 | | 168 |
63 | | 3 |
64 | | dsCOLOR |
65 | | 14 |
66 | | dsFONT |
67 | | 600 |
68 | | dsSAVEPIXELS |
69 | | ) |
70 | | ) |
71 | | (if (== temp0 {COURSE ALREADY ACHIEVED}) |
72 | | (scanBut state: 0) |
73 | | (= state 5) |
74 | | ) |
75 | | (= seconds 3) |
76 | | |
77 | | ) |
78 | | (2 |
79 | | (if local4 (localproc_003c local4) (= local4 0)) |
80 | | (if (!= global213 global214) (= cycles 2)) |
81 | | ) |
82 | | (3 |
83 | | (= local4 |
84 | | (Display |
85 | | {COURSE LOCKED} |
86 | | dsWIDTH |
87 | | 135 |
88 | | dsALIGN |
89 | | 1 |
90 | | dsCOORD |
91 | | 168 |
92 | | 3 |
93 | | dsCOLOR |
94 | | 9 |
95 | | dsFONT |
96 | | 600 |
97 | | dsSAVEPIXELS |
98 | | ) |
99 | | ) |
100 | | (= seconds 3) |
101 | | ) |
102 | | (4 |
103 | | (if local4 (localproc_003c local4) (= local4 0)) |
104 | | (= cycles 1) |
105 | | ) |
106 | | (5 |
107 | | (localproc_003c |
108 | | (Format @local55 {DESTINATION : SECTOR %d} global217) |
109 | | ) |
110 | | (= global220 local155) |
111 | | (global2 newRoom: 17) |
112 | | ) |
113 | | (6 |
114 | | (global2 newRoom: 17) |
115 | | ) |
116 | | ) |
117 | | ) |
118 | | ) |
119 | | |
120 | | |
121 | | That should make COURSE ALREADY ACHIEVED display for 3 seconds before changing to room17. |
122 | | |