OP Welcome MSG

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

Locked
mrdesai83
Posts: 9
Joined: 2003-01-04 22:57
Contact:

OP Welcome MSG

Post by mrdesai83 » 2003-02-03 14:50

Everyone,

I need a script that will msg an OP when he enters the hub like welcome msg, but only to the OPs not the users.

Can someone pls make this happen?

Thanx in advance!
MrDesai83
[IM] Owner http://www.imhubs.com
[DU] Owner http://www.duportal.com

Snooze
Posts: 119
Joined: 2003-01-26 13:42
Location: Denmark
Contact:

Post by Snooze » 2003-02-03 14:59

This will do that - and alot more ;)

Code: Select all

Dim sBotName   
Dim iOpWelcome
Dim ThisBotsName
Dim iMinSharedBytes

Sub Main()
sBotName = "HuBiT"
ThisBotsName = "HuBiT"
frmHub.RegisterBotName(sBotName)
iMinSharedBytes = 0 * 1024 ^ 2
iOpWelcome = 1
End Sub

Sub DataArival (curUser, sCurData)  'This event is fired when a new user logs in.
   Dim sCommand
   Dim sCurData2
   Dim x
   Dim iTheirSharedBytes
   Dim iIndex
   Dim iTheirConnection
   Dim iTempsCurData
   Dim iTheirFileDescription
   Dim iTheirEmail
   Dim iTheirIP
   Dim iTheirName
   Dim sAction
   Dim sUserBeingKicked
   Dim sKickReason
   Dim sBan
   Dim sUser
   Dim sBanReason
   Dim sIp
   Dim iTheirIndex
 sCurData2 = sCurData
 iTheirIp = curUser.IP()
 iIndex = int(curUser.iWinsockIndex)
 iTheirEmail = AfterFirst(sCurData,"$ALL ")
 iTheirEmail = AfterFirst(iTheirEmail,"$")
 iTheirEmail = AfterFirst(iTheirEmail,"$")
 iTheirEmail = AfterFirst(iTheirEmail,"$")
 iTheirEmail = BeforeFirst(iTheirEmail,"$")
 iTheirConnection = AfterFirst(sCurData,"$ALL ")
 iTheirConnection = AfterFirst(iTheirConnection,"$")
 iTheirConnection = AfterFirst(iTheirConnection,"$")
 iTheirConnection = BeforeFirst(iTheirConnection,"")
 iTheirFileDescription = AfterFirst(sCurData,"$ALL ")
 iTheirFileDescription = AfterFirst(iTheirFileDescription," ")
 iTheirFileDescription = BeforeFirst(iTheirFileDescription,"$")
 iHubMaxUsers = frmHub.sldrMaxUsers.value
 iMinClientVersion = frmHub.txtMinClientVersion
 iHubName = frmHub.txtName
 iHubAddress = frmHub.txtIP
   If isCommand(sCurData) then
      If Instr(1,sCurData," ") > 0 Then
         sCommand = BeforeFirst(sCurData, " ")
      Else
         sCommand = sCurData
      End If
      Select Case sCommand
         Case "$MyINFO"
            For x = 1 to 6
               sCurData = AfterFirst(sCurData,"$")
            Next
            iTheirSharedBytes = cdbl(BeforeFirst(sCurData,"$"))
            If int(iTheirSharedBytes) < iMinSharedBytes and int(iTheirSharedBytes) > 0 Then
   curUser.SendChatMessage cstr(sBotName), "You are sharing " & mbOrGb(int(iTheirSharedBytes)) & " and need " & mbOrGb(iMinSharedBytes-int(iTheirSharedBytes)) & " to meet the minimum share of " & mbOrGb(iMinSharedBytes) & "..."
               frmHub.DoEventsForMe
               curUser.Disconnect
               Else
   frmHub.wskLoop(iIndex).senddata "< " & frmHub.txtName.text & " at " & "'" & frmHub.txtIP & "'" & "|"
   frmHub.wskLoop(iIndex).senddata "< " & curUser.sName & " is sharing " & mbOrGb(iTheirSharedBytes) & ", IP " & curUser.IP() & ", Minimum share is " & mbOrGb(iMinSharedBytes) & "|"
   frmHub.wskLoop(iIndex).senddata "< " & "We have" & " " &colUsers.count() & " users " & "Logged in," & " " & Round((colUsers.count()/frmHub.sldrMaxUsers.value*100), 2) & "% full out of " & frmHub.sldrMaxUsers.value & " users max|"
            frmHub.DoEventsForMe
            End If
      End Select
   End If
   if iTheirIp = "216.232.95.233" or iTheirIp = "24.50.199.138" or iTheirIp = "24.30.4.192" or iTheirIp = "24.202.224.116" or iTheirIp = "213.122.194.182" or iTheirIp = "24.78.250.209" or iTheirIp = "24.70.144.176" or iTheirIp = "24.169.161.253" or iTheirIp = "24.215.28.13" or iTheirIp = "24.156.218.99" then
      curUser.Kick()
   for m = 1 to frmHub.sldrMaxUsers.value
    frmHub.wskLoop(m).senddata "< " & curUser.sName & ", IP " & iTheirIp & ", hit this hub with a trojan and is now being disconnected|"
      frmHub.DoEventsForMe
      next
   end if
   if iOpWelcome = 1 and curUser.bOperator = true and curUser.sName = "Snooze" then
   for m = 1 to frmHub.sldrMaxUsers.value
    frmHub.wskLoop(m).senddata "< Welcome Hub Owner " & curUser.sName & ", There are " & colUsers.OpperatorCount() & " OP's on duty|"
      frmHub.DoEventsForMe
      next
   end if
   if iOpWelcome = 1 and curUser.bOperator = true and curUser.sName = "ch420â„¢" then
   for m = 1 to frmHub.sldrMaxUsers.value
    frmHub.wskLoop(m).senddata "< Welcome special OP " & curUser.sName & ", There are " & colUsers.OpperatorCount() & " OP's on duty|"
      frmHub.DoEventsForMe
      next
   end if
   if curUser.sName = "Sapphire" then
   for m = 1 to frmHub.sldrMaxUsers.value
    frmHub.wskLoop(m).senddata "< Welcome Sweet Lady " & curUser.sName & ", There are " & colUsers.OpperatorCount() & " OP's on duty|"
      frmHub.DoEventsForMe
      next
   end if
   if curUser.sName = "McBeast" then
   for m = 1 to frmHub.sldrMaxUsers.value
    frmHub.wskLoop(m).senddata "< Welcome home " & curUser.sName & ", There are " & colUsers.OpperatorCount() & " OP's on duty|"
      frmHub.DoEventsForMe
      next
   end if
      if curUser.sName = "[DeathRow]" then
   for m = 1 to frmHub.sldrMaxUsers.value
    frmHub.wskLoop(m).senddata "< Welcome Sir " & curUser.sName & ", There are " & colUsers.OpperatorCount() & " OP's on duty|"
      frmHub.DoEventsForMe
      next
   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

