IRC events ~~~~~~~~~~ Incoming IRC server messages are delivered in 4 stages, by calling the following fungw registered functions in all scripts, in this order: pre_CMD() on_CMD() post_CMD() The order of execution within a stage is random. If the pre_ or on_ stage calls hook_block(), the next stages are not ran. CMD is a standard irc command, e.g. privmsg, join, kick or numerics like 433. Incoming CTCP requests and responses are stripped off of the \001 marks and are renamed to ctcp_req or ctcp_resp - the former is the privmsg variant and the latter is the notice variant. So to capture CTCP requests, register a function called on_ctcp_req(). Irc events are delivered to functions with two args: function pre_433(from, argc) where from is a string that is a nickname or server name (originator of the message/command) and argc is an integer number of arguments the command has. Command arguments can be queried using function hook_arg(0) .. hook_arg(argc-1). Further details of the origin of the command can be queried with the following calls (without argument): hook_from_nick() - same as the from argument above hook_from_ident() - the ident of the sender, if it is a nick (else empty string) hook_from_host() - the hostname of the sender, if it is a nick (else empty string) hook_from_hostmask - the hostmask of the sender in nick!ident@host format Misc events ~~~~~~~~~~~ on_query_alloc(server_id, nickname) Incoming message without window; server_id is an integer and nickname is a string. The caller will search for a window again after the call so the script has a chance to allocate one. Note: the script needs to check if another script did not allocate a window already. on_tick_second() Called once a second. on_tick_minute() Called once a minute.