This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Checking if user is registered and identified with services

Old posts that have not been replied to for several years.
Locked
D
Dan

Checking if user is registered and identified with services

Post by Dan »

Hey,
I'm writing a little script for staff users on my server, basically I want the bot to be able to do things if they're a staff member.
What I want to be able to do it check either their IRC flags, or their whois to check that they have +r (or NICK is registered) to make sure that they are who they say they are. (i.e. to stop another user coming in with their name and access the bot functions before the 30seconds no identify protection kicks it).

Any suggestions would be appreciated. Thanks :)
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

depends on your network...
qnet for example returns a raw 330 with the auth of a user on a whois, etc
D
Dan

Post by Dan »

UnrealIRCD3.2 - beta 19 :)
s
soul
Voice
Posts: 31
Joined: Fri Apr 25, 2003 6:25 pm
Location: Portugal

Post by soul »

beside using raw's, some irc deamons support STATUS command.

ie : NickServ STATUS nick , will retrieve his/her numbered status.

 · · [ NickServ (ident@network.org) ] STATUS <somenick> 3
online and identified

· · [ NickServ (ident@network.org) ] STATUS <somenick> 0
offline

· · [ NickServ (ident@network.org) ] STATUS <somenick> 1
online

if your ircd uses so, start with a notice binding :)

regards,
i'll believe in justice when the pope is accused {
if {$true == "$censured" }{return nothing}}
D
Dan

Post by Dan »

That's very helpful, thank you.
I'm confused now though. I have a bind join one because it needs to check whether they're registered when they enter the room. Do I just make that function push the notice, then another bind that grabs that notice?
s
soul
Voice
Posts: 31
Joined: Fri Apr 25, 2003 6:25 pm
Location: Portugal

Post by soul »

does your ircd support STATUS command?

i have a script that checks nick STATUS in services every time they execute a bind.

forcing the bot to recognize users for the time they stay on chan, might get you insecure (parts, quits, netsplits, nickchanges).

and yes, you need a bind notc to grab the NickServ status.
i'll believe in justice when the pope is accused {
if {$true == "$censured" }{return nothing}}
User avatar
TALES
Halfop
Posts: 59
Joined: Sun Nov 09, 2003 8:45 am
Location: Netherlands
Contact:

Post by TALES »

here is a script that detect if a nick is reg modify the code for your needs

Code: Select all

#set this to channel
set scan(chan) "#VHOSTS"

# Set this to the bot's O-Line username #
set oper(username) ""

# Set this to the bots O-Line password #
set oper(password) ""


## script starts here

bind msg O oper oper-up
bind join - "$scan(chan) *" tls:join
bind raw - 307 tls:ident
bind pub -|- !vhost tls:vhost
bind evnt - init-server oper:connect

proc oper:connect init-server {
putserv "OPER $::oper(username) $::oper(password)"
}

proc oper-up {nick host chan text} {
  global operid operpass owner2
  putserv "OPER $::oper(username) $::oper(password)"
  putserv "NOTICE $nick : I Opered up"
}

proc tls:join {nick host hand chan} {
 global tls_nick tls_ident
  set tls_ident "1"
  set tls_nick $nick  
  putserv "WHOIS $nick"
  utimer 3 tls:not:ident
}

proc tls:vhost {nick host hand chan vhost} {
 global tls_nick tls_ident tls_vhost scan(chan)
  if {$scan(chan) != $chan} {return 0}
  set tls_ident "2"
  set tls_vhost [lindex $vhost 0]
  set tls_nick $nick  
  putserv "WHOIS $nick"
  utimer 3 tls:not:ident
}

proc tls:ident {from key args} {
 global tls_ident tls_nick tls_vhost
  set args [join $args]
  set nick [string tolower [lindex $args 1]]
  set regist [strlwr [lindex [lrange [split $args ":"] 1 end] 0]]
  if {$tls_ident == "1" && $regist == "is a registered nick"} {
    foreach j [utimers] {
        if {[lindex $j 1] == "tls:not:ident"} { killutimer [lindex $j 2] }
      }
   putserv "PRIVMSG #vhosts :$nick is: Registered and could change is VHOST with cmd: !vhost <vhost>"
   }
  if {$tls_ident == "2" && $regist == "is a registered nick"} {
    foreach j [utimers] {
        if {[lindex $j 1] == "tls:not:ident"} { killutimer [lindex $j 2] }
      }
  putserv "CHGHOST $tls_nick $tls_vhost"
  putserv "NOTICE $tls_nick : Your Vhost has been changed"
  } 
  return 0
}

proc tls:not:ident {} {
 global tls_nick
 putserv "PRIVMSG #vhosts :$tls_nick is: NOT Registered first registered your nick and identify"
 putserv "PRIVMSG #vhosts :Type: /msg nickserv help REGISTER"
}
works only in 1 channel though
D
Dan

Post by Dan »

Thanks everyone, I got it done :)
S
SmokeyOne
Halfop
Posts: 69
Joined: Tue Jan 14, 2003 6:04 am

Post by SmokeyOne »

if someone was to maybe add a badword list in there, wouldn't that just be annoying to modify in the code, or would it be a easy patch ?
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

There are badword scripts already in the tcl archive.
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
Locked