I've seen a few topics on this, and I know it is based on the network you're on, but I just can't seem to get it to work with what I am wanting. So here is a little background. I have a script that will send an invite to users who are in a database file. However, I want the script to check if the user is registered before it sends the invite. I was hoping to do something like:
if {[isregistered $nick]} {
then do this
}
Or something similar to it. I've tried a few different ways, but just can't seem to get it to work. It doesn't have to be like it is above, but something that will check if they're registered and then continue if so, or return if not.
Here is what I've tried and has been the closest:
Code: Select all
proc nfo:usr {nick host hand text {dest ""}} {
global zop botnick is_reg
set from "NickServ"
set is_reg "0"
if {([string match -nocase "*3*" $text]) && ([string match -nocase "NickServ" $from])} {
log "$nick is registered. 3."
set is_reg "1"
} else {
log "$nick is not registered. 0."
set is_reg "0"
}
return 0
}
proc invite {nick uhost handle arg} {
global infodb ui_entries chan_1 is_reg
bind notc - "*" nfo:usr
putquick "PRIVMSG nickserv :status $nick"
if {$is_reg == "0"} { return 0 }