-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfunction.tin
149 lines (132 loc) · 2.72 KB
/
function.tin
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
141
142
143
144
145
146
147
148
149
#substitute {~\e[1;37mExits: %1} {\e[1;37mExits: @dir_link{%1}}
#var {dir_table} {{North}{n}{Northeast}{ne}{East}{e}{Southeast}{se}{South}{s}{Southwest}{sw}{West}{w}{Northwest}{nw}{Up}{u}{Down}{d}}
#event {PRESSED LINK DIR MOUSE BUTTON ONE}
{
#if {&dir_table[%4]}
{
#line sub var #send {$dir_table[%4]}
}
}
#function dir_link
{
#var result {%0};
#replace result {\b%+\b} {\e]68;1;DIR;&1\a\e[4m&1\e[24m};
}
#function goto {
#delay {2}{goto};
#return {gotogoto}
}
#function openship {
open %0;
enter %0;
close;
#map leave;
#return {lastship}
}
#function closeship {
open;
leave;
close %0;
refuel %0 full;
@goto{};
#return {lastship}
}
#function tracking {
#nop F5, Hide, Track target, Room $alreadyInRoom;
#if {"$alreadyInRoom" == "0"}
{
#action {You're already in the same room!}
{
ap $targets[1];
#action {You step closer to%*}
{
#if ("$hide" == "1") {
hide;
};
draw;
$ambushOrBackstab $targets[1];
#unaction {You step closer to%*};
};
#unaction {You're already in the same room!};
};
};
#if {"$targets[1]" == "$targets[1]"}
{
#echo {TRACKING: $targets[1]};
track $targets[1];
#action {You sense a trail towards the northwest...}
{
nw;
#unaction You sense a trail towards the northwest...
};
#action {You sense a trail towards the northeast...}
{
ne;
#unaction You sense a trail towards the northeast...
};
#action {You sense a trail towards the southwest...}
{
sw;
#unaction You sense a trail towards the southwest...
};
#action {You sense a trail towards the southeast...}
{
se;
#unaction You sense a trail towards the southeast...
};
#action {You sense a trail towards the south...}
{
s;
#unaction You sense a trail towards the south...
};
#action {You sense a trail towards the west...}
{
w;
#unaction You sense a trail towards the west...
};
#action {You sense a trail towards the east...}
{
e;
#unaction You sense a trail towards the east...
};
#action {You sense a trail towards the north...}
{
n;
#unaction You sense a trail towards the north...
};
#action {You sense a trail towards the up...}
{
u;
#unaction You sense a trail towards the up...
};
#action {You sense a trail towards the down...}
{
d;
#unaction You sense a trail towards the down...
};
};
#else
{
#echo Hiding;
hide
}
}
#function draw
{
#if {$scanOn == 1}
{
#bell;
#if {$gotovar == 1} {goto};
#variable boxes[19] \nHolster;
draw %0;
#variable scanOn 0;
};
#else {
#bell;
#if {$gotovar == 1} {goto};
#variable boxes[19] \nDraw;
holster %0;
#variable scanOn 1
};
#return {result}
}