Posted to tcl by Surmaelk at Fri Jan 10 13:56:00 GMT 2020view raw
- i get this: expected integer but got "-xxx"
- ind pub -|- !start rlsadd
- proc rlsadd {nick uhost handle chan text} {
- if {![channel get [string tolower $chan] rlsAdd]} { return 0 }
- global dbInfo
- if {[scan $text {%s} rlsname] != 1} {
- putserv "NOTICE $nick :Usage: !start <rls>"
- return
- }
- variable dbInfo
- if {[scan $dbInfo %s%s%s%s hostname username password database] != 4} return
- set time [unixtime]
- set rlsname [::mysql::escape $rlsname]
- set nick [::mysql::escape $nick]
- set con [::mysql::connect -host $hostname -user $username -password $password -db $database]
- #set query [::mysql::query $con "SELECT rlsname,nick,unixtime FROM releases WHERE rlsname = '$rlsname'"]
- set query1 [mysqlsel $con "SELECT rlsname,nick,unixtime FROM releases WHERE rlsname = '$rlsname'" -flatlist];
- #if {[::mysql::fetch $query ]!=""}
- if {$query1 !=""} {
- foreach {rlsname timestamp nick} $query1 {
- putlog "RLS: $rlsname / $nick / $timestamp "
- set predago [getpred $timestamp]
- puthelp "PRIVMSG $chan \0037RLS\003:\0039$rlsname\003 \0037Allerede Startet Af\003 $nick $predago"
- putlog "RLS: $rlsname / $nick / $predago "
- }
- } else {
- set query [::mysql::query $con "INSERT INTO releases (id,unixtime,rlsname,nick) VALUES (NULL, UNIX_TIMESTAMP(), '$rlsname', '$nick')"]
- puthelp "PRIVMSG $chan :\0037RLS\003: \0039$rlsname\003 \0037Startet af\003 $nick \[ \00314DATE:\003 [clock format $time -format %d-%m-%Y] \] \[ \00314Time:\003 [clock format $time -format %H:%M:%S] \]"
- putlog "RLS: $rlsname / $nick / $time "
- }
- ::mysql::endquery $con
- ::mysql::close $con
- }