# The idea is to be able to include this in other scripts like this:
#
# if {[returnauth nickname]} { blablablabla }
#
# The problem is that the returnauth process ends at the moment the whois
# starts.
# I already tried using return $q_auth behind the whois, but that doesn't work # (obviously)
# Any ideas?
#
# Thanks in advance.
# this is just a temporarily testbind...
bind pub n !testauth checkauth
proc checkauth {nick host hand chan arg} {
putserv "WHOIS [lindex [split $arg] 0]"
}
proc returnauth { } {
global q_auth
putserv "PRIVMSG #pieisyummy :$q_auth"
return $q_auth
}
bind raw - 330 raw:getauth
proc raw:getauth {from key arg} {
global q_auth
set q_auth [lindex [split $arg] 2]
returnauth
}
The best way to start learning is to start helping.
This is because eggdrop only processes one command at a time. It is not possible to read ahead of itself.
What you will need is some form of a callback system. Callback is the process or sending a command that can't complete right away on the spot, at this point, your eggdrop can go about its thing. The funny thing is, it can take one second to one year, and the process will work.
Once the information is available, a new script is called on which a reaction takes place.
Think of the RAW bind as a callback. You send the WHOIS to the server, and then later on the RAW is called once the information is available.