Posted to tcl by Surmaelk at Fri Jan 10 13:56:00 GMT 2020view raw

  1. i get this: expected integer but got "-xxx"
  2.  
  3. ind pub -|- !start rlsadd
  4. proc rlsadd {nick uhost handle chan text} {
  5. if {![channel get [string tolower $chan] rlsAdd]} { return 0 }
  6. global dbInfo
  7. if {[scan $text {%s} rlsname] != 1} {
  8. putserv "NOTICE $nick :Usage: !start <rls>"
  9. return
  10. }
  11. variable dbInfo
  12. if {[scan $dbInfo %s%s%s%s hostname username password database] != 4} return
  13. set time [unixtime]
  14.  
  15. set rlsname [::mysql::escape $rlsname]
  16. set nick [::mysql::escape $nick]
  17. set con [::mysql::connect -host $hostname -user $username -password $password -db $database]
  18. #set query [::mysql::query $con "SELECT rlsname,nick,unixtime FROM releases WHERE rlsname = '$rlsname'"]
  19. set query1 [mysqlsel $con "SELECT rlsname,nick,unixtime FROM releases WHERE rlsname = '$rlsname'" -flatlist];
  20. #if {[::mysql::fetch $query ]!=""}
  21. if {$query1 !=""} {
  22.  
  23. foreach {rlsname timestamp nick} $query1 {
  24. putlog "RLS: $rlsname / $nick / $timestamp "
  25. set predago [getpred $timestamp]
  26.  
  27. puthelp "PRIVMSG $chan \0037RLS\003:\0039$rlsname\003 \0037Allerede Startet Af\003 $nick $predago"
  28. putlog "RLS: $rlsname / $nick / $predago "
  29. }
  30. } else {
  31. set query [::mysql::query $con "INSERT INTO releases (id,unixtime,rlsname,nick) VALUES (NULL, UNIX_TIMESTAMP(), '$rlsname', '$nick')"]
  32. 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] \]"
  33. putlog "RLS: $rlsname / $nick / $time "
  34. }
  35. ::mysql::endquery $con
  36. ::mysql::close $con
  37. }