ViP Chat Room

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

Paul_Don
Posts: 146
Joined: 2003-01-29 11:41
Location: uk

ViP Chat Room

Post by Paul_Don » 2003-04-13 14:26

Ok i got a problem with vip chat room this script modded by moi and ade
seems to be fooked,
peopel that are specified can chat into it and see eachothers pm's
the problem is that [uF] chat seems to send to every registered user in the hub which isnt alot of help if we want to do that we speak in main chat :P
can soemone point out the problem for me please ...
heres the code ..........

Code: Select all

Dim sOpChatName, strTrig


Sub Main ()

   sOpChatName = "[uF]Chat"
   strTrig = lcase("$Jadey$d f x$kense$ViCIOUS$[-ViN-]$eMk_$Sean--$roller$pkrev$Dj Skillz$EsQuire$Perry$izzy$Luzzi$4xsampaul$P a u l$")
   frmHub.RegisterBotName(CStr(sOpChatName)) 
End Sub


Sub DataArival (curUser, sCurData)

   If len(sCurData) > 0 Then
     
      'on error resume next
     
      If Left(sCurData, 12) = "$GetNickList" Then
         If curUser.bOperator Then
            curUser.SendData cstr("$Hello "& sOpChatName &"|")
         End If

         Exit Sub
      End If
     
      If Left(sCurData, 8) = "$GetINFO" Then
         Dim sReqdUsername
         sReqdUsername = Split(sCurData, " ", 3)(1)
         If instr(1, strtrig, "$" & lcase(curUser.sName) & "$") Then
            If sReqdUsername = sOpChatName Then _
               curUser.SendData cstr("$MyINFO $ALL "& sReqdUsername &" [uF] ViP's only$ $Chat Room"& chr(8) &"$$0$|")
         End If
         
         Exit Sub
      End If
     
      If Left(sCurData, 4) = "$To:" Then
         
         If LCase(Split(sCurData, " ", 3)(1)) = LCase(sOpChatName) Then
            sCmd = AfterFirst(sCurData, " $")
           
            For Each user In colUsers
               If instr(1, strtrig, "$" & lcase(curUser.sName) & "$") Then
                  If Not user Is curUser Then _
                     user.SendData cstr("$To: "& user.sName &" From: "& sOpChatName &" $"& sCmd)
               End If
            Next
           
         End If
      End If
     
   End If

End Sub


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






BuBbE
Posts: 2
Joined: 2003-04-02 15:02
Location: Sweden

Post by BuBbE » 2003-04-13 15:19

heres the right vipchat!!

[/b]Dim sVipchatname,sVipuser

Sub Main()
'Set these basic parameters
sVipChatName = "(<-XXXXX->)"
if svipchaton="" then svipchaton="True"
iMaxUsers = frmHub.sldrMaxUsers-30
Set sVipUser = CreateObject("Scripting.Dictionary")

End Sub

Sub OpConnected(curUser)
svipuser(lcase(curuser.sname))="VIP"

if curUser.bOperator=False then
colUsers.SendChatToAll cstr("-VISHNU-"), "The Vip>>>> "+curUser.sName+" Has Join Us."
end if

End sub


Sub DataArival(curUser, sCurData)

Dim scommand
If (left(sCurdata,1) ="$") then ' If Command
if Instr(1,sCurData," ") > 0 then
scommand=Left(sCurData, InStr(1, sCurData, " ") - 1)
else
sCommand=sCurData
end if
Dim x
Select case lcase(sCommand)

Case "$to:"
Dim icount,icounter

If (svipuser(lcase(curuser.sname))="VIP" and left(sCurData, 5 + Len(sVipChatName)) = "$To: " & sVipChatName) then
icount = frmhub.lstOps.ListItems.Count
frmhub.doeventsforme
For iCounter= 1 To iCount

if not lcase(frmhub.lstOps.ListItems(icounter))=lcase(Curuser.sname) then
if colUsers.online(frmhub.lstOps.ListItems(icounter)) then
colUsers.ItemByName(cstr(frmhub.lstOps.ListItems(icounter))).SendData _
cstr("$To: "& colUsers.ItemByName(cstr(frmhub.lstOps.ListItems(icounter))).sName _
&" From: "& sVipChatName &" $" & Mid(Scurdata,instr(5,sCurData,"$")+1))
end if
end if
Next
end if

