Multichat Help script
 

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

Multichat Help script

Started by ?nake, 28 October, 2003, 04:00:32

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

?nake

hi folks can some one convert this script to lua so i can usse the MHC Bot to have a multichat server with Ptoakx.


here it goes



Dim sBotName, sOPChatName, oNoMHC, oMHCBots, sTheText, OPMsg, HubBytes, UserCount

Sub Main()
  sBotName = "MHC"             '***USE SAME NAME AS FIRST BOTNAME IN BOT
  sOPChatName = "MHOPChat"       '***ENTER NAME OF OP CHAT SCRIPT IN THIS HUB          
  Set oNoMHC = CreateObject("Scripting.Dictionary")
  Set oMHCBots = CreateObject("Scripting.Dictionary")
End Sub

Sub NewUserConnected(curUser)
curUser.SendChatMessage cstr(sBotName), "For those users not wishing to view MultiHubChat, these triggers are available:"+vbCrLf+"                                             ?   mhchide   ?   mhcshow   ?"
End Sub

Sub DataArival(curUser, sCurData)

If Left(sCurData, 12) = "$GetNickList" and curUser.bOperator Then        '***MAKES OPCHAT BOT INVISIBLE TO NON-OPS
  curUser.SendData "$Hello "+CStr(sOPChatName)+"|$MyINFO $ALL "+Cstr(sOPChatName)+" OP Chat Room$ $Chat"+chr(8)+"$"+frmHub.txtIP+"$"+"0"+"$|"
End If
If (Left(sCurData, 5 + Len(sOPChatName)) = "$To: "+sOPChatName) Then     '***DEALS WITH OP CHAT
    OPMsg = AfterFirst(sCurData, "> ")
     For Each usrOP In colUsers
      If usrOP.bOperator Then
       If usrOP.sName = curUser.sName or usrOP.sName = sBotName Then
       Else 
         usrOP.SendData "$To: "+usrOP.sName+" From: "+Cstr(sOPChatName)+" $<"+curUser.sName+"> "+cstr(OPMsg)+"|"         '***LOCAL OPCHAT
       End If
      End If
     Next  
    colUsers.ItemByName(cstr(sBotName)).SendChatMessage "???","?"+CurUser.sName+"?"+cstr(OPMsg)   '***REMOTE OPCHAT
End If 

If Left(sCurdata, 1) = "<" Then                                          '***ALLOWS USER TO VIEW OR HIDE MHC
  sTheText = AfterFirst(sCurData, "> ")
   If LCase(sTheText) = "mhchide" Then
     If Not oNoMHC.Exists(LCase(curUser.sname)) Then oNoMHC(LCase(curUser.sname))= "blocked": curUser.SendChatMessage cstr(sBotName), "You have chosen not to view MultiHub Chat."
   ElseIf LCase(sTheText) = "mhcshow" then
     If oNoMHC.Exists(LCase(curUser.sname)) Then oNoMHC.Remove(LCase(curUser.sname)): curUser.SendChatMessage cstr(sBotName), "You have chosen to view MultiHub Chat."
   End If
   
ElseIf Left(sCurdata, 4) = "$FW " Or Left(sCurdata, 6) = "$FWOC " Then   '***PROCESSES DATA FROM REMOTE HUBS
    sRemUser = BeforeFirst(AfterFirst(sCurData, " "), " ")
    sRemMsg = AfterFirst(AfterFirst(sCurData, " "), " ")
      If Left(sCurdata, 6) = "$FWOC " Then 
          For Each usrOP In colUsers
            If usrOP.bOperator Then usrOP.SendData CStr("$To: "+usrOP.sName+" From: "+sOPChatName+" $<"+CStr(sRemUser)+"> "+CStr(sRemMsg))
          Next    
      ElseIf Left(sCurdata, 4) = "$FW " Then
         For Each usr In ColUsers
          If Not oNoMHC.Exists(LCase(cstr(usr.sname))) Then usr.SendChatMessage CStr(sRemUser), CStr(sRemMsg)
         Next  
      End If

ElseIf Left(sCurData, 13) = "$MyINFO $ALL " Then                           '***STOPS MHC BOTS FROM BEING COUNTED IN HUB BYTES
  If Right(BeforeFirst(AfterFirst(sCurData, "$ $"), "$"),1)=chr(108) Then
    If Not oMHCBots.exists(LCase(curUser.sName)) Then oMHCBots(LCase(curUser.sName)) = " "
  End If  

ElseIf Left(sCurData, 11) = "$GetHubInfo" Then                             '***GATHERS HUB USERCOUNT & SHARE
    HubBytes = 0   
    For each User in colUsers
      If Not oMHCBots.exists(LCase(cstr(User.sName))) Then HubBytes = HubBytes+User.ibytesshared
    Next
    Usercount = cstr(colusers.Count)
    colUsers.ItemByName(cstr(sBotName)).SendChatMessage "???", "?"+Cstr(UserCount)+"?"+cstr(HubBytes)
End If

End Sub

Function BeforeFirst(sIn, sFirst)               
    BeforeFirst = Left(sIn, InStr(1, sIn, sFirst) - 1)
End Function
Function AfterFirst(sIn, sFirst)  
    AfterFirst = Right(sIn, Len(sIn) - InStr(1, sIn, sFirst) - (Len(sFirst) - 1))
End Function




if you do i will be thank full and you will be te king of
lua :-P peace m8s :)

btw if i remmber correctlly some on alredy made it on the old forume does some one has it ?
==>  :D ohhhhhh! ahhhhh! EHHHH !?   :D <==

lazyj189

I dont think you need that script.  There is a multihub server program that does work to make the mainchat do multihub.  Still doesnt work on multihubbing the opchaat or anything else.
DivX Dominion Hub Owner
3 years running
DivX Dominion Hub

?nake

? sorry but what do you mean?
the inbilt multi hub chat?
well it still dosent work on Ptoakx. but i know if i can get this script in lua it will work 8o
==>  :D ohhhhhh! ahhhhh! EHHHH !?   :D <==

lazyj189

Yes, the built in multihub will work as long as you have the multihub server program which is external from the ptokax hub.  There's a link around here somewhere as to where you can download it.  Gotta leave for work righ tnow, so I'll look for it later tonight my time for ya.
DivX Dominion Hub Owner
3 years running
DivX Dominion Hub

[T-G-T]M@sto

QuoteOriginally posted by lazyj189
Yes, the built in multihub will work as long as you have the multihub server program which is external from the ptokax hub.  There's a link around here somewhere as to where you can download it.  Gotta leave for work righ tnow, so I'll look for it later tonight my time for ya.
Timis Up  :D
The Ghost Riders - tgr.dyndns.org - The Best Danish Hub

SMF spam blocked by CleanTalk