Op welcome script

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
Paul_Don
Posts: 146
Joined: 2003-01-29 06:41
Location: uk
Contact:

Op welcome script

Post by Paul_Don » 2003-01-29 06:52

Another problem with this script

Code: Select all

Sub OpConnected (curUser) 
If curUser.bOperator As True Then 

  If curUser.sName="[DK]-TheHacker.Dk" Then 
  curUser.SendToAll "<Operator Login> The Main Operator has joined the hub" 
  End If 
  
  If curuser.sName="[DK][SGC]Muligvis" Then 
  curUser.SendToAll "<Operator Login> The CO-Main Operator has joined the hub" 
  End If 
  
  If curuser.sName="OP 3" Then 
  curuser.SendToAll "<Operator Login> Enter text here" 
  End If 
  
  If curuser.sName="OP 4" Then 
  curuser.SendToAll "<Operator Login> Enter text here" 
  End If  

  If curuser.sName="OP 5" Then 
  curuser.SendToAll "<Operator Login> Enter text here" 
  End If 

  If curuser.sName="OP 6" Then 
  curuser.SendToAll "<Operator Login> Enter text here" 
  End If 


If not(curUser.sName="[DK]-TheHacker.Dk" or curuser.sName="[DK][SGC]Muligvis" or curuser.sName="OP 3" or curuser.sName="OP 4" or curuser.sName="OP 5" or curuser.sName="OP 6") Then 
'the other OPs get this login message 
  curuser.Sendtoall "<Operator Login> The Operator " & curuser.sName & " has logged in. " 
  End If 
  
End If 
End Sub

Earlier someone had a problem with and expected "If" now with this code im gettin a problem expected "Then" ive even had a syntax error aswell i dont understand it on the other post the lad said it worked :cry:

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 09:32
Contact:

Post by Sedulus » 2003-01-29 09:05

I don't know vbscript, but shouldn't "curUser.bOperator As True" be "curUser.bOperator = True" or simply "curUser.bOperator"?
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

aDe
Forum Moderator
Posts: 138
Joined: 2003-01-07 09:14
Location: SE
Contact:

Post by aDe » 2003-01-29 09:09

Instead of your last if-block:

Code: Select all

If not(curUser.sName="[DK]-TheHacker.Dk" or curuser.sName="[DK][SGC]Muligvis" or curuser.sName="OP 3" or curuser.sName="OP 4" or curuser.sName="OP 5" or curuser.sName="OP 6") Then 
'the other OPs get this login message 
Ê curuser.Sendtoall "<Operator Login> The Operator " & curuser.sName & " has logged in. " 
Ê End If
...use this:

Code: Select all

strOpList = "$[DK]-TheHacker.Dk$[DK][SGC]Muligvis$OP 3$OP 4$OP 5$OP 6$"
If instr(1, Lcase(strOpList), LCase("$" & curUser.sName & "$")) = 0 then
'the other OPs get this login message
colUsers.SendToAll "<Operator Login> The Operator " & curuser.sName & " has logged in. " 
end if


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

Post by Paul_Don » 2003-01-29 09:28

i actually sorted it out liek 15 minutes ago
heres what i done :)

Code: Select all

Sub OpConnected(curUser)

  If curUser.sName="Paul_Don" Then 
  curUser.SendToAll "<[uF]> Gangsta ass Pauly Donny has entered this hub" 
  End If
  
  
  
    If not(curUser.sName="Paul_Don" or curuser.sName="psf8500" or curuser.sName="DFX" )Then
 
 ChatToAll curUser, "[uF]", " Hardcore garage head " & curUser.sName & " has entered the room!"
End If
end Sub

Locked