Case "$getinfo"

if svipuser(lcase(curuser.sname))="VIP" then
if (lcase(left(sCurData, 9 + Len(sVipChatName))) = Lcase("$getinfo " & sVipChatName)) then _
curUser.SendData cstr("$MyINFO $ALL "& cstr(svipChatName) &" A Place Where Operators Can Talk Privat$ $Chat Room"& chr(8) &"$$0$|")
end if
Case "$getnicklist"
if svipuser(lcase(curuser.sname))="VIP" then
curUser.SendData cstr("$Hello "& Cstr(sVipChatName) &"|")
end if
end select
End If

End Sub
Im the law, fuck the rest!

Paul_Don
Posts: 146
Joined: 2003-01-29 11:41
Location: uk

Post by Paul_Don » 2003-04-13 15:48

well no thats defeating the object that would then make all registered users vips i want to define them in a string like $name$name$
on who can actually chat init

Marvin
Posts: 147
Joined: 2003-03-06 11:56
Location: France

Post by Marvin » 2003-04-13 16:53

Try to replace

Code: Select all

              If instr(1, strtrig, "$" & lcase(curUser.sName) & "$") Then
by

Code: Select all

              If instr(1, strtrig, "$" & lcase(user.sName) & "$") Then


As far as I understood the scipt, your line is testing if the speaker is VIP, wich is nonsense (probably a typo). Mine will test each user to check if he is VIP (as the next line in your code will send those users the VIP chat message).

Paul_Don
Posts: 146
Joined: 2003-01-29 11:41
Location: uk

Post by Paul_Don » 2003-04-13 17:02

ok got the pm EVERYOne bit sorted but now theres a problem with normal users pmin the chat room there pms go through and ops can see there message in the vip chat room which will get very confusing if some random person start pmin message into the chat room heres the code please help :) i need a mod that cancels the pm from goin through if not a specified users and perhaps reply with "vip and op chat only"

heres hte code

Code: Select all

Dim sOpChatName, strTrig


Sub Main ()

   sOpChatName = "[uF]Chat"
   strTrig = lcase("$[uF]Greg$Richie@Milky$Jadey$d f x$kense$ViCIOUS$[-ViN-]$eMk_$Sean--$roller$pkrev$Dj Skillz$EsQuire$Perry$izzy$Luzzi$4xsampaul$P a u l$")
   frmHub.RegisterBotName(CStr(sOpChatName)) 
End Sub


Sub DataArival (curUser, sCurData)

   If len(sCurData) > 0 Then
     
      'on error resume next
     
      If Left(sCurData, 12) = "$GetNickList" Then
         If curUser.bOperator Then
            curUser.SendData cstr("$Hello "& sOpChatName &"|")
         End If

         Exit Sub
      End If
     
      If Left(sCurData, 8) = "$GetINFO" Then
         Dim sReqdUsername
         sReqdUsername = Split(sCurData, " ", 3)(1)
         If instr(1, strtrig, "$" & lcase(User.sName) & "$") Then
            If sReqdUsername = sOpChatName Then _
               curUser.SendData cstr("$MyINFO $ALL "& sReqdUsername &"  "& chr(8) &"$$0$|")
         End If
         
         Exit Sub
      End If
     
   
      If Left(sCurData, 4) = "$To:" Then
       
         If LCase(Split(sCurData, " ", 3)(1)) = LCase(sOpChatName) Then
            sCmd = AfterFirst(sCurData, " $")
           
            For Each user In colUsers
               If instr(1, strtrig, "$" & lcase(User.sName) & "$") Then
                  If Not user Is curUser Then _
                     user.SendData cstr("$To: "& user.sName &" From: "& sOpChatName &" $" & sCmd)
               End If
            Next
           
         End If
      End If
     
   End If

End Sub


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








Marvin
Posts: 147
Joined: 2003-03-06 11:56
Location: France

Post by Marvin » 2003-04-13 17:25

Sorry, I thought that only vips could see the vip chat, so here we go

Code: Select all

            sCmd = AfterFirst(sCurData, " $") ' *** your code

' ******** Add this
            if not instr(1, strtrig, "$" & lcase(CurUser.sName) & "$") Then
                Curuser.SendData cstr("$To: "& user.sName &" From: "& sOpChatName &" $" & "Sorry, VIP chat only") ' feel free to change that message ;)
            else
