MultiHub Chat Script Problems...
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

MultiHub Chat Script Problems...

Started by Metaphase, 27 September, 2004, 00:36:52

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Metaphase

Hi all.

The Hub network for which I am a hub owner in have decided to implement a multihub chat script. We have decided to go with a BCDC script in order to join all of our main chats. The problem we are having is as follows...

The script acts as a relay sending the chat to the other hubs. If somebody in Hub1 types a message, the text in Hub2 is preceeded by the Bots nick. The nick seems to be the same in all hubs even if we change it in each hub. We wish to have different nicks for the client in each hub so that we are able to assertain where the user is talking from. In Hub2 it would come up as User message. Now if a user in Hub2 was to type a message it would also come up as User message   and not   User message.

I hope I am making sense. Here is a copy of the script we are using...

Quote--// vim:ts=4:sw=4:noet
--//
--// the second argument decides in which order the scripts are run
--// use numbers when you need order, else you can just use a _unique_ identifier

CHATS = { ["-=UCDC-OC=-"]=1 }
BOTS = { ["-=UCDC-Sec=-"]=1 }
CHANGE= { ["-=UCDC-OC=-"] = "-=UCDC-OC=-", ["-=UCDC-OC=-"]="-=UCDC-OC=-" }

dcpp:setListener( "chat", "mchat",
   function( hub, user, text )
      local othernick = user:getNick()
      if BOTS[othernick] == nil then
         local s,e,fromhub = string.find(hub:getHubName(), "(%()%d")
         fromhub=string.sub(hub:getHubName(),1,s-2)
         fromhub = string.gsub(fromhub, "Hub1", "TGA")
         for k,v in dcpp._hubs do
            if v:getId() ~= hub:getId() then
               v:sendChat("<"..othernick.."> "..text)
            end
         end
      end
   end
)

dcpp:setListener( "pm", "mchat",
   function( hub, user, text )
      local othernick = user:getNick()
      local s,e,fromhub = string.find(hub:getHubName(), "(%()%d")
      fromhub=string.sub(hub:getHubName(),1,s-2)
      DC():PrintDebug(text)--.."         "..msg)
      if CHATS[othernick] then
         fromhub = string.gsub(fromhub, "Hub2", "TGA")
         for k,v in dcpp._hubs do
            if v:getId() ~= hub:getId() then
               local to = v:getUser(othernick)
               to:sendPrivMsgFmt("<"..fromhub.."> "..text)
            end
         end
      end
   end                                                         
)

DC():PrintDebug( "  ** Loaded chat.lua **" )

If you can see what the problem is could you please let us know. Also, this is going to have to be run over 5 hubs in total so this script needs some work. If you can recommend a better script that doesn't require the BCDC Client please let me know...

Many thanks.

??????Hawk??????

hi m8.

theres  a few  different chat links  try searching the forum..  

or you could use the link feature in Xsthetic Netserver.

d/l from my sig

HaArD

#2
There are other choices... checking links in signatures is a good idea ???Hawk???

SMF spam blocked by CleanTalk