Script request

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
Animated 0wner
Posts: 36
Joined: 2003-04-09 04:04

Script request

Post by Animated 0wner » 2003-07-01 23:08

I was wondering if any of you scripters out there could write me a script that would announce a vips entrance into the hub. No rush on this, just if you're interested and have some free time. :D

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

Post by Paul_Don » 2003-07-02 12:19

Code: Select all

Sub NewUserConnected(curUser)

strTrig = lcase("$name1$name2$name3$") 
If instr(1, strtrig, "$" & lcase(curUser.sName) & "$") then 
  colUsers.SendChatToAll "Hub-Security", "ViP " & curUser.sName & " has entered." 
End if 
Exit Sub
Just hard Code ViP's where u see $name1$name2$name3$

Gadget
Posts: 62
Joined: 2003-01-11 06:24
Location: Finland
Contact:

Post by Gadget » 2003-07-02 16:26

Actually previous script wont work in NMDCHub if the vips are registered (reg users trigger OPConnected sub). Here's one universal with customizable messages to ops, registered users, normal users and by nick:

Code: Select all

'WelcomeMsg by Gadget

Dim sBotName, sUserMsg, sRegMsg, sOpMsg, oUser
Sub Main
 sBotName = "WelcomeBot"
 sUserMsg = "The User %USER% has logged in."
 sRegMsg = "The Registered User %USER% has logged in"
 sOpMsg = "The Operator %USER% has logged in"
 Set oUser = CreateObject("Scripting.Dictionary") 
 oUser("HubOwnerNick")="Tha Hubowner %USER% has logged in" '<-- Customized messages for anyone with the nick
 oUser("SomeLamerNick")="Hi, i'm stupid, check my shares please"  '<- add as much lines of custom messages as needed
End Sub

Sub OpConnected(curUser)
 Call NewUserConnected(curUser)
End Sub

Sub NewUserConnected(curUser)  
 If oUser.Exists(curUser.sName) Then 
  sMsg=oUser(curUser.sName)
 ElseIf curUser.bOperator Then
  sMsg=sOpMsg
 ElseIf frmHub.lstOps.FindItem(curUser.sName) Is Nothing Then
  sMsg=sUserMsg
 Else
  sMsg=sRegMsg
 End If
 If sMsg<>"" Then colUsers.SendChatToAll CStr(sBotName), CStr(Replace(sMsg,"%USER%",curUser.sName))
End Sub
If you don't need i.e. normal user messages, just set sUserMsg = ""

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

Post by Paul_Don » 2003-07-02 16:29

ok just add

Code: Select all

Sub OpConnected(curUser) 
  Call NewUserConnected(curUser) 
End Sub
to the script also :P

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

Post by Paul_Don » 2003-07-02 16:38

gadget wins :oops:

Animated 0wner
Posts: 36
Joined: 2003-04-09 04:04

Post by Animated 0wner » 2003-07-02 19:43

Thank you both for your quick replies! Very much appreciated :D

Locked