'*****************
               For Each user In colUsers  ' ****** your code
                  If instr(1, strtrig, "$" & lcase(User.sName) & "$") Then
                     If Not user Is curUser Then _
                        user.SendData cstr("$To: "& user.sName &" From: "& sOpChatName &" $" & sCmd)
                  End If

               Next
            end if       ' ****** Add this line

Paul_Don
Posts: 146
Joined: 2003-01-29 11:41
Location: uk

Post by Paul_Don » 2003-04-13 22:12

i replaced and added those lines, and they knocked the whole script out
so with those mods it dont work nomore :(

Marvin
Posts: 147
Joined: 2003-03-06 11:56
Location: France

Post by Marvin » 2003-04-14 10:37

Code: Select all

            sCmd = AfterFirst(sCurData, " $") ' *** your code

' ******** Add this
            if not instr(1, strtrig, "$" & lcase(CurUser.sName) & "$") Then
                Curuser.PrivateMassage cstr(sOpChatName),"Sorry, VIP chat only"         ' feel free to change that message ;)
            else
'*****************
               For Each user In colUsers  ' ****** your code
                  If instr(1, strtrig, "$" & lcase(User.sName) & "$") Then
                     If Not user Is curUser Then _
                        user.SendData cstr("$To: "& user.sName &" From: "& sOpChatName &" $" & sCmd)
                  End If

               Next
            end if       ' ****** Add this line
:oops:

Paul_Don
Posts: 146
Joined: 2003-01-29 11:41
Location: uk

Post by Paul_Don » 2003-04-14 12:57

nah mate i dunno whats goin on the thing jsut wont bloody work when i add those lines :(

Marvin
Posts: 147
Joined: 2003-03-06 11:56
Location: France

Post by Marvin » 2003-04-14 21:10

Well, at least I took time to run it, so I found the two bugs. Here is the working release :wink:

Code: Select all

Dim sOpChatName, strTrig

Sub Main ()
   sOpChatName = "[uF]Chat"
   strTrig = lcase("$[uF]Greg$Richie@Milky$Jadey$d f x$kense$ViCIOUS$[-ViN-]$eMk_$Sean--$roller$pkrev$Dj Skillz$EsQuire$Perry$izzy$Luzzi$4xsampaul$P a u l$")
   frmHub.RegisterBotName(CStr(sOpChatName)) 
End Sub


Sub DataArival (curUser, sCurData)
   If len(sCurData) > 0 Then
     
      'on error resume next
     
      If Left(sCurData, 12) = "$GetNickList" Then
         If curUser.bOperator Then
            curUser.SendData cstr("$Hello "& sOpChatName &"|")
         End If
         Exit Sub
      End If
     
      If Left(sCurData, 8) = "$GetINFO" Then
         Dim sReqdUsername
         sReqdUsername = Split(sCurData, " ", 3)(1)
         If instr(1, strtrig, "$" & lcase(User.sName) & "$") Then
            If sReqdUsername = sOpChatName Then _
               curUser.SendData cstr("$MyINFO $ALL "& sReqdUsername &"  "& chr(8) &"$$0$|")
         End If
         Exit Sub
      End If
     
   
      If Left(sCurData, 4) = "$To:" Then
         If LCase(Split(sCurData, " ", 3)(1)) = LCase(sOpChatName) Then
            sCmd = AfterFirst(sCurData, " $")
            if instr(1, strtrig, "$" & lcase(CurUser.sName) & "$") =0 Then
               Curuser.SendData cstr("$To: "& curuser.sName &" From: "& sOpChatName &" $" & "Sorry, VIP chat only") ' feel free to change that message ;)
            else
               For Each user In colUsers
                  If instr(1, strtrig, "$" & lcase(User.sName) & "$") Then
                     If Not user Is curUser Then _
                        user.SendData cstr("$To: "& user.sName &" From: "& sOpChatName &" $" & sCmd)
                  End If
               Next
            End if
         End If
      End If
     
   End If

End Sub


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


Nb : this is a modified version of your script, vip chat can be handled differently.

Paul_Don
Posts: 146
Joined: 2003-01-29 11:41
Location: uk

Post by Paul_Don » 2003-04-14 22:10

thanx very much marvin youve been a diamond mate

Who is online

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