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.

procedure not being ran, :(

Help for those learning Tcl or writing their own scripts.
Post Reply
l
le0pard
Voice
Posts: 1
Joined: Thu Dec 22, 2005 4:26 pm

procedure not being ran, :(

Post by le0pard »

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"
  }
}
web:verify procedure isnt ever being ran - Is this something simple that I'm over looking?
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

It is being called by the egghttp:geturl command.
Post Reply