From b1448813183abc0ed2d87dd5ac531ff2b4693ff8 Mon Sep 17 00:00:00 2001 From: Heikki Hokkanen Date: Sun, 7 Sep 2008 19:36:06 +0300 Subject: [PATCH] Tip from Tobias Rosenqvist: blootbot CMD emulation. --- index.txt | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/index.txt b/index.txt index f060420..187f64a 100644 --- a/index.txt +++ b/index.txt @@ -465,4 +465,49 @@ This is a list of issues I have not yet figured out how to do, or there simply i * Capabilities are not network/channel -specific, but channel-specific. If channel by same name exists in two networks, the users have same capabilities on both * No way to add network-specific hostmasks +== Tips == + +=== How to emulate blootbot CMDs using MoobotFactoids === + +[,yellow]#Thanks to Tobias Rosenqvist for the tip!# + +We try to make a command factoid, like we are used to with blootbot: + +---- + cmdtest is gives $1 "(an apple|a pear)" + Ok. +---- + +Then we test it: + +---- + cmdtest someone +But it doesn't work. +---- + +However, the factoid works: + +---- + cmdtest + * bot gives $1 an apple +---- + +The Moobotfactoids plugin in supybot doesn't handle arguments, (yet) +unfortunately, so you need to do it another way. +Use the Moobotfactoids to do the random part(s): + +---- + fruits is "(an apple|an orange|a banana|a pear)" + Ok. +---- + +Then use an alias to do the command, with arguments (the "action" command +is found in the Reply plugin), here you also see a use of a nested command: + +---- + alias add givefruit action gives [fruits] to $1 + Ok. + givefruit someone + * bot gives a pear to someone +---- -- 2.11.4.GIT