Let's start with to say I'm a complete newbie in TCL / Eggdrop coding (Coded primarily PHP in my life


Well, here is my really basic script

Code: Select all
set dbhost "*****"
set dbuser "*****"
set dbpass "*****"
set dbname "*****"
proc pub_score {nick uhost hand channel arg} {
global usertable botnick dbuser dbname dbpass dbhost
sql connect $dbhost $dbuser $dbpass
sql selectdb $dbname
if {$arg == ""} {
puthelp "NOTICE $nick :USAGE: !score <nick>"
sql disconnect
return 0
} {
set scorez [lrange $arg 0 end]
set row [sql "SELECT score FROM table WHERE user='$scorez'"]
set score [lindex $row 0]
puthelp "NOTICE $nick :$scorez has score $table(score)"
sql disconnect
return 0
}
}
bind pub - !score pub_score
Anyone got any hints for me to go on ?
