SCRIPT FORMAT:
Every User may have a script, its name always is USER%n.SCRIPT and
this script is being put into the scripts/ subdirectory of the
bouncerdirectory. Same for executables, they have to be put into the
script-Dir.
General Syntax:
function event fromuserhost/name to content script
FUNCTIONS:
dccchat - take a dcc chat request (and answer possibly)
dccsend - user sends a file (autoaccept ?)
server - process a message from the server to the client
defined in event from fromuserhost to "to"
dialogue - talk to the user via the nick "to" in brackets
ctcp - process a ctcp defined in event from user to "to"
alias - intercept the command in "event"
An example for a user Script:
--------
; dialogues
dialogue - - news - scripts/newsticker
dialogue - - sms - scripts/sendsms
; intercept dcc chats for our file server, only from some users
dccchat - *!*john@*.myisp.com - - scripts/fileserver
dccchat - *!*jack@*.myisp.com - - scripts/fileserver
dccchat - *!*lamer@*.dumb.org - - scripts/eliza
; intercept dcc files for my own sending
dccsend - *!*john@*.myisp.com - - scripts/fileget
dccsend - *!*jack@*.myisp.com - - scripts/fileget
; some server-events
server JOIN *!*pope@*.vatican.va #satan - echo "PRIVMSG #satan

amned !"
server KICK *!*@* joe - echo "PRIVMSG $NICK :Hey, dont kick Joe !"
server PRIVMSG *!*@* * *idiot* echo "KICK $TO $NICK :Word kick on idiot"
; two ctcps
ctcp VERSION *!*@* - - echo "PRIVMSG $NICK :"$X01"VERSION"$X01" psyBNC2.2 (c) by the most psychoid"
ctcp FINGER *!*@* - - echo "PRIVMSG $NICK :"$X01"FINGER"$X01" Don't finger me"
; alias
alias maillog "Mail me my log" - - mail
me@myisp.com < ~me/psybnc/log/psybnc.log; echo Mail sent >&2
----------
structure like the following:
CONSTANTS in the environment:
$NICK - nickname of the sender
$IDENT - ident of the sender
$HOST - host of the sender
$USER - nick!ident@host
$CMD - command triggered
$TO - destination of the command
$CONTENT - content of the command
$P1 ... Pn - CONTENT in different parameters
$USERNUMBER - Number of the User triggering the script
$USERLOGIN - Login of the User triggering the script
$USERNICK - Nickname of the User triggering the script
In the case of a DIALOGUE (permanent background):
$MYNICK - dialogue from-nick for the User (appears as (nick) query
In the case of a DCC FILE Offer:
$IP - Ip the receiver waits for a connect
$PORT - Port of the receiver waits for a connect
In the case of a DCC FILE Offer and Get:
$FILE - Name of the file to send/receive
STDIN, STDOUT and STDERR are in the case of the following functions:
a DCC Chat: (background)
- STDIN = output goes to psybnc, input comes from the dcc chat
- STDOUT = output goes to the dcc chat
- STDERR = LOG of the bouncer
a DCC FILE SEND: (ran at event, can be backgrounded)
- STDIN = output goes to psybnc (commands, to the server, raw Format)
- STDOUT = output goes to psybnc (commands, to the server, raw Format)
- STDERR = LOG of the bouncer
a SERVER-EVENT: (ran at event)
- STDIN = output goes to the user, no input
- STDOUT = output goes to psybnc (commands, to the server, raw Format)
- STDERR = LOG of the bouncer
a DIALOGUE: (background, started on first query)
- STDIN = Input from the User to our nick (stripped off PRIVMSG etc.)
- STDOUT = Output from our nick to the User (stripped off PRIVMSG etc.)
- STDERR = LOG of the bouncer
a CTCP: (ran on event)
- STDIN = Output goes to the User (in raw format)
- STDOUT = Output goes to psybnc (commands, to the server, raw format)
- STDERR = Log of the bouncer
an ALIAS: (ran on trigger)
- STDIN = Output to the User (in raw Format)
- STDOUT = Output to psybnc (in raw Format)
- STDERR = LOG of the bouncer
About dccchat events:
- the User will receive a dcc chat request from someone on irc
- it has to match a host in the Script
- the script will be called, after the DCC Chat Request was
sent, so the script needs to answer the Request automatically
before any connection gets established, by
ECHO "DCCANSWER $NICK" >&0 (this would send psybnc the command to accept)
then, if the chat got established, the task receives
CONNECTED
It should timeout after some time.
If you created or changed your script while psyBNC runs, just
put your script into the script dir, then use
/SRELOAD
on the bouncer to reload your script.
About dialogues:
- A dialogue may be any command, that can stay in the background
and feed the output with text-data and waits for input on stdin.
The User will get a Query from ($TO) (in brackets) and can
answer the running task or interact in any way he wants.
Another comment:
psyBNC scripting processes fork from the main task to deny blocking
of other users. This could not be solved in another way.
Providerowners possibly would like to disable this function.