can some one tell me if this is ptocaX script of DC++ users?

Which hub software is the best? Where can I find script XXX? Discuss it here...(no, this is not for advertising your hub...)

Moderator: Moderators

jasonrhl
Posts: 5
Joined: 2004-04-12 23:23

can some one tell me if this is ptocaX script of DC++ users?

Post by jasonrhl » 2004-04-12 23:40

I dont understand this stuff but am trying to.

I want this to work on ptokaX hub with DC++ users.

-- TriggerBoy.lua, based on TrickerBot.lua, based on Ptokax's TriggerBot, but for native DCH++ lua scripting
-- Original written by ptaczek, modified by arnetheduck, modified by Sedulus (2003)
-- vim:ts=4:sw=4:noet
--
-- added:
-- * multiple triggers with same responses
-- * multiple random responses
-- * names in normal format (no prefix and funky chars)
-- * delayed response (just before next message, if max_delay seconds haven't passed)

dchpp.loadLib( "math" )
dchpp.loadLib( "io" ) -- for os.date()
local botname = "-DJ Senwa $$ [00]"
local delayed_response = 1 -- 1 or nil, if you want the msg immediately
local max_delay = 60 -- seconds within which the response is still valid

local trigs = {
{
{ "lol", "lmao", "roflmao", "ha[ha]+" },
{ "yeah [usr], that was some funny sh*t :)", "hahahaha!", ":D" },
},
{
{ "lo[o]+l" },
{ "you drunk [usr]? it wasn't _that_ funny..." },
},
{
{ "bye", "cya", "later!", "goodbye" },
{ "cya [usr]!", "later!", "I'ma expect you back soon [usr]", "ciao [usr], don't be a stranger now ;)" },
},
{
{ "radio" },
{ "Tune into (address) to hear me play some funky beats" },
},

{
{ "playing" },
{ "Ask Senny, im not sure what he gave me" },
},
}

local last = {
response = nil,
time = nil
}

function dchpp.clientMessage( client, msg )
-- do we need to write some old response?
if delayed_response and last.response then
if os.difftime( os.time(), last.time ) <= max_delay then
dchpp.hubMessage( last.response, botname )
last.response = nil
end
end
-- store new response
chkmsg = " "..string.lower( msg ).." "
for _a, trigarr in trigs do
for _b, trig in trigarr[1] do
local ret,c,match = string.find( chkmsg, "[^a-z]("..trig..")[^a-z]" )
if ret then
local nick = client:getNick()
local moddednick = string.lower( nick )
moddednick = string.gsub( moddednick, "%b[]", "" )
moddednick = string.gsub( moddednick, "%b()", "" )
moddednick = string.gsub( moddednick, "%b{}", "" )
moddednick = string.gsub( moddednick, "[^a-z]*", "" )
if string.len( moddednick ) < 2 then moddednick = nick end
local answer = trigarr[2][math.random( table.getn( trigarr[2] ) )]
answer = string.gsub( answer, "%[wrd%]", match, 1 )
answer = string.gsub( answer, "%[usr%]", moddednick, 1 )
if delayed_response then
last.response = answer
last.time = os.time()
else
dchpp.hubMessage( msg, nick)
dchpp.hubMessage( answer, botname )
return dchpp.ACTION_STOP
end
end
end
end
end
thanks for every who has ever helped

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 14:32

Post by Sedulus » 2004-04-13 00:31

hm.. couldn't you use the original bot made for ptokax instead?
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

jasonrhl
Posts: 5
Joined: 2004-04-12 23:23

Thankyou.

Post by jasonrhl » 2004-04-16 04:02

I found the origional.

thanks for your reply
thanks for every who has ever helped

Who is online

Users browsing this forum: Google [Bot] and 0 guests