-
Notifications
You must be signed in to change notification settings - Fork 1
/
irc.tin
248 lines (231 loc) · 6.18 KB
/
irc.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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
#ACTION {^:%1 = %2 :%3}
{
#if {"%1" != "PRIVMSG{.*}"}
{
#variable {i} {%3};
#replace {i} {~} {};
#replace {i} {@} {};
#replace {i} { } {;};
#forall {$i} {#tab {&0 }}
}
}
{9}
#ACTION {^:%S!%2 PRIVMSG %S :%4}
{
#if {"%3" == "${settings.nick}"}
{
#variable {REPLY} {%1};
#list {messages.pm} {add} {<PM %1> %4};
#echo {\x3cPM %1\x3e %4}
};
#else
{
#list {messages.public} {add} {%1: %4};
#echo {%1: %4}
};
#line {gag}
}
{9}
#ACTION {^PING%*}
{
#variable {output} {%0};
#replace {output} {I} {O};
#send {$output};
#line {gag}
}
{9}
#ALIAS {^/plugin %s{disable|enable} %s{([\w-_])*}$}
{
#if {"%2" == "enable"}
{
#script {if [ -h "plugins-enabled/%4.tin" ]; then echo "#echo {Plugin '%4' is already enabled.}";elif [ ! -e "plugins/%4.tin" ]; then echo "#echo {Plugin '%4' not found.}";else if [ ! -d "plugins-enabled" ]; then mkdir "plugins-enabled";fi;ln -s "$(readlink -f $0 | sed -e 's/\/sh$//')/plugins/%4.tin" "$(readlink -f $0 | sed -e 's/\/sh$//')/plugins-enabled/%4.tin";echo "#class {%4} {read} {plugins-enabled/%4.tin};#echo {Plugin '%4' enabled.}";fi}
};
#else
{
#script {if [ ! -h "plugins-enabled/%4.tin" ]; then echo "#echo {Plugin '%4' is not enabled.}";else unlink "plugins-enabled/%4.tin";rmdir "plugins-enabled" 2> /dev/null;echo "#class {%4} {kill};#echo {Plugin '%4' disabled.}";fi}
}
}
{8}
#ALIAS {^/quit$}
{
#send {QUIT :${settings.quitMessage}};
#end
}
{8}
#ALIAS {^/{act|do|me} %2}
{
#tab {/%1 };
#send {PRIVMSG $CHANNEL :\x01ACTION %2};
#echo { * ${settings.nick} %2}
}
{8}
#ALIAS {^/{co|con|conn|conne|connec|connect} %s%S %s%d$}
{
#nop {connect without ssl. To use ssl, prefix the port with a +};
#variable {SERVER} {%3};
#session {%3} {%3} {%5}
}
{8}
#ALIAS {^/{co|con|conn|conne|connec|connect} %s%S %s+%d$}
{
#nop {Connect using ssl.};
#variable {SERVER} {%3};
#ssl {%3} {%3} {%5}
}
{8}
#ALIAS {^/{j|jo|joi|join} %s%S$}
{
#variable {CHANNEL} {%3};
#send {JOIN %3}
}
{8}
#ALIAS {^/{msg|message} %s%S %4}
{
#send {PRIVMSG %3 :%4}
}
{8}
#ALIAS {^/{nic|nick} %s%S$}
{
#class {settings} {open};
#variable {settings.nick} {%3};
#class {settings} {write} {${HOME}/config.tin};
#class {settings} {close};
#send {NICK ${settings.nick}};
#send {USER ${settings.user} ${HOSTNAME} ${SERVER} :${settings.name}}
}
{8}
#ALIAS {^/{r|re|rep|repl|reply} %2}
{
#if {&{REPLY}}
{
#send {PRIVMSG ${REPLY} :%2}
};
#else
{
#echo {You have no one to whom you can currently reply.}
}
}
{8}
#ALIAS {%*}
{
#nop {All other aliases should be 8 or lower.};
#if {&{CHANNEL}}
{
#send {PRIVMSG ${CHANNEL} :%0};
#echo {${settings.nick}: %0}
};
#else
{
#send {%0}
}
}
{9}
#CONFIG {256 COLORS} {OFF}
#CONFIG {AUTO TAB} {5000}
#CONFIG {BUFFER SIZE} {20000}
#CONFIG {CHARSET} {ASCII}
#CONFIG {COLOR PATCH} {OFF}
#CONFIG {COMMAND COLOR} {<078>}
#CONFIG {COMMAND ECHO} {ON}
#CONFIG {CONNECT RETRY} {0}
#CONFIG {HISTORY SIZE} {1000}
#CONFIG {LOG} {RAW}
#CONFIG {PACKET PATCH} {0.00}
#CONFIG {REPEAT CHAR} {!}
#CONFIG {REPEAT ENTER} {OFF}
#CONFIG {SCROLL LOCK} {ON}
#CONFIG {SPEEDWALK} {OFF}
#CONFIG {TINTIN CHAR} {#}
#CONFIG {VERBATIM} {OFF}
#CONFIG {VERBATIM CHAR} {\}
#CONFIG {VERBOSE} {OFF}
#CONFIG {WORDWRAP} {ON}
#EVENT {PROGRAM START}
{
#nop {Set the home directory variable.};
#script {HOME} {if [ -z "$XDG_CONFIG_HOME" ] ; then if ! [ -d "$HOME/.config/tt-irc/" ] ; then mkdir -p "$HOME/.config/tt-irc";fi;echo -n "$HOME/.config/tt-irc";else if ! [ -d "$XDG_CONFIG_HOME/tt-irc/" ]; then mkdir -p "$XDG_CONFIG_HOME/tt-irc/";fi;echo -n "$XDG_CONFIG_HOME/tt-irc";fi};
#variable {HOME} {${HOME[1]}};
#script {if [ -e "$HOME/config.tin" ]; then echo "#class {settings} {read} {$HOME/config.tin}";fi};
#replace {HOME} {-n } {};
#system {if [ ! -d "$HOME/sounds" ]; then mkdir -p "$HOME/sounds";fi};
#nop {Load plugins, if any.};
#script {if [ -d "plugins-enabled" ]; then for i in plugins-enabled/*.tin ; do echo "#class {$(basename "$i" ".tin")} {read} {$i}";done;fi};
#nop {Find out if we have a display or not};
#script {GUI} {if [ -n "$DISPLAY" ]; then echo "true";else echo "false";fi};
#variable {GUI} {${GUI[1]}};
#nop {Get the host name};
#script {HOSTNAME} {echo "$HOSTNAME"};
#variable {HOSTNAME} {${HOSTNAME[1]}};
#nop {Set default nick and user info.};
#class {settings} {open};
#if {!&{settings.nick}}
{
#variable {settings.nick} {tt-irc-user}
};
#if {!&{settings.user}}
{
#variable {settings.user} {tt-irc-user}
};
#if {!&{settings.name}}
{
#variable {settings.name} {${settings.nick}}
};
#if {!&{settings.quitMessage}}
{
#variable {settings.quitMessage} {I ain't no quitter! Wait, maybe I am... Goodbye cruel IRC...}
};
#class {settings} {write} {${HOME}/config.tin};
#class {settings} {close}
}
#EVENT {RECEIVED LINE}
{
#if {"%0" != "PING{.*}"}
{
#variable {timeStamp.newText} {%0}
}
}
#EVENT {SECOND}
{
#if {%4 > 12}
{
#math {timeStamp.newTime} {%4 - 12};
#variable {timeStamp.newTime} {${timeStamp.newTime}:%5PM}
};
#else
{
#variable {timeStamp.newTime} {%4};
#variable {timeStamp.newTime} {${timeStamp.newTime}:%5AM}
};
#if {!&{timeStamp.oldTime}}
{
#variable {timeStamp.oldTime} {0}
};
#if {${timeStamp.newTime} != ${timeStamp.oldTime} && "${timeStamp.oldText}" != "${timeStamp.newText}"}
{
#echo {${timeStamp.newTime}};
#variable {timeStamp.oldText} {${timeStamp.newText}};
#variable {timeStamp.oldTime} {${timeStamp.newTime}}
}
}
#EVENT {SESSION CONNECTED}
{
#nop {register with the server};
#send {NICK ${settings.nick}};
#send {USER ${settings.user} ${HOSTNAME} ${SERVER} :${settings.name}}
}
#PATHDIR {d} {u} {32}
#PATHDIR {e} {w} {2}
#PATHDIR {n} {s} {1}
#PATHDIR {ne} {sw} {3}
#PATHDIR {nw} {se} {9}
#PATHDIR {s} {n} {4}
#PATHDIR {se} {nw} {6}
#PATHDIR {sw} {ne} {12}
#PATHDIR {u} {d} {16}
#PATHDIR {w} {e} {8}
#SUBSTITUTE {^:%S!%2 PRIVMSG #%3 :%4} {%1: %4} {1}
#TAB {/connect }
#TAB {/join }
#TAB {/msg }
#TAB {/plugin }
#TAB {/reply }