| View previous topic :: View next topic |
| Author |
Message |
Hoden Voice
Joined: 21 Sep 2015 Posts: 2
|
Posted: Mon Sep 21, 2015 4:41 pm Post subject: Catching nickserv response |
|
|
I'm developing an script and I need to catch Nickserv response (user mode, specifically). The server's nickserv says this:
| Quote: | Returns whether the user(s) using the given nickname is recognized as the owner of the nickname. The response has this format:
nickname status-code
where nickname is the nickname sent with the command, and status-code is one of the following:
0 - no such user online or nickname not registered
1 - user not recognized as nickname's owner
2 - user recognized as owner via access list only
3 - user recognized as owner via password identification |
What I need is an tcl code to send through /msg something like "/msg nickserv status JohnDoe", and the Nickserv answer needs to be stored on some variable (Nickserv always answer like "JohnDoe 3"). Then I can would use this number (0, 1, 2 or 3) after.
Thanks in advance. |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Mon Sep 21, 2015 8:59 pm Post subject: Re: Catching nickserv response |
|
|
| Hoden wrote: | I'm developing an script ....
|
So you know some TCL , and just need a rough example?
| Quote: |
... and the Nickserv answer needs to be stored on some variable ...
Then I can would use this number (0, 1, 2 or 3) after.
...
|
Play around with this:
| Code: |
# Septermber 21, 2015
# http://forum.egghelp.org/viewtopic.php?t=20044
# What I need is an tcl code to send through /msg something like "/msg nickserv status JohnDoe", and the Nickserv answer needs to be
# stored on some variable (Nickserv always answer like "JohnDoe 3"). Then I can would use this number (0, 1, 2 or 3) after.
# Usage:
# !nickstatus <nick>
#
bind pub - "!nickstatus" do_nick_status
bind notc - "*status*" status_notice
proc do_nick_status {nick uhost handle chan text} {
if {![llength [split $text]]} {
putserv "privmsg $chan :Syntax: !nickstatus <nick> "
return 0
}
putserv "privmsg Nickserv :status [lindex [split $text] 0]"
}
proc status_notice {nick uhost handle text dest} {
# Bot will output on this channel. Just needed somewhere to have
# it put the values, so you can see them.
set chan "#testchan1"
if {[string tolower $nick] ne "nickserv"} {
return 0
}
if {[string tolower [lindex [split $text] 0]] ne "status"} {
return 0
}
set status_nick [lindex [split $text] 1]
set status_value [lindex [split $text] 2]
putserv "privmsg $chan : "
putserv "privmsg $chan :status_nick is: $status_nick"
putserv "privmsg $chan :status_value is: $status_value"
}
|
With a couple brief tests on an irc network that has what seems to be the same Status command, it worked. _________________ For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia ! |
|
| Back to top |
|
 |
Hoden Voice
Joined: 21 Sep 2015 Posts: 2
|
Posted: Mon Oct 19, 2015 3:01 pm Post subject: |
|
|
| This script works very nice, thank you! |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|