From 3fed2165c47cc8b70fd80eedd471bbc2754c7201 Mon Sep 17 00:00:00 2001 From: unknown_lamer Date: Thu, 7 Jul 2005 23:24:24 +0000 Subject: [PATCH] [project @ 2005-07-07 23:24:24 by unknown_lamer] Merged doc patch --- ChangeLog | 1 + bobot++.info | 340 ++++++++++++++++++++++++------------------------ bobot++.texinfo | 111 ++++++++++++---- 3 files changed, 258 insertions(+), 194 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0d4b81a..290261c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,7 @@ (Using the Bot): Added some intro text (Concepts): New section, all of the level sections are now subsections of this + Merged small doc patch from dsmith * source/Interp.C (interp_init_helper): Added bot:shit/none /no-ban, /no-kick, and /no-deop constants to Scheme diff --git a/bobot++.info b/bobot++.info index 0f3f712..88afb4b 100644 --- a/bobot++.info +++ b/bobot++.info @@ -71,12 +71,19 @@ Concepts * Automatic Op:: * Shit Levels:: +Built-In Commands + +* Message Commands:: +* User List Commands:: + Scripting * Adding New Commands:: * Hooks:: * Sending Messages:: * Misc Scripting Stuff:: +* Scheme Commands:: +* Query Functions:: Hooks @@ -95,6 +102,11 @@ Sending Messages * High Level Message Functions:: * Low Level Message Functions:: +Misc. Scripting Stuff + +* Scheme Commands:: +* Query Functions:: +  File: bobot++.info, Node: Introduction, Next: Configuration, Prev: Top, Up: Top @@ -550,10 +562,34 @@ to use whatever you defined the command char to be in `bot.conf'. If a command needs the channel name then you must specify the channel as the first argument to the command when private messaging the bot a command. +* Menu: + +* Message Commands:: +* User List Commands:: + + +File: bobot++.info, Node: Message Commands, Next: User List Commands, Prev: Built-In Commands, Up: Built-In Commands + +3.3.1 Message Commands +---------------------- + COMMAND NEEDS MIN LEVEL DESCRIPTION CHANNEL TO USE `action' `do' Yes USER Causes the bot to perform the action `do' in the current channel. +`do' +`msg' +`say' Yes Makes the bot say MESSAGE on + CHANNEL. + + +File: bobot++.info, Node: User List Commands, Prev: Message Commands, Up: Built-In Commands + +3.3.2 User List Commands +------------------------ + +COMMAND NEEDS MIN LEVEL DESCRIPTION + CHANNEL TO USE `adduser' `addserver' Adds the server specified by HOST NAME or IP ADDRESS to the server @@ -585,7 +621,6 @@ COMMAND NEEDS MIN LEVEL DESCRIPTION shitlist. `deop' Yes Deops MASK or NICK on CHANNEL. `die' Makes the bot stop immediately. -`do' `execute' *Only available if scripting support is enabled* `help' @@ -608,7 +643,6 @@ COMMAND NEEDS MIN LEVEL DESCRIPTION `lock' Locks topic on CHANNEL. `mode' Yes Sends MODE STRING as mode for CHANNEL. -`msg' `names' Yes Shows the nicknames and status of users on CHANNEL. `nextserver' Makes the bot connect to the next @@ -626,8 +660,6 @@ COMMAND NEEDS MIN LEVEL DESCRIPTION current server. `rspymessage' Removes you from the spy list. `save' Saves the userlist. -`say' Yes Makes the bot say MESSAGE on - CHANNEL. `server' Select the server to connect to. SERVER NUMBER is the number of the server in the serverlist. @@ -683,6 +715,8 @@ strings unless otherwise specified. * Hooks:: * Sending Messages:: * Misc Scripting Stuff:: +* Scheme Commands:: +* Query Functions::  File: bobot++.info, Node: Adding New Commands, Next: Hooks, Prev: Scripting, Up: Scripting @@ -1129,7 +1163,7 @@ before using these. If you have no idea what these do, read rfc 2812 This is used to reply to a ctcp that the bot has received.  -File: bobot++.info, Node: Misc Scripting Stuff, Prev: Sending Messages, Up: Scripting +File: bobot++.info, Node: Misc Scripting Stuff, Next: Scheme Commands, Prev: Sending Messages, Up: Scripting 4.4 Misc. Scripting Stuff ========================= @@ -1141,13 +1175,19 @@ might want to know. bot:exit-hook THUNK' where THUNK is an argumentless procedure (a thunk). When the bot exits your thunk will be called. - [ I didn't know where to put any of these, so I just stuck them in - here. +* Menu: - There probably needs to be several sections added, like dealing - with users (kicking, added, etc), dealing with the bot (channels, - nickname of the bot, etc), server issues (serverlist), useful - tools (nslookup, whois), and do on. ] +* Scheme Commands:: +* Query Functions:: + + +File: bobot++.info, Node: Scheme Commands, Next: Query Functions, Prev: Misc Scripting Stuff, Up: Scripting + +4.5 Scheme Commands +=================== + +These scheme functions are the same as the commands. They allow you to +execute bot commands from scheme scripts. -- Function: bot:adduser nick-or-mask cbannel-mask level prot auto-op Adds an user to the userlist, for a `nick!user@host' matching the @@ -1232,9 +1272,6 @@ thunk). When the bot exits your thunk will be called. -- Function: bot:lock channel Locks topic on CHANNEL. - -- Function: bot:logport - [ Probably returns the log port? ] - -- Function: bot:mode channel mode-string Sends MODE-STRING as mode for CHANNEL. @@ -1283,6 +1320,28 @@ thunk). When the bot exits your thunk will be called. Sends a WHOIS command to NICK. NICK *must* be a nickname, you cannot send a WHOIS to a channel. + -- Function: bot:delcommand + [ Probably deletes a command added with `bot:addcommand' ? ] + + +File: bobot++.info, Node: Query Functions, Prev: Scheme Commands, Up: Scripting + +4.6 Query Functions +=================== + + [ I didn't know where to put any of these, so I just stuck them in + here. + + There probably needs to be several sections added, like dealing + with users (kicking, added, etc), dealing with the bot (channels, + nickname of the bot, etc), server issues (serverlist), useful + tools (nslookup, whois), and do on. ] + + These functions allow scripts to get various bits of information. + + -- Function: bot:logport + [ Probably returns the log port? ] + -- Function: bot:getnickname [ Gets the bot's nickname? ] @@ -1299,9 +1358,6 @@ thunk). When the bot exits your thunk will be called. -- Function: bot:random ? [ Returns a random number? What range? Why? ] - -- Function: bot:delcommand - [ Probably deletes a command added with `bot:addcommand' ? ] - -- Function: bot:addtimer ? ? -- Function: bot:deltimer ? @@ -1326,12 +1382,12 @@ thunk). When the bot exits your thunk will be called. -- Function: bot:use-module module-spec -- Function: bot:match-not-channel regex - match-not-channel adds a prefix regex to your REGEX so it doesn't - match the sender or channel in a PUBLIC message + `bot:match-not-channel' adds a prefix regex to your REGEX so it + doesn't match the sender or channel in a PUBLIC message -- Function: bot:match-to-me regex - match-to-me matches text that was addressed to the bot with a ':', - ',', or nothing after the bot name. + `bot:match-to-me' matches text that was addressed to the bot with a + ':', ',', or nothing after the bot name. -- Function: bot:sent-to-me? message @@ -1363,128 +1419,74 @@ Function Index [index] * Menu: -* %bot:load-extensions: Misc Scripting Stuff. - (line 214) +* %bot:load-extensions: Query Functions. (line 75) * bot:action: High Level Message Functions. (line 13) * bot:addcommand: Adding New Commands. (line 11) * bot:addhook: Creating a Hook. (line 9) -* bot:addserver: Misc Scripting Stuff. - (line 34) -* bot:addshit: Misc Scripting Stuff. - (line 38) -* bot:addtimer: Misc Scripting Stuff. - (line 175) -* bot:adduser: Misc Scripting Stuff. - (line 22) -* bot:ban: Misc Scripting Stuff. - (line 49) -* bot:change-command-level: Misc Scripting Stuff. - (line 54) +* bot:addserver: Scheme Commands. (line 22) +* bot:addshit: Scheme Commands. (line 26) +* bot:addtimer: Query Functions. (line 36) +* bot:adduser: Scheme Commands. (line 10) +* bot:ban: Scheme Commands. (line 37) +* bot:change-command-level: Scheme Commands. (line 42) * bot:ctcp: Low Level Message Functions. (line 13) -* bot:ctcp-quote: Misc Scripting Stuff. - (line 208) +* bot:ctcp-quote: Query Functions. (line 69) * bot:ctcp-reply: Low Level Message Functions. (line 18) -* bot:cycle: Misc Scripting Stuff. - (line 60) -* bot:dcc-chat-send: Misc Scripting Stuff. - (line 179) -* bot:deban: Misc Scripting Stuff. - (line 63) -* bot:delcommand: Misc Scripting Stuff. - (line 172) -* bot:delserver: Misc Scripting Stuff. - (line 67) -* bot:delshit: Misc Scripting Stuff. - (line 74) -* bot:deltimer: Misc Scripting Stuff. - (line 177) -* bot:deluser: Misc Scripting Stuff. - (line 71) -* bot:deop: Misc Scripting Stuff. - (line 77) -* bot:die: Misc Scripting Stuff. - (line 80) -* bot:do: Misc Scripting Stuff. - (line 83) -* bot:flush: Misc Scripting Stuff. - (line 163) -* bot:flushport: Misc Scripting Stuff. - (line 166) -* bot:getnickname: Misc Scripting Stuff. - (line 156) -* bot:getserver: Misc Scripting Stuff. - (line 159) -* bot:getserverlist: Misc Scripting Stuff. - (line 161) -* bot:invite: Misc Scripting Stuff. - (line 85) -* bot:join: Misc Scripting Stuff. - (line 88) -* bot:keep: Misc Scripting Stuff. - (line 91) -* bot:kick: Misc Scripting Stuff. - (line 94) -* bot:kickban: Misc Scripting Stuff. - (line 98) -* bot:load: Misc Scripting Stuff. - (line 192) -* bot:load-module: Misc Scripting Stuff. - (line 194) -* bot:lock: Misc Scripting Stuff. - (line 102) -* bot:log: Misc Scripting Stuff. - (line 187) -* bot:logport: Misc Scripting Stuff. - (line 105) -* bot:match-not-channel: Misc Scripting Stuff. - (line 198) -* bot:match-to-me: Misc Scripting Stuff. - (line 202) -* bot:mode: Misc Scripting Stuff. - (line 108) +* bot:cycle: Scheme Commands. (line 48) +* bot:dcc-chat-send: Query Functions. (line 40) +* bot:deban: Scheme Commands. (line 51) +* bot:delcommand: Scheme Commands. (line 141) +* bot:delserver: Scheme Commands. (line 55) +* bot:delshit: Scheme Commands. (line 62) +* bot:deltimer: Query Functions. (line 38) +* bot:deluser: Scheme Commands. (line 59) +* bot:deop: Scheme Commands. (line 65) +* bot:die: Scheme Commands. (line 68) +* bot:do: Scheme Commands. (line 71) +* bot:flush: Query Functions. (line 27) +* bot:flushport: Query Functions. (line 30) +* bot:getnickname: Query Functions. (line 20) +* bot:getserver: Query Functions. (line 23) +* bot:getserverlist: Query Functions. (line 25) +* bot:invite: Scheme Commands. (line 73) +* bot:join: Scheme Commands. (line 76) +* bot:keep: Scheme Commands. (line 79) +* bot:kick: Scheme Commands. (line 82) +* bot:kickban: Scheme Commands. (line 86) +* bot:load: Query Functions. (line 53) +* bot:load-module: Query Functions. (line 55) +* bot:lock: Scheme Commands. (line 90) +* bot:log: Query Functions. (line 48) +* bot:logport: Query Functions. (line 17) +* bot:match-not-channel: Query Functions. (line 59) +* bot:match-to-me: Query Functions. (line 63) +* bot:mode: Scheme Commands. (line 93) * bot:msg: High Level Message Functions. (line 16) -* bot:nextserver: Misc Scripting Stuff. - (line 111) -* bot:nick: Misc Scripting Stuff. - (line 114) +* bot:nextserver: Scheme Commands. (line 96) +* bot:nick: Scheme Commands. (line 99) * bot:notice: High Level Message Functions. (line 27) -* bot:op: Misc Scripting Stuff. - (line 117) -* bot:part: Misc Scripting Stuff. - (line 120) -* bot:random: Misc Scripting Stuff. - (line 169) -* bot:reconnect: Misc Scripting Stuff. - (line 123) +* bot:op: Scheme Commands. (line 102) +* bot:part: Scheme Commands. (line 105) +* bot:random: Query Functions. (line 33) +* bot:reconnect: Scheme Commands. (line 108) * bot:say: High Level Message Functions. (line 7) -* bot:sent-to-me?: Misc Scripting Stuff. - (line 206) -* bot:server: Misc Scripting Stuff. - (line 126) -* bot:setfloodrate: Misc Scripting Stuff. - (line 130) -* bot:setversion: Misc Scripting Stuff. - (line 132) -* bot:tban: Misc Scripting Stuff. - (line 134) -* bot:tkban: Misc Scripting Stuff. - (line 137) -* bot:topic: Misc Scripting Stuff. - (line 141) -* bot:unlock: Misc Scripting Stuff. - (line 145) -* bot:use-module: Misc Scripting Stuff. - (line 196) -* bot:who: Misc Scripting Stuff. - (line 148) -* bot:whois: Misc Scripting Stuff. - (line 152) +* bot:sent-to-me?: Query Functions. (line 67) +* bot:server: Scheme Commands. (line 111) +* bot:setfloodrate: Scheme Commands. (line 115) +* bot:setversion: Scheme Commands. (line 117) +* bot:tban: Scheme Commands. (line 119) +* bot:tkban: Scheme Commands. (line 122) +* bot:topic: Scheme Commands. (line 126) +* bot:unlock: Scheme Commands. (line 130) +* bot:use-module: Query Functions. (line 57) +* bot:who: Scheme Commands. (line 133) +* bot:whois: Scheme Commands. (line 137) * hooks/action: Received Message Hooks. (line 9) * hooks/ctcp: Received Message Hooks. @@ -1540,49 +1542,51 @@ Variable Index [index] * Menu: -* %bot:loadpath: Misc Scripting Stuff. - (line 212) -* exit-hook: Misc Scripting Stuff. - (line 9) +* %bot:loadpath: Query Functions. (line 73) +* exit-hook: Misc Scripting Stuff. (line 9)  Tag Table: Node: Top538 -Node: Introduction2008 -Node: Configuration2320 -Node: Configuration File Placement2764 -Node: Configuration Files3265 -Node: bot.conf3501 -Node: server syntax5687 -Node: channel syntax6485 -Node: bot.users7529 -Node: bot.init8990 -Node: bot.autoexec9649 -Node: bot.shit10150 -Node: Using the Bot11402 -Node: Starting the Bot11734 -Node: Concepts13240 -Node: User Levels13527 -Node: Protection14906 -Node: Automatic Op15623 -Node: Shit Levels16035 -Node: Built-In Commands16759 -Node: Scripting23734 -Node: Adding New Commands24783 -Node: Hooks26094 -Node: Creating a Hook26932 -Node: Hook Types28138 -Node: Received Message Hooks28702 -Node: Sent Message Hooks33929 -Node: DCC CHAT Hooks35813 -Node: Miscellaneous Hooks36853 -Node: Sending Messages37302 -Node: High Level Message Functions37834 -Node: Low Level Message Functions38898 -Node: Misc Scripting Stuff39951 -Node: Concept Index46776 -Node: Function Index46995 -Node: Variable Index58649 +Node: Introduction2176 +Node: Configuration2488 +Node: Configuration File Placement2932 +Node: Configuration Files3433 +Node: bot.conf3669 +Node: server syntax5855 +Node: channel syntax6653 +Node: bot.users7697 +Node: bot.init9158 +Node: bot.autoexec9817 +Node: bot.shit10318 +Node: Using the Bot11570 +Node: Starting the Bot11902 +Node: Concepts13408 +Node: User Levels13695 +Node: Protection15074 +Node: Automatic Op15791 +Node: Shit Levels16203 +Node: Built-In Commands16927 +Node: Message Commands17461 +Node: User List Commands18065 +Node: Scripting24368 +Node: Adding New Commands25457 +Node: Hooks26768 +Node: Creating a Hook27606 +Node: Hook Types28812 +Node: Received Message Hooks29376 +Node: Sent Message Hooks34603 +Node: DCC CHAT Hooks36487 +Node: Miscellaneous Hooks37527 +Node: Sending Messages37976 +Node: High Level Message Functions38508 +Node: Low Level Message Functions39572 +Node: Misc Scripting Stuff40625 +Node: Scheme Commands41123 +Node: Query Functions45779 +Node: Concept Index48005 +Node: Function Index48224 +Node: Variable Index56476  End Tag Table diff --git a/bobot++.texinfo b/bobot++.texinfo index db92ba5..8297c63 100644 --- a/bobot++.texinfo +++ b/bobot++.texinfo @@ -97,12 +97,19 @@ Concepts * Automatic Op:: * Shit Levels:: +Built-In Commands + +* Message Commands:: +* User List Commands:: + Scripting * Adding New Commands:: * Hooks:: * Sending Messages:: * Misc Scripting Stuff:: +* Scheme Commands:: +* Query Functions:: Hooks @@ -121,6 +128,11 @@ Sending Messages * High Level Message Functions:: * Low Level Message Functions:: +Misc. Scripting Stuff + +* Scheme Commands:: +* Query Functions:: + @end detailmenu @end menu @@ -529,13 +541,39 @@ to use whatever you defined the command char to be in specify the channel as the first argument to the command when private messaging the bot a command. +@menu +* Message Commands:: +* User List Commands:: +@end menu + +@node Message Commands, User List Commands, Built-In Commands, Built-In Commands +@subsection Message Commands + @multitable @columnfractions 0.20 0.15 0.15 0.50 -@item @sc{command} @tab @sc{Needs Channel} @tab @sc{Min Level to Use} @tab @sc{Description} +@item @sc{command} @tab @sc{Needs Channel} @tab @sc{Min Level to Use} +@tab @sc{Description} @item @command{action} @option{do} @tab Yes @tab @var{USER} @tab Causes the bot to perform the action @option{do} in the current channel. +@item @command{do} @tab @tab @tab + +@item @command{msg} @tab @tab @tab + +@item @command{say} @tab Yes @tab @tab Makes the bot say @var{message} +on @var{channel}. + +@end multitable + + +@node User List Commands, , Message Commands, Built-In Commands +@subsection User List Commands + +@multitable @columnfractions 0.20 0.15 0.15 0.50 +@item @sc{command} @tab @sc{Needs Channel} @tab @sc{Min Level to Use} @tab @sc{Description} + + @item @command{adduser} @tab @tab @tab @item @command{addserver} @tab @tab @tab Adds the server specified by @@ -580,7 +618,7 @@ on @var{channel}. @item @command{die} @tab @tab @tab Makes the bot stop immediately. -@item @command{do} @tab @tab @tab + @item @command{execute} @tab @tab @tab @strong{Only available if scripting support is enabled} @@ -616,7 +654,7 @@ scripting support is enabled} @item @command{mode} @tab Yes @tab @tab Sends @var{mode string} as mode for @var{channel}. -@item @command{msg} @tab @tab @tab + @item @command{names} @tab Yes @tab @tab Shows the nicknames and status of users on @var{channel}. @@ -645,8 +683,7 @@ list. @item @command{save} @tab @tab @tab Saves the userlist. -@item @command{say} @tab Yes @tab @tab Makes the bot say @var{message} -on @var{channel}. + @item @command{server} @tab @tab @tab Select the server to connect to. @var{server number} is the number of the server in the serverlist. @@ -714,6 +751,8 @@ are strings unless otherwise specified. * Hooks:: * Sending Messages:: * Misc Scripting Stuff:: +* Scheme Commands:: +* Query Functions:: @end menu @node Adding New Commands, Hooks, Scripting, Scripting @@ -1174,7 +1213,7 @@ command. Make sure to @code{bot:ctcp-quote} the message! This is used to reply to a ctcp that the bot has received. @end defun -@node Misc Scripting Stuff, , Sending Messages, Scripting +@node Misc Scripting Stuff, Scheme Commands, Sending Messages, Scripting @section Misc. Scripting Stuff These are a few useful things that I thought people writing scripts @@ -1186,16 +1225,17 @@ If you want to execute code when the bot exits, just do argumentless procedure (a thunk). When the bot exits your thunk will be called. -@quotation -[ I didn't know where to put any of these, so I just stuck them in -here. -There probably needs to be several sections added, like dealing with -users (kicking, added, etc), dealing with the bot (channels, nickname -of the bot, etc), server issues (serverlist), useful tools (nslookup, -whois), and do on. ] -@end quotation +@menu +* Scheme Commands:: +* Query Functions:: +@end menu + +@node Scheme Commands, Query Functions, Misc Scripting Stuff, Scripting +@section Scheme Commands +These scheme functions are the same as the commands. +They allow you to execute bot commands from scheme scripts. @defun bot:adduser nick-or-mask cbannel-mask level prot auto-op Adds an user to the userlist, for a @code{nick!user@@host} matching the @@ -1322,11 +1362,6 @@ You need to be a trusted user to use a @var{mask}. Locks topic on @var{channel}. @end defun -@c (0, 0, 0) -@defun bot:logport -[ Probably returns the log port? ] -@end defun - @c (2, 0, 0) @defun bot:mode channel mode-string Sends @var{mode-string} as mode for @var{channel}. @@ -1402,6 +1437,35 @@ Sends a WHOIS command to @var{nick}. @var{nick} @strong{must} be a nickname, you cannot send a WHOIS to a channel. @end defun + + +@c (1, 0, 0) +@defun bot:delcommand +[ Probably deletes a command added with @code{bot:addcommand} ? ] +@end defun + + + +@node Query Functions, , Scheme Commands, Scripting +@section Query Functions + +@quotation +[ I didn't know where to put any of these, so I just stuck them in +here. + +There probably needs to be several sections added, like dealing with +users (kicking, added, etc), dealing with the bot (channels, nickname +of the bot, etc), server issues (serverlist), useful tools (nslookup, +whois), and do on. ] +@end quotation + +These functions allow scripts to get various bits of information. + +@c (0, 0, 0) +@defun bot:logport +[ Probably returns the log port? ] +@end defun + @c (0, 0, 0) @defun bot:getnickname [ Gets the bot's nickname? ] @@ -1430,11 +1494,6 @@ nickname, you cannot send a WHOIS to a channel. [ Returns a random number? What range? Why? ] @end defun -@c (1, 0, 0) -@defun bot:delcommand -[ Probably deletes a command added with @code{bot:addcommand} ? ] -@end defun - @c (2, 0, 0) @defun bot:addtimer ? ? @end defun @@ -1469,12 +1528,12 @@ thunk it will be executed and it's output will be written to the log. @end defun @defun bot:match-not-channel regex -match-not-channel adds a prefix regex to your @var{regex} so it +@code{bot:match-not-channel} adds a prefix regex to your @var{regex} so it doesn't match the sender or channel in a PUBLIC message @end defun @defun bot:match-to-me regex -match-to-me matches text that was addressed to the bot with a +@code{bot:match-to-me} matches text that was addressed to the bot with a ':', ',', or nothing after the bot name. @end defun -- 2.20.1