I'm trying to make a script that links mainchats together, kinda like hublink but without all the other stuff, but I'm stuck on the part where the script shuld send the massages to the hubs but the hub it was written in, this is what I got so far
dcpp:setListener( "chat", "chatlink",
function( hub, user, text )
local h = hub:getHubName()
if string.find( h, "hub1" ) or string.find( h, "hub2" ) then
if string.find( h, "hub1" ) then
huben = "(hub1)>???<"
end
if string.find( h, "hub2" ) then
huben = "(hub2)>???<"
end
if not h then
--to hub1--( "!say "..huben..user:getNick().." "..text )
end
if not h then
--to hub2--( "!say "..huben..user:getNick().." "..text )
end
end
end
)
store the hubname.
loop thru all the hub's the client is in, this is a table bcdc has.
now compair the hubname with every current hub being procesed.
if they match you don't send a hub msg, else you do.
for more hints, i allready posted a script like this a while back.
plop
I'm a n00b to LUA, so what your'e saying doesn't make much sense to me :rolleyes:
and I don't really know what to look for to find your script, so a direct link would be nice and maybe I can figure something out from that.
After some more searching I found the script you were talking about, hard to find my way around forums I haven't been to before ;) and that resulted in this script, manly to be used to link YnHub mainchats together. (thanks for the help Plop)
--// vim:ts=4:sw=4:noet
--// chatlink.lua -- link mainchats togheter
BOTS = { ["-Herr?K.?Hedvall-(Lidk?ping)"]=1, ["[BOT]RoBOT"]=2, ["-SWEnet?-"]=3, ["-Master-"]=4, ["MOTD"]=5, ["-Akademikern-"]=6, ["-Current UserCount-"]=7, ["-Current shareSize-"]=8, ["-Current UpTime-"]=9, ["-MOTD-"]=10, ["-CORE-"]=11 }
dcpp:setListener( "chat", "chatlink",
function( hub, user, text )
local s = string.lower( text )
if not string.find( s, "^\+" ) and not string.find( s, "redirected" ) and not string.find( s, "disconnected" ) and not string.find( s, "banned" ) and not string.find( s, "incorrect" ) and not
string.find( s, "is kicking" ) and not string.find( s, "^!" ) and not string.find( s, "^ !" ) and not string.find( s, "date:" ) then
local othernick = user:getNick()
local fromhub = hub:getHubName()
if BOTS[othernick] == nil then
if string.find( fromhub, "Lidk" ) then
huben = "(Lidk?ping)>???<"
end
if string.find( fromhub, "Norrk" ) then
huben = "(Norrk?ping)>???<"
end
if string.find( fromhub, "Bor?s" ) then
huben = "(Bor?s)>???<"
end
if string.find( fromhub, "Kungs" ) then
huben = "(Kungsbacka)>???<"
end
if string.find( fromhub, "?rebro" ) then
huben = "(?rebro)>???<"
end
if string.find( fromhub, "Mj?lby" ) then
huben = "(Mj?lby)>???<"
end
if string.find( fromhub, "Uppsala" ) then
huben = "(Uppsala)>???<"
end
for k,v in dcpp._hubs do
if v:getId() ~= hub:getId() then
v:sendChat( "!say "..huben..othernick.." "..text )
end
end
end
end
end
)