/[cvs]/eggdrop1.9/doc/SCRIPTING-COMMANDS
ViewVC logotype

Contents of /eggdrop1.9/doc/SCRIPTING-COMMANDS

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.6 - (show annotations) (download)
Fri Apr 4 20:41:54 2003 UTC (16 years, 6 months ago) by stdarg
Branch: MAIN
Changes since 1.5: +8 -0 lines
* match_nick script function... to match nicks.

1 Eggdrop Scripting Commands
2 Last revised: March 01, 2003
3 _________________________________________________________________
4
5 This is an exhaustive list of all of the scripting commands added to Eggdrop.
6 All of the normal built-in commands specific to the scripting module you are
7 using are still there, of course, but you can also use these to manipulate
8 features of the bot. They are listed according to category. This list is
9 accurate for Eggdrop v1.7.0.
10
11 *** CORE COMMANDS ***
12
13 putlog <text>
14 Description: sends text to the bot's logfile, marked as 'misc' (o)
15 Returns: nothing
16 Module: core
17
18 putloglev <level(s)> <channel> <text>
19 Description: sends text to the bot's logfile, tagged with all of the
20 valid levels given. Use "*" to indicate all log levels.
21 Returns: nothing
22 Module: core
23
24 <FINISH ME>
25
26 *** BLOWFISH/ENCRYPTION MODULE COMMANDS ***
27
28 <WRITE ME>
29
30
31 *** CHANNELS MODULE COMMANDS ***
32
33 setlaston <handle> <when> [channel]
34 Description: updates a user's laston information with the information
35 provided.
36 Returns: nothing
37 Module: channels
38
39 newban [channel] <ban> <creator> <comment> [lifetime] [options]
40 Description: adds a ban to the global ban list (which takes effect on
41 all channels); creator is given credit for the ban in the ban list.
42 lifetime is specified in minutes. If lifetime is not specified,
43 global-ban-time (usually 60) is used. Setting the lifetime to 0 makes
44 it a permanent ban.
45 Options:
46 sticky: forces the ban to be always active on a channel, even
47 with dynamicbans on
48 none: no effect
49 Returns: nothing
50 Module: channels
51
52 newexempt [channel] <exempt> <creator> <comment> [lifetime] [options]
53 Description: adds a exempt to the global exempt list (which takes effect
54 on all channels); creator is given credit for the exempt in the exempt
55 list. lifetime is specified in minutes. If lifetime is not specified,
56 exempt-time (usually 60) is used. Setting the lifetime to 0 makes it a
57 permanent exempt. The exempt will not be removed until the
58 corresponding ban has been removed.
59 Options:
60 sticky: forces the exempt to be always active on a channel, even
61 with dynamicexempts on
62 none: no effect
63 Returns: nothing
64 Module: channels
65
66 newinvite [channel] <invite> <creator> <comment> [lifetime] [options]
67 Description: adds a invite to the global invite list (which takes effect
68 on all channels); creator is given credit for the invite in the invite
69 list. lifetime is specified in minutes. If lifetime is not specified,
70 invite-time (usually 60) is used. Setting the lifetime to 0 makes it
71 a permanent invite. The invite will not be removed until the channel
72 has gone -i.
73 Options:
74 sticky: forces the invite to be always active on a channel, even
75 with dynamicinvites on
76 none: no effect
77 Returns: nothing
78 Module: channels
79
80 stickban [channel] <banmask>
81 Description: makes a ban sticky, or, if a channel is specified, then it
82 is set sticky on that channel only.
83 Returns: 1 on success; 0 otherwise
84 Module: channels
85
86 unstickban [channel] <banmask>
87 Description: makes a ban no longer sticky, or, if a channel is
88 specified, then it is unstuck on that channel only.
89 Returns: 1 on success; 0 otherwise
90 Module: channels
91
92 stickexempt [channel] <exemptmask>
93 Description: makes an exempt sticky, or, if a channel is specified,
94 then it is set sticky on that channel only.
95 Returns: 1 on success; 0 otherwise
96 Module: channels
97
98 unstickexempt [channel] <exemptmask>
99 Description: makes an exempt no longer sticky, or, if a channel is
100 specified, then it is unstuck on that channel only.
101 Returns: 1 on success; 0 otherwise
102 Module: channels
103
104 stickinvite [channel] <invitemask>
105 Description: makes an invite sticky, or, if a channel is specified,
106 then it is set sticky on that channel only.
107 Returns: 1 on success; 0 otherwise
108 Module: channels
109
110 unstickinvite [channel] <invitemask>
111 Description: makes an invite no longer sticky, or, if a channel is
112 specified, then it is unstuck on that channel only.
113 Returns: 1 on success; 0 otherwise
114 Module: channels
115
116 killban [channel] <ban>
117 Description: removes a ban from the global ban list
118 Returns: 1 on success; 0 otherwise
119 Module: channels
120
121 killexempt [channel] <exempt>
122 Description: removes an exempt from the global exempt list
123 Returns: 1 on success; 0 otherwise
124 Module: channels
125
126 killinvite [channel] <invite>
127 Description: removes an invite from the global invite list
128 Returns: 1 on success; 0 otherwise
129 Module: channels
130
131 ischanjuped [channel]
132 Returns: 1 if the channel is juped, and the bot is unable to join; 0
133 otherwise
134 Module: channels
135
136 isban [channel] <ban>
137 Returns: 1 if the specified ban is in the global ban list; 0 otherwise.
138 If a channel is specified, that channel's ban list is checked as well.
139 Module: channels
140
141 ispermban [channel] <ban>
142 Returns: 1 if the specified ban is in the global ban list AND is marked
143 as permanent; 0 otherwise. If a channel is specified, that channel's
144 ban list is checked as well.
145 Module: channels
146
147 isexempt [channel] <exempt>
148 Returns: 1 if the specified exempt is in the global exempt list; 0
149 otherwise. If a channel is specified, that channel's exempt list is
150 checked as well.
151 Module: channels
152
153 ispermexempt [channel] <exempt>
154 Returns: 1 if the specified exempt is in the global exempt list AND is
155 marked as permanent; 0 otherwise. If a channel is specified, that
156 channel's exempt list is checked as well.
157 Module: channels
158
159 isinvite [channel] <invite>
160 Returns: 1 if the specified invite is in the global invite list; 0
161 otherwise. If a channel is specified, that channel's invite list is
162 checked as well.
163 Module: channels
164
165 isperminvite [channel] <invite>
166 Returns: 1 if the specified invite is in the global invite list AND is
167 marked as permanent; 0 otherwise. If a channel is specified, that
168 channel's invite list is checked as well.
169 Module: channels
170
171 isbansticky [channel] <ban>
172 Returns: 1 if the specified ban is marked as sticky in the global ban
173 list; 0 otherwise. If a channel is specified, that channel's ban list
174 is checked as well.
175 Module: channels
176
177 isexemptsticky [channel] <exempt>
178 Returns: 1 if the specified exempt is marked as sticky in the global
179 exempt list; 0 otherwise. If a channel is specified, that channel's
180 exempt list is checked as well.
181 Module: channels
182
183 isinvitesticky [channel] <invite>
184 Returns: 1 if the specified invite is marked as sticky in the global
185 invite list; 0 otherwise. If a channel is specified, that channel's
186 invite list is checked as well.
187 Module: channels
188
189 matchban [channel] <nick!user@host>
190 Returns: 1 if the specified nick!user@host matches a ban in the global
191 ban list; 0 otherwise. If a channel is specified, that channel's ban
192 list is checked as well.
193 Module: channels
194
195 matchexempt [channel] <nick!user@host>
196 Returns: 1 if the specified nick!user@host matches an exempt in the
197 global exempt list; 0 otherwise. If a channel is specified, that
198 channel's exempt list is checked as well.
199 Module: channels
200
201 matchinvite [channel] <nick!user@host>
202 Returns: 1 if the specified nick!user@host matches an invite in the
203 global invite list; 0 otherwise. If a channel is specified, that
204 channel's invite list is checked as well.
205 Module: channels
206
207 listbans [channel]
208 Returns: a list of global bans, or, if a channel is specified, a
209 list of channel-specific bans. Each entry is a sublist containing:
210 hostmask, comment, expiration timestamp, time added, last time
211 active, and creator. The three timestamps are in unixtime format.
212 Module: channels
213
214 listexempts [channel]
215 Returns: a list of global exempts, or, if a channel is specified, a
216 list of channel-specific exempts. Each entry is a sublist containing:
217 hostmask, comment, expiration timestamp, time added, last time
218 active, and creator. The three timestamps are in unixtime format.
219 Module: channels
220
221 listinvites [channel]
222 Returns: a list of global invites, or, if a channel is specified, a
223 list of channel-specific invites. Each entry is a sublist containing:
224 hostmask, comment, expiration timestamp, time added, last time
225 active, and creator. The three timestamps are in unixtime format.
226 Module: channels
227
228 <FINISH ME>
229
230
231 *** COMPRESS MODULE COMMANDS ***
232
233 <WRITE ME>
234
235
236 *** CONSOLE MODULE COMMANDS ***
237
238 <WRITE ME>
239
240
241 *** FILESYS MODULE COMMANDS ***
242
243 <WRITE ME>
244
245
246 *** IRC MODULE COMMANDS ***
247
248 putkick <channel> <nick,nick,...> [reason]
249 Description: sends kicks to the server and tries to put as many nicks
250 into one kick command as possible.
251 Returns: nothing
252
253 <FINISH ME>
254
255
256 *** NOTES MODULE COMMANDS ***
257
258 <WRITE ME>
259
260
261 *** SCRIPT MODULE COMMANDS ***
262
263 <WRITE ME>
264
265
266 *** SERVER MODULE COMMANDS ***
267
268 match_nick <nick1> <nick2>
269 Description: Compare nick1 and nick2 case independently, as specified by
270 the current server.
271 Notes: Should also be used for channel name matching.
272 Returns: < 0 if nick1 < nick2
273 = 0 if nick1 = nick2
274 > 0 if nick1 > nick2
275
276 putserv [noqueue|quick|normal|slow] [next] <text>
277 Description: sends text to the server through the specified queue. The
278 default queue is the normal queue. You can specify the "next"
279 option even if you are using other options.
280 Options:
281 noqueue: send the message without waiting
282 quick: high priority queue
283 normal: default queue
284 slow: low priority queue
285 Returns: nothing
286
287 server_fake_input <text>
288 Description: Causes the server module to interpret the given text as if
289 the server had sent it.
290 Returns: Nothing
291
292 server_support <field>
293 Description: Provides an interface to the 005 numeric.
294 Returns: The value of the field (parsed from fieldname=fieldvalue) or
295 the string "true" for items with no value.
296
297 channel_list
298 Returns: the list of channels that the bot is currently on
299
300 channel_members <chan>
301 Returns: the list of nicks on the given channel
302
303 channel_get_uhost <nick>
304 Returns: the uhost for the given nick, or "" if unknown
305
306 channel_topic <chan>
307 Returns: the topic, nick that set the topic, time topic was set
308
309 channel_mode <chan> [nick]
310 Returns: Either the mode of the channel, with no arguments (such as key),
311 or the mode of the nick on that channel (if given).
312
313 channel_key <chan>
314 Returns: The key of the given channel.
315
316 channel_limit <chan>
317 Returns: The limit of the given channel.
318
319 channel_bans <chan>
320 Returns: The list of bans in the channel. Each item of the list is itself
321 a list of the form {banmask, who_set_it, when_it_was_set}
322
323 server_queue_len <queue> [next]
324 Returns: Number of messages in the given queue
325
326 server_queue_get [queue] [next] <msgnum>
327 Description: Allows scripts to read the server's output queues. Messages
328 start at number 0. If [queue] isn't given, the normal queue is assumed.
329 Returns: The text of the desired message
330
331 server_queue_set [queue] [next] <msgnum> <msg>
332 Description: Allows scripts to overwrite messages in the server's output
333 queues. If [queue] isn't given, the normal queue is assumed.
334 Returns: Nothing
335
336 server_queue_insert [queue] [next] <msgnum> <msg>
337 Description: Inserts messages into the given output queue. To add a message
338 to the end, make <msgnum> larger than the current queue length. Or use
339 putserv :)
340 Returns: Nothing
341
342 dcc_chat <nick> [timeout]
343 Description: Starts a dcc chat with the given nick.
344 Returns: An unconnected idx.
345
346 dcc_send <nick> <filename> [timeout]
347 Description: Starts a dcc send with the given nick. Resumes are handled
348 automatically.
349 Returns: An unconnected idx.
350
351 dcc_send_info <idx> <stat-type>
352 Description: Returns information about a dcc send.
353 Options for stat-type:
354 bytes_left: number of bytes remaining to be sent
355 bytes_sent: number of bytes already sent
356 total_cps: average cps since the send began
357 snapshot_cps: average cps over the last several seconds
358 Returns: The requested information
359
360 dcc_accept_send <nick> <localfile> <remotefile> <size> <resume> <ip> <port> [timeout]
361 Description: Accepts a dcc send, as triggered by the dcc_recv bind.
362 Returns: An unconnected idx
363
364 <FINISH ME>
365
366
367 *** GLOBAL VARIABLES ***
368
369 botnick
370 Value: the current nickname the bot is using on IRC
371 Module: server
372
373 server
374 Value: the server list index of the current server the bot is using
375 Module: server
376
377 servidx
378 Value: the idx of the server socket
379 Module: server
380
381 <FINISH ME>
382
383
384 *** BINDS ***
385
386 <WRITE ME>
387
388 *** NETWORK COMMANDS ***
389
390 net_listen <port>
391 Description: Opens a listening port. If <port> is in use, it will try up to
392 20 higher ports until a free one is found.
393 Returns: A list of 2 items: The new idx, and the real port being used.
394 Notes: When an incoming connection is accepted, the "newclient" event will
395 execute.
396
397 net_open <host> <port> [timeout]
398 Description: Opens an async connection to the given host and port. If
399 'host' is not an ip address, a dns lookup is performed without blocking.
400 The 'timeout' optional parameter lets you specify a connection timeout
401 in milliseconds. If not given, or if the value is 0, then eggdrop's
402 default timeout value is used. If given as -1, no timeout is used.
403 Returns: A valid idx in an unconnected state.
404 Notes: When the connection is established, the "connect" event will
405 execute. If there is a dns error, a connection error, or the timeout
406 elapses, the "eof" event will execute with the appropriate error code.
407 Use the net_handler command to set handlers for these events.
408
409 net_close <idx>
410 Description: Close the given idx.
411 Returns: 0 for success, -1 if the idx is invalid or already closed.
412
413 net_write <idx> <text> [len]
414 Description: Writes data to an idx.
415 Returns: The number of bytes written to the actual network interface, or
416 -1 upon error.
417 Notes: Any unwritten data is buffered and will be written as soon as
418 possible. Use the 'len' parameter if you are writing binary data which
419 contains embedded NULL's, otherwise the C strlen() function is used to
420 determined the number of bytes to write.
421
422 net_handler <idx> <event> [callback]
423 Description: Sets or unsets a callback for a particular event on an idx.
424 The syntax of the callback varies with the event:
425 connect_callback <idx> <peer_ip> <peer_port>
426 Called when the idx establishes an outgoing connection.
427 newclient_callback <idx> <newidx> <peer_ip> <peer_port>
428 Called when an incoming connection is established.
429 eof_callback <idx> <err> <errmsg>
430 Called when eof is detected or there is an error, such as when the
431 connection times out or is refused by the host.
432 read_callback <idx> <data> <len>
433 Called when data is ready on the idx, after any filtering has been
434 performed. (For more information, see net_linemode.)
435 written_callback <idx> <len> <remaining_len>
436 Called when buffered data has been written in the background.
437 delete_callback <idx>
438 Called when the idx is deleted.
439 Returns: 0 for success, -1 for an invalid idx, -2 for an invalid event type.
440 Notes: To unset a handler, leave off the 'callback' parameter.
441
442 net_info <idx> <what>
443 Description: Provides statistics on a given idx. Possible values for 'what'
444 are:
445 bytesleft - number of buffered bytes remaining to be written
446
447 net_linemode <idx> <on-off>
448 Description: Sets line buffering to either on (1) or off (0) for an idx.
449 When linemode is on, data is buffered until a full line is read. If more
450 than one line is read, the "read" event is triggered for each individual
451 line. The line is passed to the read handler with the end-of-line (either
452 CR, LF, or CRLF) stripped from the data.
453 Returns: Nothing.
454
455 net_throttle <idx> <speed-in> <speed-out>
456 Description: Turn on speed throttling. The values given are in bytes per
457 second.
458 Returns: Nothing.
459 Notes: A speed parameter of <= 0 will disable throttling for that direction.
460
461 net_throttle_in <idx> <speed-in>
462 Description: Modify the 'speed-in' parameter of an already-throttled idx.
463 Returns: Nothing.
464 Notes: A 'speed-in' of <= 0 will disable input throttling.
465
466 net_throttle_out <idx> <speed-out>
467 Description: Modify the 'speed-out' parameter of an already-throttled idx.
468 Returns: Nothing.
469 Notes: A 'speed-out' of <= 0 will disable output throttling.
470
471 net_throttle_off <idx>
472 Description: Removes throttling from an idx.

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23