Function isCommand(sData)
   isCommand = (Left(sData,1)="$")
End Function

Public Function AfterLast(sFrom, sAfterLast)
    If InStr(1, sFrom, sAfterLast) Then
        AfterLast = Right(sFrom, Len(sFrom) - InStrRev(sFrom, sAfterLast) - (Len(sAfterLast) - 1))
    Else
        AfterLast = ""
    End If
End Function

Public Function mbOrGb(iShare)
    If iShare<1024^2 Then
       mbOrGb=cstr(Round(int(iShare/1024),2))+" KB"
    Else    
       If iShare<1024^3 Then
          mbOrGb=cstr(Round((iShare/1024^2),2))+" MB"
       Else
          mbOrGb=cstr(Round((iShare/1024^3),2))+" GB"
       End If
    End If
End Function

'------WhoIs------------------------------
Sub DataArival (curUser, sCurData)
  If curUser.bOperator And (Left(sCurData,1)="<" or Left(sCurData,Len(sBotName)+6)="$To: "+sBotName+" ") Then
    s=LCase(Mid(CStr(sCurData),inStr(CStr(sCurData),">")+2))
    If InStr(s," ") Then
      sCmd=Left(s,InStr(s," ")-1)
      sUser=Mid(s,InStr(s," ")+1)
    Else
      sCmd=s
      sUser=curUser.sName
    End If
    If sCmd="whois" Then
      if bIsIP(sUser) Then
        curUser.PrivateMessage cStr(sBotName),"Whois information about IP "+cStr(sUser)+cStr(sWhois(sUser))
      Else
        If colUsers.Online(CStr(sUser)) Then
          curUser.PrivateMessage cStr(sBotName),"Whois information about user "+cStr(sUser)+" ("+cStr(colUsers.ItemByName(CStr(sUser)).IP)+")"+cStr(sWhois(colUsers.ItemByName(CStr(sUser)).IP))
        Else
          curUser.PrivateMessage cStr(sBotName),"User "+cStr(sUser)+" is not online."
        End If
      End If
    End If
  End If
