Code: Select all
proc web:check {account} {
egghttp:geturl http://caleague.com/?page=calclub&standalone=1&authserv_account=[set account] web:verify
}
proc web:verify {sock} {
set headers [egghttp:headers $sock]
set body [egghttp:data $sock]
putlog "Body: $body"
if {![string match -nocase "Authserv account not in database" [set body]]} {
if {[string match -nocase *<division>* $body]} {
foreach line [split $body \n] {
if {[string match -nocase <division> $line]} {
lappend division $line
}
}
putlog "$division"
if {[string match -nocase #calclub-im $::invite(chan)} {
if {[string match -nocase csp $division] || [string match -nocase csm $division] || [string match -nocase csim $division]} {
puthelp "INVITE $::invite(user) #calclub-im"
puthelp "PRIVMSG $::invite(user) :You have been invited to join #CALClub-IM"
} else {
puthelp "PRIVMSG $::invite(user) :You are not CS 1.6 Intermediate+"
}
}
} else {
puthelp "PRIVMSG $::invite(user) :You are not currently in a CS 1.6 Division."
}
} else {
puthelp "PRIVMSG $::invite(user) :Your AuthServ account does not exist in the CAL database. Please edit your CAL user profile and wait up to 3 hours for the database to reset."
}
}
proc msg:inviteme {nick uhost handle text} {
if {[string match -nocase *@*.*.gamesurge $uhost]} {
if {[llength $text] == "2"} {
puthelp "PRIVMSG $nick :Checking your current leagues."
global invite
set invite(user) [set nick]
set invite(chan) [lindex $text 2]
set uhost2 [lindex [split $uhost @] 1]
set account [lindex [split $uhost2 .] 0]
web:check $account
} else {
puthelp "PRIVMSG $nick :Syntax Error. Correct Syntax: .inviteme #channel"
}
} else {
puthelp "PRIVMSG $nick :You must be using mode +x (Host Hiding) to be invited"
}
}