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.

can't read class

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
Fire-Fox
Master
Posts: 299
Joined: Sat Sep 23, 2006 9:01 pm
Location: /dev/null

can't read class

Post by Fire-Fox »

I have this code and i get can't read class all the time

Code: Select all

set userChan "#dev.null" 
set accesschan "#dev.null"

bind join - * joins 

proc joins {nick host hand chan} {

        global userChan mysql_ db_

         if {$chan == $userChan } {

                #mysqluse $mysql_(handle) $mysql_(database)
   set sql [mysqlsel $mysql_(handle) "SELECT * FROM $mysql_(table) WHERE username='[mysqlescape $nick]' AND db_(accessclass) = '$class' "]   
   set result [mysqlsel $mysql_(handle) $sql -list] 

   if {$result > 0 } {
   set result [mysqlsel $mysql_(handle) $sql -list]
putserv "NOTICE $userChan Welcome $nick $class" 
   }
} else { 

putserv "kick $userChan $nick :You are not welcome!" 


mysqlendquery $mysql_(handle)
mysqlendquery $mysql_(handle)
	} 
}
putlog "Access.tcl - Loaded"
GreatZ
Fire-Fox | Denmark

Scripts: Relay | Store Text | TvMaze
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

The $class variable isn't defined before using it, no wonder it's not working.
Once the game is over, the king and the pawn go back in the same box.
Post Reply