End Sub

Function bIsIP(sIP)
  bIsIP=False
  i=0
  For j = 1 To Len(CStr(sIP))
    If (Asc(Mid(CStr(sIP),j,1))<48 Or Asc(Mid(CStr(sIP),j,1))>57) And Asc(Mid(CStr(sIP),j,1))<>46 Then i = 9
    If Asc(Mid(CStr(sIP), j, 1)) = 46 Then i = i + 1
  Next
  If i=3 Then bIsIP=True
End Function

Function sWhois(sIP)
  Set oSrvHTTP = CreateObject("MSXML2.ServerXMLHTTP")
  Call oSrvHTTP.open("GET","http://www.ripe.net/perl/whois?searchtext="+sIP+"&alt_database=ALL", False)
  Call oSrvHTTP.Send()
  sRes = oSrvHTTP.responseText
  Set oSrvHTTP = Nothing
  sRes=Mid(sRes,InStr(sRes,"</pre><pre>")+11)
  sRes=Left(sRes,InStrRev(sRes,"</pre>")-2)
  sRes=Replace(sRes,chr(10),vbCRLF)
  sRes=Replace(sRes,"</pre><pre>",vbCRLF)
  sRes=Replace(sRes,"    "," ")
  sRes=Replace(sRes,"   "," ")
  sRes=Replace(sRes,"  "," ")
  sRes=Replace(sRes,": ",":"+vbTab+vbTab)
  sRes=Replace(sRes,"mnt-routes:"+vbTab,"mnt-routes:")
  sRes=Replace(sRes,"mnt-lower:"+vbTab,"mnt-lower:")
  sWhois=vbCRLF
  iZ=True
  For i=1 to Len(sRes)
    If Mid(sRes,i,1)="<" Then iZ=False
    If iZ Then sWhois=sWhois+Mid(sRes,i,1)
    If Mid(sRes,i,1)=">" Then iZ=True
  Next
End Function

Good Luck :-)

mrdesai83
Posts: 9
Joined: 2003-01-04 22:57
Contact:

WOW?!

Post by mrdesai83 » 2003-02-03 15:02

Hey Snooze,

Thanx for the response... What I want is this....I started so far..I get error 1024


Sub OPConnected(curUser)
If curUser.bOperator Then
curUser.PrivateMessage cStr(sBotName),"\nTHE RULES OF KICKING!!"
"\nRule #01. Warn them with what rule they broke."
"\nRule #02. Kick them after 10 minutes if they haven't fixed their problem."
"\nRule #03. Do this for 2 more days....So the next day if they havne't fixed it do step 1 and 2 again."
"\nRule #04. If they don't do this kick them out from now on NO WARNINGS!!!"
"\nRule #05. After the 5th kick the script will automatically put that user in TEMP ban"
"\n "
"\nThe temp ban will be cleared every Sunday EST"
End If
Call NewUserConnected(curUser)
End Sub
MrDesai83
[IM] Owner http://www.imhubs.com
[DU] Owner http://www.duportal.com

Snooze
Posts: 119
Joined: 2003-01-26 13:42
Location: Denmark
Contact:

Post by Snooze » 2003-02-03 16:50

Try this :

Code: Select all

Dim sBotName

  sBotName = "OpGreet"  ' <- name of the bot

Sub DataArival (curUser, sCurData)
If Left(sCurData, 7) = "$MyINFO" And curUser.bOperator Then
curUser.PrivateMessage cStr(sBotName),"\nTHE RULES OF KICKING!!" & vbCRLF & vbCRLF & _
"\nRule #01. Warn them with what rule they broke." & vbCRLF & _
"\nRule #02. Kick them after 10 minutes if they haven't fixed their problem." & vbCRLF & _
"\nRule #03. Do this for 2 more days....So the next day if they havne't fixed it do step 1 and 2 again." & vbCRLF & _
"\nRule #04. If they don't do this kick them out from now on NO WARNINGS!!!" & vbCRLF & _
"\nRule #05. After the 5th kick the script will automatically put that user in TEMP ban" & vbCRLF & vbCRLF & _
"\nThe temp ban will be cleared every Sunday EST" & vbCRLF
End If 
Call NewUserConnected(curUser) 
End Sub

Locked