#Mysql Info
set mysql(host) "*"
set mysql(port) "*"
set mysql(user) "*"
set mysql(pass) "*"
set mysql(datae) "*"
set mysql(vers) "2.30"
package require mysqltcl $mysql(vers)
#Timer afgøre hvor tit reklamen bliver skrevet sat til 30 min standart
set time 1
#Det anbefales ikke at ændre noget under denne linie
setudef flag softad
if {[string compare [string index $time 0] "!"] == 0} { set timer [string range $time 1 end] } { set timer [expr $time * 60] }
if {[lsearch -glob [utimers] "* gos *"] == -1} { utimer $timer gos }
proc gos {} {
global mysql channel time timer
foreach chan [channels] {
if {[lsearch -exact [channel info $chan] +softad] > -1} {
set mysql(conn) [mysqlconnect -host $mysql(host) -port $mysql(port) -user $mysql(user) -password $mysql(pass)]
mysqluse $mysql(conn) $mysql(datae)
if {[string equal -nocase $chan "#Icemat"]} {
foreach query [mysqlsel $mysql(conn) "SELECT * FROM softad where ad LIKE '%Icemat%' ORDER BY RAND() LIMIT 1;" -list] {
putserv "PRIVMSG $chan :[lindex $query 1] "
}
} else {
foreach query [mysqlsel $mysql(conn) "SELECT * FROM softad ORDER BY RAND() LIMIT 1;" -list] {
putserv "PRIVMSG $chan :[lindex $query 1] "
}
}
}
}
if {[lsearch -glob [utimers] "* gos *"] == -1} { utimer $timer gos }
mysqlclose $mysql(conn)
}
putlog "\002SoftTrading Add\002"
but if i change it and ad a elseif it´s messing up
[20:45] Tcl error in script for 'timer4':
[20:45] wrong # args: should be "foreach varList list ?varList list ...? command
"
#Mysql Info
set mysql(host) "*"
set mysql(port) "*"
set mysql(user) "*"
set mysql(pass) "*"
set mysql(datae) "*"
set mysql(vers) "2.30"
package require mysqltcl $mysql(vers)
#Timer afgøre hvor tit reklamen bliver skrevet sat til 30 min standart
set time 1
#Det anbefales ikke at ændre noget under denne linie
setudef flag softad
if {[string compare [string index $time 0] "!"] == 0} { set timer [string range $time 1 end] } { set timer [expr $time * 60] }
if {[lsearch -glob [utimers] "* gos *"] == -1} { utimer $timer gos }
proc gos {} {
global mysql channel time timer
foreach chan [channels] {
if {[lsearch -exact [channel info $chan] +softad] > -1} {
set mysql(conn) [mysqlconnect -host $mysql(host) -port $mysql(port) -user $mysql(user) -password $mysql(pass)]
mysqluse $mysql(conn) $mysql(datae)
if {[string equal -nocase $chan "#Icemat"]} {
foreach query [mysqlsel $mysql(conn) "SELECT * FROM softad where ad LIKE '%Icemat%' ORDER BY RAND() LIMIT 1;" -list] {
putserv "PRIVMSG $chan :[lindex $query 1] "
}
} elseif {[string equal -nocase $chan "#Steelpad"]} {
foreach query [mysqlsel $mysql(conn) "SELECT * FROM softad where ad LIKE '%Icemat%' ORDER BY RAND() LIMIT 1;" -list] {
putserv "PRIVMSG $chan :[lindex $query 1] "
}
} else {
foreach query [mysqlsel $mysql(conn) "SELECT * FROM softad ORDER BY RAND() LIMIT 1;" -list] {
putserv "PRIVMSG $chan :[lindex $query 1] "
}
}
}
}
if {[lsearch -glob [utimers] "* gos *"] == -1} { utimer $timer gos }
mysqlclose $mysql(conn)
}
putlog "\002SoftTrading Add\002"
How to fix this :\