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

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

Script request

Post by Animated 0wner » 2003-07-02 04: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 11:41
Location: uk

Post by Paul_Don » 2003-07-02 17: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 11:24
Location: Finland

Post by Gadget » 2003-07-02 21: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 11:41
Location: uk

Post by Paul_Don » 2003-07-02 21: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 11:41
Location: uk

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

gadget wins :oops:

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

Post by Animated 0wner » 2003-07-03 00:43

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

Who is online

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