Re: Commands for SerieBot
Posted: 20 Jun 2010, 15:14
Hi
i get still get same problems
nothing happen on rc and in main
pm works fine
/Spader
i get still get same problems
nothing happen on rc and in main
pm works fine
/Spader
Empowering and innovating features for the peer to peer masses
https://forum.dcbase.org/
Code: Select all
--[[
Name: Seriebot Commands
Author: Poy
Version: 0.4
Hubsoft: ADCH++
Commments: Exposes commands for SerieBot <http://code.google.com/p/seriebot/>.
]]
local seriebot_nick = 'Serie'
local user_command_menu = 'SerieBot'
local base = _G
module('seriebot')
base.require('luadchpp')
local adchpp = base.luadchpp
local autil = base.require('autil')
local string = base.require('string')
base.assert(base['access'], 'access.lua must be loaded and running before seriebot.lua')
local access = base.access
local cm = adchpp.getCM()
-- Forward commands to the bot.
local function command(name)
return function(c, parameters)
local bot = cm:findByNick(seriebot_nick)
if bot then
local msg = '+' .. name
if #parameters > 0 then
msg = msg .. ' ' .. parameters
end
bot:send(adchpp.AdcCommand(adchpp.AdcCommand_CMD_MSG, adchpp.AdcCommand_TYPE_BROADCAST, c:getSID())
:addParam(msg))
end
end
end
access.commands.next = {
command = command('next'),
help = 'name',
user_command = {
name = user_command_menu .. autil.ucmd_sep .. 'Next',
params = { autil.ucmd_line('Serie name') }
}
}
access.commands.last = {
command = command('last'),
help = 'name',
user_command = {
name = user_command_menu .. autil.ucmd_sep .. 'Last',
params = { autil.ucmd_line('Serie name') }
}
}
access.commands.new = {
command = command('new'),
help = '- gives information on new episodes for series you are sharing',
user_command = { name = user_command_menu .. autil.ucmd_sep .. 'New' }
}
access.commands.countdown = {
command = command('countdown'),
help = 'name',
user_command = {
name = user_command_menu .. autil.ucmd_sep .. 'Countdown',
params = { autil.ucmd_line('Serie name') }
}
}
access.commands.ignore = {
command = command('ignore'),
help = 'name - ignore series in the +serie_new command',
user_command = {
name = user_command_menu .. autil.ucmd_sep .. 'Ignore',
params = { autil.ucmd_line('Serie name') }
}
}