SLirc Drop in Scripts ===================== Now support for drop in scripts seems to be working. The basic idea is this. You can, in your own scripts, register functions to be triggered by certain events. These are currently: 1) Commands 2) Protocol events This should mean that you never have to edit any other scripts... So you can upload your scripts individually to ftp://sentient.entity.org/incoming/, drop me a mail at slirc@non.entity.org, and we can just go ahead and use them by putting them into config.sl. So... Add away. Specifics: These are done by: 1) Commands Use register_cmd_action to register your event. For example, to make a function which runs when you type "/JOIN", then do: register_cmd_action("JOIN", "yourfunction"); The parameter to join will be in the string "action_param". 2) Protocol Events Define your function. Then call: register_action(thing, function); So to register the following to be run everytime someone quits a channel: define myfunction() { irc_log("Argh!"); return 0; } Do: register_action("QUIT", "myfunction"); The usual rules about Rpms[] apply. For both the above, you can use a key of "*" to run your function everytime any event of that type might occur. See flip.sl for a decent example of this in action. Each registered function should return an integer +1,0,-1. +1: it overrides the normal handler for the command or response. 0: the normal handler will still be executed, but the command or response will be considered to have been handled even if there is no specific default handler. -1: if there is no specific handler, then the fallthrough, or error, handler will execute. Coming soon, maybe: (1) a time-out for registered functions, so that the handler will automatically be deleted if it hasn't triggered by that time. (2) a `one-shot' mode for handlers -- so they will be deleted if, for example, they return a certain value. Maybe 15,16,17 would mean return -1,0,+1 AND delete me. These features would seem useful for actions which may themselves need to issue commands and wait for responses before proceeding.